TDLightTelegramBots/telegrambots-meta/src/main/java/org/telegram/telegrambots/meta/api/objects/User.java

121 lines
4.3 KiB
Java
Raw Normal View History

2018-07-08 01:41:21 +02:00
package org.telegram.telegrambots.meta.api.objects;
2016-01-14 01:14:53 +01:00
import com.fasterxml.jackson.annotation.JsonProperty;
2020-10-31 18:43:32 +01:00
import lombok.AllArgsConstructor;
2020-11-01 23:46:36 +01:00
import lombok.EqualsAndHashCode;
import lombok.Getter;
2020-10-31 18:43:32 +01:00
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
2020-11-01 23:46:36 +01:00
import lombok.Setter;
import lombok.ToString;
2018-07-08 01:41:21 +02:00
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
2016-01-14 01:14:53 +01:00
/**
* This object represents a Telegram user or bot.
2016-01-14 01:14:53 +01:00
* @author Ruben Bermudez
2022-06-18 00:40:30 +02:00
* @version 6.1
2016-01-14 01:14:53 +01:00
*/
2020-11-01 23:46:36 +01:00
@EqualsAndHashCode(callSuper = false)
@Getter
@Setter
@ToString
2020-10-31 18:43:32 +01:00
@NoArgsConstructor
@AllArgsConstructor
@RequiredArgsConstructor
public class User implements BotApiObject {
2016-04-11 02:53:53 +02:00
private static final String ID_FIELD = "id";
private static final String FIRSTNAME_FIELD = "first_name";
2017-08-23 09:06:32 +02:00
private static final String ISBOT_FIELD = "is_bot";
2016-04-11 02:53:53 +02:00
private static final String LASTNAME_FIELD = "last_name";
private static final String USERNAME_FIELD = "username";
2017-05-11 01:35:44 +02:00
private static final String LANGUAGECODE_FIELD = "language_code";
2020-01-24 00:23:29 +01:00
private static final String CANJOINGROUPS_FIELD = "can_join_groups";
private static final String CANREADALLGROUPMESSAGES_FIELD = "can_read_all_group_messages";
private static final String SUPPORTINLINEQUERIES_FIELD = "supports_inline_queries";
2022-06-18 00:40:30 +02:00
private static final String ISPREMIUM_FIELD = "is_premium";
private static final String ADDEDTOATTACHMENTMENU_FIELD = "added_to_attachment_menu";
2022-01-29 16:06:56 +01:00
private static final String IS_VERIFIED_FIELD = "is_verified";
private static final String IS_RESTRICTED_FIELD = "is_restricted";
private static final String IS_CREATOR_FIELD = "is_creator";
private static final String IS_SCAM_FIELD = "is_scam";
2022-02-24 02:04:29 +01:00
private static final String IS_SUPPORT_FIELD = "is_support";
2022-01-29 16:06:56 +01:00
private static final String IS_FAKE_FIELD = "is_fake";
private static final String IS_DELETED_FIELD = "is_deleted";
2021-03-09 11:59:28 +01:00
/**
* Unique identifier for this user or bot.
*
* @apiNote This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it.
* But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(ID_FIELD)
2020-10-31 18:43:32 +01:00
@NonNull
private Long id;
/**
* User‘s or bot’s first name
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(FIRSTNAME_FIELD)
2020-10-31 18:43:32 +01:00
@NonNull
private String firstName;
/**
* True, if this user is a bot
*/
2017-08-23 09:06:32 +02:00
@JsonProperty(ISBOT_FIELD)
2020-10-31 18:43:32 +01:00
@NonNull
private Boolean isBot;
/**
* Optional. User‘s or bot’s last name
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(LASTNAME_FIELD)
private String lastName;
/**
* Optional. User‘s or bot’s username
*/
2016-01-14 01:14:53 +01:00
@JsonProperty(USERNAME_FIELD)
private String userName;
/**
* Optional. IETF language tag of the user's language
*/
2017-05-11 01:35:44 +02:00
@JsonProperty(LANGUAGECODE_FIELD)
private String languageCode;
/**
* Optional. True, if the bot can be invited to groups. Returned only in getMe.
*/
2020-01-24 00:23:29 +01:00
@JsonProperty(CANJOINGROUPS_FIELD)
private Boolean canJoinGroups;
/**
* Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
*/
2020-01-24 00:23:29 +01:00
@JsonProperty(CANREADALLGROUPMESSAGES_FIELD)
private Boolean canReadAllGroupMessages;
/**
* Optional. True, if the bot supports inline queries. Returned only in getMe.
*/
2020-01-24 00:23:29 +01:00
@JsonProperty(SUPPORTINLINEQUERIES_FIELD)
private Boolean supportInlineQueries;
/**
* Optional. True, if this user is a Telegram Premium user
*/
2022-06-18 00:40:30 +02:00
@JsonProperty(ISPREMIUM_FIELD)
private Boolean isPremium;
/**
* Optional. True, if this user added the bot to the attachment menu
*/
2022-06-18 00:40:30 +02:00
@JsonProperty(ADDEDTOATTACHMENTMENU_FIELD)
private Boolean addedToAttachmentMenu;
2022-01-29 16:06:56 +01:00
@JsonProperty(IS_VERIFIED_FIELD)
private Boolean isVerified; ///< Optional. Extra.
@JsonProperty(IS_CREATOR_FIELD)
private Boolean isCreator; ///< Optional. Extra.
@JsonProperty(IS_SCAM_FIELD)
private Boolean isScam; ///< Optional. Extra.
2022-02-24 02:04:29 +01:00
@JsonProperty(IS_SUPPORT_FIELD)
private Boolean isSupport; ///< Optional. Extra.
2022-01-29 16:06:56 +01:00
@JsonProperty(IS_FAKE_FIELD)
private Boolean isFake; ///< Optional. Extra.
@JsonProperty(IS_DELETED_FIELD)
private Boolean isDeleted; ///< Optional. Extra.
2016-01-14 01:14:53 +01:00
}