2016-09-28 00:29:44 +02:00
|
|
|
/*
|
|
|
|
* This file is part of TelegramBots.
|
|
|
|
*
|
|
|
|
* TelegramBots is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2016-09-28 00:31:34 +02:00
|
|
|
* TelegramBots is distributed in the hope that it will be useful,
|
2016-09-28 00:29:44 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2016-09-28 00:31:34 +02:00
|
|
|
* along with TelegramBots. If not, see <http://www.gnu.org/licenses/>.
|
2016-09-28 00:29:44 +02:00
|
|
|
*/
|
2018-07-08 01:41:21 +02:00
|
|
|
package org.telegram.telegrambots.meta.api.objects.games;
|
2016-09-28 00:29:44 +02: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 14:41:05 +01:00
|
|
|
import lombok.NoArgsConstructor;
|
2020-10-31 18:43:32 +01:00
|
|
|
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;
|
|
|
|
import org.telegram.telegrambots.meta.api.objects.PhotoSize;
|
2016-09-28 00:29:44 +02:00
|
|
|
|
|
|
|
/**
|
2022-11-04 17:23:27 +01:00
|
|
|
* This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
|
2016-09-28 00:29:44 +02:00
|
|
|
* @author Ruben Bermudez
|
|
|
|
* @version 2.4
|
|
|
|
*/
|
2020-11-01 23:46:36 +01:00
|
|
|
@EqualsAndHashCode(callSuper = false)
|
|
|
|
@Getter
|
|
|
|
@Setter
|
|
|
|
@ToString
|
2020-10-31 18:43:32 +01:00
|
|
|
@RequiredArgsConstructor
|
2020-10-31 14:41:05 +01:00
|
|
|
@NoArgsConstructor
|
2020-10-31 18:43:32 +01:00
|
|
|
@AllArgsConstructor
|
2016-11-17 02:41:12 +01:00
|
|
|
public class Animation implements BotApiObject {
|
2016-09-28 00:29:44 +02:00
|
|
|
private static final String FILEID_FIELD = "file_id";
|
2019-12-31 03:36:57 +01:00
|
|
|
private static final String FILEUNIQUEID_FIELD = "file_unique_id";
|
2018-07-27 00:27:26 +02:00
|
|
|
private static final String WIDTH_FIELD = "width";
|
|
|
|
private static final String HEIGHT_FIELD = "height";
|
|
|
|
private static final String DURATION_FIELD = "duration";
|
2016-09-28 00:29:44 +02:00
|
|
|
private static final String THUMB_FIELD = "thumb";
|
|
|
|
private static final String FILENAME_FIELD = "file_name";
|
|
|
|
private static final String MIMETYPE_FIELD = "mime_type";
|
|
|
|
private static final String FILESIZE_FIELD = "file_size";
|
|
|
|
|
2022-11-04 17:23:27 +01:00
|
|
|
/**
|
|
|
|
* Identifier for this file, which can be used to download or reuse the file
|
|
|
|
*/
|
2016-09-28 00:29:44 +02:00
|
|
|
@JsonProperty(FILEID_FIELD)
|
2020-10-31 18:43:32 +01:00
|
|
|
@NonNull
|
2022-11-04 17:23:27 +01:00
|
|
|
private String fileId;
|
2019-12-31 03:36:57 +01:00
|
|
|
/**
|
|
|
|
* Unique identifier for this file, which is supposed to be the same over time and for different bots.
|
|
|
|
* Can't be used to download or reuse the file.
|
|
|
|
*/
|
|
|
|
@JsonProperty(FILEUNIQUEID_FIELD)
|
2020-10-31 18:43:32 +01:00
|
|
|
@NonNull
|
2019-12-31 03:36:57 +01:00
|
|
|
private String fileUniqueId;
|
2022-11-04 17:23:27 +01:00
|
|
|
/**
|
|
|
|
* Video width as defined by sender
|
|
|
|
*/
|
2018-07-27 00:27:26 +02:00
|
|
|
@JsonProperty(WIDTH_FIELD)
|
2020-10-31 18:43:32 +01:00
|
|
|
@NonNull
|
2022-11-04 17:23:27 +01:00
|
|
|
private Integer width;
|
|
|
|
/**
|
|
|
|
* Video height as defined by sender
|
|
|
|
*/
|
2018-07-27 00:27:26 +02:00
|
|
|
@JsonProperty(HEIGHT_FIELD)
|
2020-10-31 18:43:32 +01:00
|
|
|
@NonNull
|
2022-11-04 17:23:27 +01:00
|
|
|
private Integer height;
|
|
|
|
/**
|
|
|
|
* Duration of the video in seconds as defined by sender
|
|
|
|
*/
|
2018-07-27 00:27:26 +02:00
|
|
|
@JsonProperty(DURATION_FIELD)
|
2020-10-31 18:43:32 +01:00
|
|
|
@NonNull
|
2022-11-04 17:23:27 +01:00
|
|
|
private Integer duration;
|
|
|
|
/**
|
|
|
|
* Optional.
|
|
|
|
* Animation thumbnail as defined by sender
|
|
|
|
*/
|
2016-09-28 00:29:44 +02:00
|
|
|
@JsonProperty(THUMB_FIELD)
|
2022-11-04 17:23:27 +01:00
|
|
|
private PhotoSize thumb;
|
|
|
|
/**
|
|
|
|
* Optional.
|
|
|
|
* Original animation filename as defined by sender
|
|
|
|
*/
|
2016-09-28 00:29:44 +02:00
|
|
|
@JsonProperty(FILENAME_FIELD)
|
2022-11-04 17:23:27 +01:00
|
|
|
private String fileName;
|
|
|
|
/**
|
|
|
|
* Optional.
|
|
|
|
* MIME type of the file as defined by sender
|
|
|
|
*/
|
2016-09-28 00:29:44 +02:00
|
|
|
@JsonProperty(MIMETYPE_FIELD)
|
2022-11-04 17:23:27 +01:00
|
|
|
private String mimetype;
|
2022-06-18 00:40:30 +02:00
|
|
|
/**
|
|
|
|
* Optional.
|
|
|
|
* File size in bytes.
|
|
|
|
* It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it.
|
|
|
|
* But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
|
|
|
|
*/
|
2016-09-28 00:29:44 +02:00
|
|
|
@JsonProperty(FILESIZE_FIELD)
|
2022-06-18 00:40:30 +02:00
|
|
|
private Long fileSize;
|
2016-09-28 00:29:44 +02:00
|
|
|
}
|