Fix typo in package

This commit is contained in:
Victor 2018-12-12 17:28:25 +02:00
parent 9a6682688e
commit 1099ea07a3
17 changed files with 1178 additions and 0 deletions

View File

@ -0,0 +1,135 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to an mp3 audio file stored on the Telegram servers. By default, this
* audio file will be sent by the user. Alternatively, you can use input_message_content to send a
* message with the specified content instead of the audio.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedAudio implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String AUDIO_FILE_ID_FIELD = "audio_file_id";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "audio"; ///< Type of the result, must be "audio"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result
@JsonProperty(AUDIO_FILE_ID_FIELD)
private String audioFileId; ///< A valid file identifier for the audio file
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the audio
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Audio caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedAudio() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedAudio setId(String id) {
this.id = id;
return this;
}
public String getAudioFileId() {
return audioFileId;
}
public InlineQueryResultCachedAudio setAudioFileId(String audioFileId) {
this.audioFileId = audioFileId;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedAudio setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedAudio setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedAudio setCaption(String caption) {
this.caption = caption;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedAudio setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (audioFileId == null || audioFileId.isEmpty()) {
throw new TelegramApiValidationException("AudioFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedAudio{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", audioFileId='" + audioFileId + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,164 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a link to a file stored on the Telegram servers. By default, this file will be
* sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the file.
* @note Currently, only pdf-files and zip archives can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
*/
public class InlineQueryResultCachedDocument implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String TITLE_FIELD = "title";
private static final String DOCUMENT_FILE_ID_FIELD = "document_file_id";
private static final String DESCRIPTION_FIELD = "description";
private static final String CAPTION_FIELD = "caption";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "document"; ///< Type of the result, must be "document"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title for the result
@JsonProperty(DOCUMENT_FILE_ID_FIELD)
private String documentFileId; ///< A valid file identifier for the file
@JsonProperty(DESCRIPTION_FIELD)
private String description; ///< Optional. Short description of the result
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the document to be sent, 0-200 characters
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the file
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedDocument() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedDocument setId(String id) {
this.id = id;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedDocument setTitle(String title) {
this.title = title;
return this;
}
public String getDocumentFileId() {
return documentFileId;
}
public InlineQueryResultCachedDocument setDocumentFileId(String documentFileId) {
this.documentFileId = documentFileId;
return this;
}
public String getDescription() {
return description;
}
public InlineQueryResultCachedDocument setDescription(String description) {
this.description = description;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedDocument setCaption(String caption) {
this.caption = caption;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedDocument setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedDocument setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedDocument setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (documentFileId == null || documentFileId.isEmpty()) {
throw new TelegramApiValidationException("DocumentFileId parameter can't be empty", this);
}
if (title == null || title.isEmpty()) {
throw new TelegramApiValidationException("Title parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedDocument{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", title='" + title + '\'' +
", documentFileId='" + documentFileId + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", replyMarkup=" + replyMarkup +
", inputMessageContent=" + inputMessageContent +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,144 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a link to an animated GIF file stored on the Telegram servers. By default, this
* animated GIF file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with specified content instead of the animation.
*/
public class InlineQueryResultCachedGif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String GIF_FILE_ID_FIELD = "gif_file_id";
private static final String TITLE_FIELD = "title";
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "gif"; ///< Type of the result, must be "gif"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(GIF_FILE_ID_FIELD)
private String gifFileId; ///< A valid file identifier for the GIF file
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title for the result
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the GIF file to be sent
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the GIF animation
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedGif() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedGif setId(String id) {
this.id = id;
return this;
}
public String getGifFileId() {
return gifFileId;
}
public InlineQueryResultCachedGif setGifFileId(String gifFileId) {
this.gifFileId = gifFileId;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedGif setTitle(String title) {
this.title = title;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedGif setCaption(String caption) {
this.caption = caption;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedGif setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedGif setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedGif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (gifFileId == null || gifFileId.isEmpty()) {
throw new TelegramApiValidationException("GifFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedGif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", gifFileId='" + gifFileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,146 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default,
* this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can
* use input_message_content to send a message with the specified content instead of the animation.
* @date 01 of January of 2016
*/
public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String MPEG4_FILE_ID_FIELD = "mpeg4_file_id";
private static final String TITLE_FIELD = "title";
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "mpeg4_gif"; ///< Type of the result, must be "mpeg4_gif"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(MPEG4_FILE_ID_FIELD)
private String mpeg4FileId; ///< A valid file identifier for the MP4 file
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title for the result
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the MPEG-4 file to be sent
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedMpeg4Gif() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedMpeg4Gif setId(String id) {
this.id = id;
return this;
}
public String getMpeg4FileId() {
return mpeg4FileId;
}
public InlineQueryResultCachedMpeg4Gif setMpeg4FileId(String mpeg4FileId) {
this.mpeg4FileId = mpeg4FileId;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedMpeg4Gif setTitle(String title) {
this.title = title;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedMpeg4Gif setCaption(String caption) {
this.caption = caption;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedMpeg4Gif setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedMpeg4Gif setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedMpeg4Gif setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (mpeg4FileId == null || mpeg4FileId.isEmpty()) {
throw new TelegramApiValidationException("Mpeg4FileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedMpeg4Gif{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", mpeg4FileId='" + mpeg4FileId + '\'' +
", title='" + title + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,157 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a link to a photo stored on the Telegram servers. By default, this photo will
* be sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the photo.
*/
public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String PHOTOFILEID_FIELD = "photo_file_id";
private static final String TITLE_FIELD = "title";
private static final String DESCRIPTION_FIELD = "description";
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "photo"; ///< Type of the result, must be photo
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(PHOTOFILEID_FIELD)
private String photoFileId; ///< A valid file identifier of the photo
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title for the result
@JsonProperty(DESCRIPTION_FIELD)
private String description; ///< Optional. Short description of the result
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the photo to be sent
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedPhoto() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedPhoto setId(String id) {
this.id = id;
return this;
}
public String getPhotoFileId() {
return photoFileId;
}
public InlineQueryResultCachedPhoto setPhotoFileId(String photoFileId) {
this.photoFileId = photoFileId;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedPhoto setTitle(String title) {
this.title = title;
return this;
}
public String getDescription() {
return description;
}
public InlineQueryResultCachedPhoto setDescription(String description) {
this.description = description;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedPhoto setCaption(String caption) {
this.caption = caption;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedPhoto setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedPhoto setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedPhoto setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (photoFileId == null || photoFileId.isEmpty()) {
throw new TelegramApiValidationException("PhotoFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedPhoto{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", photoFileId='" + photoFileId + '\'' +
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,109 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Represents a link to a sticker stored on the Telegram servers. By default, this sticker
* will be sent by the user. Alternatively, you can use input_message_content to send a message with
* the specified content instead of the sticker.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
*/
public class InlineQueryResultCachedSticker implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String STICKER_FILE_ID_FIELD = "sticker_file_id";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
@JsonProperty(TYPE_FIELD)
private final String type = "sticker"; ///< Type of the result, must be "sticker"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(STICKER_FILE_ID_FIELD)
private String stickerFileId; ///< A valid file identifier of the sticker
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the sticker
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
public InlineQueryResultCachedSticker() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedSticker setId(String id) {
this.id = id;
return this;
}
public String getStickerFileId() {
return stickerFileId;
}
public InlineQueryResultCachedSticker setStickerFileId(String stickerFileId) {
this.stickerFileId = stickerFileId;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedSticker setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedSticker setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (stickerFileId == null || stickerFileId.isEmpty()) {
throw new TelegramApiValidationException("StickerFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedSticker{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", sticker_file_id='" + stickerFileId + '\'' +
", inputMessageContent='" + inputMessageContent + '\'' +
", replyMarkup='" + replyMarkup + '\'' +
'}';
}
}

View File

@ -0,0 +1,157 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a link to a video file stored on the Telegram servers. By default, this video
* file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with the specified content instead of the video.
*/
public class InlineQueryResultCachedVideo implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VIDEO_FILE_ID_FIELD = "video_file_id";
private static final String TITLE_FIELD = "title";
private static final String DESCRIPTION_FIELD = "description";
private static final String CAPTION_FIELD = "caption";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "video"; ///< Type of the result, must be "video"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result
@JsonProperty(VIDEO_FILE_ID_FIELD)
private String videoFileId; ///< A valid file identifier for the video file
@JsonProperty(TITLE_FIELD)
private String title; ///< Optional. Title for the result
@JsonProperty(DESCRIPTION_FIELD)
private String description; ///< Optional. Short description of the result
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Caption of the video to be sent, 0-200 characters
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the photo
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVideo() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedVideo setId(String id) {
this.id = id;
return this;
}
public String getVideoFileId() {
return videoFileId;
}
public InlineQueryResultCachedVideo setVideoFileId(String videoFileId) {
this.videoFileId = videoFileId;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedVideo setTitle(String title) {
this.title = title;
return this;
}
public String getDescription() {
return description;
}
public InlineQueryResultCachedVideo setDescription(String description) {
this.description = description;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedVideo setCaption(String caption) {
this.caption = caption;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedVideo setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedVideo setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedVideo setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (videoFileId == null || videoFileId.isEmpty()) {
throw new TelegramApiValidationException("VideoFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedVideo{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", videoFileId='" + videoFileId + '\'' +
", title='" + title + '\'' +
", description='" + description + '\'' +
", caption='" + caption + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -0,0 +1,146 @@
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.InputMessageContent;
import org.telegram.telegrambots.meta.api.objects.inlinequery.result.InlineQueryResult;
import org.telegram.telegrambots.meta.api.objects.replykeyboard.InlineKeyboardMarkup;
import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
/**
* @author Ruben Bermudez
* @version 1.0
* Represents a link to a voice message stored on the Telegram servers. By default, this
* voice message will be sent by the user. Alternatively, you can use input_message_content to send
* a message with the specified content instead of the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
*/
public class InlineQueryResultCachedVoice implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";
private static final String VOICE_FILE_ID_FIELD = "voice_file_id";
private static final String TITLE_FIELD = "title";
private static final String INPUTMESSAGECONTENT_FIELD = "input_message_content";
private static final String REPLY_MARKUP_FIELD = "reply_markup";
private static final String CAPTION_FIELD = "caption";
private static final String PARSEMODE_FIELD = "parse_mode";
@JsonProperty(TYPE_FIELD)
private final String type = "voice"; ///< Type of the result, must be "voice"
@JsonProperty(ID_FIELD)
private String id; ///< Unique identifier of this result, 1-64 bytes
@JsonProperty(VOICE_FILE_ID_FIELD)
private String voiceFileId; ///< A valid file identifier for the voice message
@JsonProperty(TITLE_FIELD)
private String title; ///< Recording title
@JsonProperty(INPUTMESSAGECONTENT_FIELD)
private InputMessageContent inputMessageContent; ///< Optional. Content of the message to be sent instead of the voice recording
@JsonProperty(REPLY_MARKUP_FIELD)
private InlineKeyboardMarkup replyMarkup; ///< Optional. Inline keyboard attached to the message
@JsonProperty(CAPTION_FIELD)
private String caption; ///< Optional. Voice caption (may also be used when resending documents by file_id), 0-200 characters
@JsonProperty(PARSEMODE_FIELD)
private String parseMode; ///< Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
public InlineQueryResultCachedVoice() {
super();
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public InlineQueryResultCachedVoice setId(String id) {
this.id = id;
return this;
}
public String getVoiceFileId() {
return voiceFileId;
}
public InlineQueryResultCachedVoice setVoiceFileId(String voiceFileId) {
this.voiceFileId = voiceFileId;
return this;
}
public String getTitle() {
return title;
}
public InlineQueryResultCachedVoice setTitle(String title) {
this.title = title;
return this;
}
public InputMessageContent getInputMessageContent() {
return inputMessageContent;
}
public InlineQueryResultCachedVoice setInputMessageContent(InputMessageContent inputMessageContent) {
this.inputMessageContent = inputMessageContent;
return this;
}
public InlineKeyboardMarkup getReplyMarkup() {
return replyMarkup;
}
public InlineQueryResultCachedVoice setReplyMarkup(InlineKeyboardMarkup replyMarkup) {
this.replyMarkup = replyMarkup;
return this;
}
public String getCaption() {
return caption;
}
public InlineQueryResultCachedVoice setCaption(String caption) {
this.caption = caption;
return this;
}
public String getParseMode() {
return parseMode;
}
public InlineQueryResultCachedVoice setParseMode(String parseMode) {
this.parseMode = parseMode;
return this;
}
@Override
public void validate() throws TelegramApiValidationException {
if (id == null || id.isEmpty()) {
throw new TelegramApiValidationException("ID parameter can't be empty", this);
}
if (voiceFileId == null || voiceFileId.isEmpty()) {
throw new TelegramApiValidationException("VoiceFileId parameter can't be empty", this);
}
if (inputMessageContent != null) {
inputMessageContent.validate();
}
if (replyMarkup != null) {
replyMarkup.validate();
}
}
@Override
public String toString() {
return "InlineQueryResultCachedVoice{" +
"type='" + type + '\'' +
", id='" + id + '\'' +
", voiceFileId='" + voiceFileId + '\'' +
", title='" + title + '\'' +
", inputMessageContent=" + inputMessageContent +
", replyMarkup=" + replyMarkup +
", caption='" + caption + '\'' +
", parseMode='" + parseMode + '\'' +
'}';
}
}

View File

@ -16,7 +16,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedAudio}
*/
@Deprecated
public class InlineQueryResultCachedAudio implements InlineQueryResult {
private static final String TYPE_FIELD = "type";

View File

@ -16,7 +16,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* @note Currently, only pdf-files and zip archives can be sent using this method.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedDocument}
*/
@Deprecated
public class InlineQueryResultCachedDocument implements InlineQueryResult {
private static final String TYPE_FIELD = "type";

View File

@ -13,7 +13,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* Represents a link to an animated GIF file stored on the Telegram servers. By default, this
* animated GIF file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with specified content instead of the animation.
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedGif}
*/
@Deprecated
public class InlineQueryResultCachedGif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";

View File

@ -14,7 +14,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can
* use input_message_content to send a message with the specified content instead of the animation.
* @date 01 of January of 2016
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedMpeg4Gif}
*/
@Deprecated
public class InlineQueryResultCachedMpeg4Gif implements InlineQueryResult {
private static final String TYPE_FIELD = "type";

View File

@ -13,7 +13,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* Represents a link to a photo stored on the Telegram servers. By default, this photo will
* be sent by the user with an optional caption. Alternatively, you can use input_message_content to
* send a message with the specified content instead of the photo.
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedPhoto}
*/
@Deprecated
public class InlineQueryResultCachedPhoto implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";

View File

@ -16,7 +16,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @date 10 of April of 2016
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedSticker}
*/
@Deprecated
public class InlineQueryResultCachedSticker implements InlineQueryResult {
private static final String TYPE_FIELD = "type";

View File

@ -13,7 +13,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* Represents a link to a video file stored on the Telegram servers. By default, this video
* file will be sent by the user with an optional caption. Alternatively, you can use
* input_message_content to send a message with the specified content instead of the video.
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVideo}
*/
@Deprecated
public class InlineQueryResultCachedVideo implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";

View File

@ -15,7 +15,9 @@ import org.telegram.telegrambots.meta.exceptions.TelegramApiValidationException;
* a message with the specified content instead of the voice message.
* @note This will only work in Telegram versions released after 9 April, 2016. Older clients will
* ignore them.
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached.InlineQueryResultCachedVoice}
*/
@Deprecated
public class InlineQueryResultCachedVoice implements InlineQueryResult {
private static final String TYPE_FIELD = "type";
private static final String ID_FIELD = "id";

View File

@ -0,0 +1,4 @@
/**
* @deprecated Replaced by {@link org.telegram.telegrambots.meta.api.objects.inlinequery.result.cached}
*/
package org.telegram.telegrambots.meta.api.objects.inlinequery.result.chached;