Fix derives

This commit is contained in:
Temirkhan Myrzamadi 2020-01-05 09:14:04 +06:00
parent ae0454a716
commit 0668987b2d
95 changed files with 112 additions and 161 deletions

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::form_builder::FormBuilder,
@ -11,10 +9,8 @@ use crate::requests::{Request, ResponseResult};
/// Use this method to add a new sticker to a set created by the bot. Returns
/// True on success.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct AddStickerToSet<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// User identifier of sticker set owner

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -9,10 +7,8 @@ use crate::{
/// Use this method to create new sticker set owned by a user. The bot will be
/// able to edit the created sticker set. Returns True on success.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct CreateNewStickerSet<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// User identifier of created sticker set owner

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -14,13 +12,10 @@ use crate::{
/// previously uploaded file via its file_id or specify a URL. On success, if
/// the edited message was sent by the bot, the edited Message is returned,
/// otherwise True is returned.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct EditMessageMedia<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
#[serde(flatten)]
chat_or_inline_message: ChatOrInlineMessage,
/// A JSON-serialized object for a new media content of the message

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -14,10 +12,8 @@ use crate::{
///
/// Bots can currently send animation files of up to 50 MB in size, this limit
/// may be changed in the future.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendAnimation<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -12,10 +10,8 @@ use crate::{
/// success, the sent Message is returned. Bots can currently send audio files
/// of up to 50 MB in size, this limit may be changed in the future.For sending
/// voice messages, use the sendVoice method instead.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendAudio<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,4 +1,4 @@
use serde::Serialize;
use serde::{Deserialize, Serialize};
use crate::{
network,
@ -33,7 +33,7 @@ pub struct SendChatAction<'a> {
/// A type of action used in [`SendChatAction`].
///
/// [`SendChatAction`]: crate::requests::SendChatAction
#[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum SendChatActionKind {
/// For [text messages](crate::Bot::send_message).

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -10,10 +8,8 @@ use crate::{
/// Use this method to send general files. On success, the sent Message is
/// returned. Bots can currently send files of any type of up to 50 MB in size,
/// this limit may be changed in the future.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendDocument<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -9,10 +7,8 @@ use crate::{
/// Use this method to send a group of photos or videos as an album. On success,
/// an array of the sent Messages is returned.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendMediaGroup<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -8,10 +6,8 @@ use crate::{
};
/// Use this method to send photos. On success, the sent Message is returned.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendPhoto<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -9,10 +7,8 @@ use crate::{
/// Use this method to send static .WEBP or animated .TGS stickers. On success,
/// the sent Message is returned.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendSticker<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -11,10 +9,8 @@ use crate::{
/// (other formats may be sent as Document). On success, the sent Message is
/// returned. Bots can currently send video files of up to 50 MB in size, this
/// limit may be changed in the future.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendVideo<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -10,10 +8,8 @@ use crate::{
/// As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1
/// minute long. Use this method to send video messages. On success, the sent
/// Message is returned.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendVideoNote<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,5 +1,3 @@
use serde::Serialize;
use crate::{
network,
requests::{form_builder::FormBuilder, Request, ResponseResult},
@ -13,10 +11,8 @@ use crate::{
/// Document). On success, the sent Message is returned. Bots can currently send
/// voice messages of up to 50 MB in size, this limit may be changed in the
/// future.
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone, Serialize)]
#[derive(Debug, Clone)]
pub struct SendVoice<'a> {
#[serde(skip_serializing)]
bot: &'a Bot,
/// Unique identifier for the target chat or username of the target channel

View file

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Deserialize, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AllowedUpdate {
Message,

View file

@ -7,7 +7,7 @@ use crate::types::PhotoSize;
///
/// [The official docs](https://core.telegram.org/bots/api#animation).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Animation {
/// An identifier for this file.
pub file_id: String,

View file

@ -7,7 +7,7 @@ use crate::types::PhotoSize;
///
/// [The official docs](https://core.telegram.org/bots/api#audio).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Audio {
/// An identifier for this file.
pub file_id: String,

View file

@ -1,5 +1,7 @@
/// A placeholder, currently holds no information. Use [@BotFather](https://t.me/botfather) to set up your game.
///
/// [The official docs](https://core.telegram.org/bots/api#callbackgame).
// TODO: derives?
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct CallbackGame;

View file

@ -14,7 +14,7 @@ use crate::types::{Message, User};
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
/// [inline mode]: https://core.telegram.org/bots/api#inline-mode
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CallbackQuery {
/// An unique identifier for this query.
pub id: String,

View file

@ -6,7 +6,7 @@ use crate::types::{ChatPermissions, ChatPhoto, Message};
///
/// [The official docs](https://core.telegram.org/bots/api#chat).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Chat {
/// A unique identifier for this chat. This number may be greater than 32
/// bits and some programming languages may have difficulty/silent defects
@ -25,7 +25,7 @@ pub struct Chat {
}
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ChatKind {
NonPrivate {
@ -79,7 +79,7 @@ pub enum ChatKind {
}
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum NonPrivateChatKind {

View file

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ChatAction {
Typing,

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
/// A unique identifier for the target chat or username of the target channel
/// (in the format `@channelusername`).
#[derive(
Debug, Display, PartialEq, Eq, Hash, Clone, Deserialize, Serialize, From,
Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, From,
)]
#[serde(untagged)]
pub enum ChatId {

View file

@ -6,7 +6,7 @@ use crate::types::User;
/// This object contains information about one member of the chat.
///
/// [The official docs](https://core.telegram.org/bots/api#chatmember).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatMember {
/// Information about the user.
pub user: User,
@ -76,7 +76,7 @@ pub struct ChatMember {
pub can_add_web_page_previews: Option<bool>,
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ChatMemberStatus {
Creator,

View file

@ -3,7 +3,7 @@ use crate::types::ChatId;
use serde::{Deserialize, Serialize};
/// A chat message or inline message.
#[derive(Serialize, Deserialize, Clone, Eq, Hash, PartialEq, Debug)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ChatOrInlineMessage {
Chat { chat_id: ChatId, message_id: i32 },

View file

@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
///
/// [The official docs](https://core.telegram.org/bots/api#chatpermissions).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatPermissions {
/// `true`, if the user is allowed to send text messages, contacts,
/// locations and venues.

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object represents a chat photo.
///
/// [The official docs](https://core.telegram.org/bots/api#chatphoto).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatPhoto {
/// A file identifier of small (160x160) chat photo. This file_id can be
/// used only for photo download and only for as long as the photo is

View file

@ -9,7 +9,7 @@ use crate::types::{Location, User};
///
/// [result]: https://core.telegram.org/bots/api#inlinequeryresult
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChosenInlineResult {
/// The unique identifier for the result that was chosen.
pub result_id: String,

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
///
/// [The official docs](https://core.telegram.org/bots/api#contact).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Contact {
/// A contact's phone number.
pub phone_number: String,

View file

@ -11,7 +11,7 @@ use crate::types::PhotoSize;
/// [voice messages]: https://core.telegram.org/bots/api#voice
/// [audio files]: https://core.telegram.org/bots/api#audio
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Document {
/// An identifier for this file.
pub file_id: String,

View file

@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
/// crate::types::EncryptedPassportElement
/// [Telegram Passport Documentation]: https://core.telegram.org/passport#receiving-information
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct EncryptedCredentials {
/// Base64-encoded encrypted JSON-serialized data with unique user's
/// payload, data hashes and secrets required for

View file

@ -6,7 +6,7 @@ use super::PassportFile;
/// shared with the bot by the user.
///
/// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct EncryptedPassportElement {
/// Base64-encoded element hash for using in
/// [`PassportElementErrorUnspecified`].
@ -20,7 +20,7 @@ pub struct EncryptedPassportElement {
}
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[allow(clippy::large_enum_variant)]
pub enum EncryptedPassportElementKind {

View file

@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
/// [The official docs](https://core.telegram.org/bots/api#file).
///
/// [`Bot::get_file`]: crate::Bot::get_file
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct File {
/// Identifier for this file.
pub file_id: String,

View file

@ -12,7 +12,7 @@ use crate::types::True;
///
/// [privacy mode]: https://core.telegram.org/bots#privacy-mode
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ForceReply {
/// Shows reply interface to the user, as if they manually selected the
/// bots message and tapped Reply'.

View file

@ -7,7 +7,7 @@ use crate::types::{Animation, MessageEntity, PhotoSize};
///
/// [@Botfather]: https://t.me/botfather
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Game {
/// Title of the game.
pub title: String,

View file

@ -5,7 +5,7 @@ use crate::types::user::User;
/// This object represents one row of the high scores table for a game.
///
/// [The official docs](https://core.telegram.org/bots/api#gamehighscore).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct GameHighScore {
/// Position in high score table for the game.
pub position: u32,

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object represents one button of an inline keyboard.
///
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct InlineKeyboardButton {
/// Label text on the button.
pub text: String,
@ -12,9 +12,7 @@ pub struct InlineKeyboardButton {
pub kind: InlineKeyboardButtonKind,
}
#[derive(
Debug, Clone, PartialEq, PartialOrd, Serialize, Eq, Hash, Deserialize,
)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum InlineKeyboardButtonKind {
/// HTTP or tg:// url to be opened when button is pressed.

View file

@ -11,7 +11,7 @@ use crate::types::InlineKeyboardButton;
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardmarkup).
///
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize, Default)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Default)]
pub struct InlineKeyboardMarkup {
/// Array of button rows, each represented by an array of
/// [`InlineKeyboardButton`] objects.

View file

@ -7,7 +7,7 @@ use crate::types::{Location, User};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequery).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQuery {
/// Unique identifier for this query.
pub id: String,

View file

@ -18,7 +18,7 @@ use crate::types::{
/// This object represents one result of an inline query.
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresult).
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, From)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, From)]
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
pub enum InlineQueryResult {

View file

@ -6,7 +6,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultarticle).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultArticle {
/// Unique identifier for this result, 1-64 Bytes.
pub id: String,

View file

@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultaudio).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultAudio {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedAudio {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedDocument {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedgif).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedGif {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -10,7 +10,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedMpeg4Gif {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedPhoto {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedSticker {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedVideo {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultCachedVoice {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultContact {
/// Unique identifier for this result, 1-64 Bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultdocument).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultDocument {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -8,7 +8,7 @@ use crate::types::InlineKeyboardMarkup;
///
/// [game]: https://core.telegram.org/bots/api#games
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultGame {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultgif).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultGif {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultlocation).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultLocation {
/// Unique identifier for this result, 1-64 Bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultMpeg4Gif {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultphoto).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultPhoto {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -8,7 +8,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvenue).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultVenue {
/// Unique identifier for this result, 1-64 Bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvideo).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultVideo {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -9,7 +9,7 @@ use crate::types::{InlineKeyboardMarkup, InputMessageContent, ParseMode};
///
/// [The official docs](https://core.telegram.org/bots/api#inlinequeryresultvoice).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct InlineQueryResultVoice {
/// Unique identifier for this result, 1-64 bytes.
pub id: String,

View file

@ -5,7 +5,7 @@ use std::path::PathBuf;
/// This object represents the contents of a file to be uploaded.
///
/// [The official docs](https://core.telegram.org/bots/api#inputfile).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize)]
pub enum InputFile {
File(PathBuf),
Url(String),

View file

@ -4,7 +4,7 @@ use crate::types::{InputFile, ParseMode};
// TODO: should variants use new-type?
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
/// This object represents the content of a media message to be sent.

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::types::ParseMode;
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
/// This object represents the content of a message to be sent as a result of an
/// inline query.

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object contains basic information about an invoice.
///
/// [The official docs](https://core.telegram.org/bots/api#invoice).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Invoice {
/// Product name.
pub title: String,

View file

@ -8,7 +8,7 @@ use crate::types::True;
///
/// [The official docs](https://core.telegram.org/bots/api#keyboardbutton).
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct KeyboardButton {
/// Text of the button. If none of the optional fields are used, it will
/// be sent as a message when the button is pressed.
@ -24,7 +24,7 @@ pub struct KeyboardButton {
}
// Serialize + Deserialize are implemented by hand
#[derive(Debug, Hash, PartialEq, Eq, Clone)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub enum ButtonRequest {
Location,
Contact,

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object represents a portion of the price for goods or services.
///
/// [The official docs](https://core.telegram.org/bots/api#labeledprice).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct LabeledPrice {
/// Portion label.
pub label: String,

View file

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
/// This object represents a point on the map.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Location {
/// Longitude as defined by sender.
pub longitude: f64,

View file

@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
///
/// [Telegram Login Widget]: https://core.telegram.org/widgets/login
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct LoginUrl {
pub url: String,
pub forward_text: Option<String>,

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
/// default.
///
/// [The official docs](https://core.telegram.org/bots/api#maskposition).
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct MaskPosition {
/// The part of the face relative to which the mask should be placed. One
/// of `forehead`, `eyes`, `mouth`, or `chin`.

View file

@ -11,7 +11,7 @@ use crate::types::{
/// This object represents a message.
///
/// [The official docs](https://core.telegram.org/bots/api#message).
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Message {
/// Unique message identifier inside this chat.
#[serde(rename = "message_id")]
@ -28,7 +28,7 @@ pub struct Message {
}
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MessageKind {
Common {
@ -143,7 +143,7 @@ pub enum MessageKind {
},
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum Sender {
/// Sender of a message from chat.
#[serde(rename = "from")]
@ -154,7 +154,7 @@ pub enum Sender {
Signature(String),
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum ForwardedFrom {
#[serde(rename = "forward_from")]
User(User),
@ -162,7 +162,7 @@ pub enum ForwardedFrom {
SenderName(String),
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ForwardKind {
ChannelForward {
@ -186,7 +186,7 @@ pub enum ForwardKind {
},
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MediaKind {
Animation {

View file

@ -6,7 +6,7 @@ use crate::types::User;
/// hashtags, usernames, URLs, etc.
///
/// [The official docs](https://core.telegram.org/bots/api#messageentity).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct MessageEntity {
#[serde(flatten)]
pub kind: MessageEntityKind,
@ -18,7 +18,7 @@ pub struct MessageEntity {
pub length: usize,
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[serde(tag = "type")]
pub enum MessageEntityKind {

View file

@ -5,7 +5,7 @@ use crate::types::ShippingAddress;
/// This object represents information about an order.
///
/// [The official docs](https://core.telegram.org/bots/api#orderinfo).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct OrderInfo {
/// User's name.
pub name: String,

View file

@ -124,7 +124,7 @@ use serde::{Deserialize, Serialize};
/// [`MarkdownV2`]: ParseMode::MarkdownV2
/// [`HTML`]: ParseMode::HTML
/// [`Markdown`]: ParseMode::Markdown
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum ParseMode {
MarkdownV2,
HTML,

View file

@ -6,7 +6,7 @@ use super::{EncryptedCredentials, EncryptedPassportElement};
/// user.
///
/// [The official docs](https://core.telegram.org/bots/api#passportdata).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PassportData {
/// Array with information about documents and other Telegram Passport
/// elements that was shared with the bot.

View file

@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
/// 10MB.
///
/// [The official docs](https://core.telegram.org/bots/api#passportfile).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PassportFile {
/// Identifier for this file.
pub file_id: String,

View file

@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
/// [file]: crate::types::Document
/// [sticker]: crate::types::Sticker
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PhotoSize {
/// Identifier for this file.
pub file_id: String,

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object contains information about a poll.
///
/// [The official docs](https://core.telegram.org/bots/api#poll).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Poll {
/// Unique poll identifier.
pub id: String,
@ -21,7 +21,7 @@ pub struct Poll {
/// This object contains information about one answer option in a poll.
///
/// [The official docs](https://core.telegram.org/bots/api#polloption).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PollOption {
/// Option text, 1-100 characters.
pub text: String,

View file

@ -6,7 +6,7 @@ use crate::types::{OrderInfo, User};
///
/// [The official docs](https://core.telegram.org/bots/api#precheckoutquery).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PreCheckoutQuery {
/// Unique query identifier.
pub id: String,

View file

@ -10,7 +10,7 @@ use crate::types::KeyboardButton;
/// [custom keyboard]: https://core.telegram.org/bots#keyboards
/// [Introduction to bots]: https://core.telegram.org/bots#keyboards
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ReplyKeyboardMarkup {
/// Array of button rows, each represented by an Array of
/// [`KeyboardButton`] objects

View file

@ -12,7 +12,7 @@ use crate::types::True;
///
/// [`ReplyKeyboardMarkup`]: crate::types::ReplyKeyboardMarkup
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ReplyKeyboardRemove {
/// Requests clients to remove the custom keyboard (user will not be able
/// to summon this keyboard; if you want to hide the keyboard from sight

View file

@ -4,7 +4,7 @@ use crate::types::{
ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove,
};
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ReplyMarkup {
Inline(InlineKeyboardMarkup),

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// Contains information about why a request was unsuccessful.
///
/// [The official docs](https://core.telegram.org/bots/api#responseparameters).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ResponseParameters {
/// The group has been migrated to a supergroup with the specified

View file

@ -4,7 +4,7 @@ use crate::types::{ChatId, InlineKeyboardMarkup, LabeledPrice};
// TODO: missing docs
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct SendInvoice {
pub chat_id: ChatId,
pub title: String,

View file

@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object represents a shipping address.
///
/// [The official docs](https://core.telegram.org/bots/api#shippingaddress).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ShippingAddress {
/// ISO 3166-1 alpha-2 country code.
pub country_code: String,

View file

@ -5,7 +5,7 @@ use crate::types::LabeledPrice;
/// This object represents one shipping option.
///
/// [The official docs](https://core.telegram.org/bots/api#shippingoption).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ShippingOption {
/// Shipping option identifier.
pub id: String,

View file

@ -5,7 +5,7 @@ use crate::types::{ShippingAddress, User};
/// This object contains information about an incoming shipping query.
///
/// [The official docs](https://core.telegram.org/bots/api#shippingquery).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ShippingQuery {
/// Unique query identifier.
pub id: String,

View file

@ -6,7 +6,7 @@ use crate::types::{MaskPosition, PhotoSize};
///
/// [The official docs](https://core.telegram.org/bots/api#sticker).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Sticker {
/// Identifier for this file.
pub file_id: String,

View file

@ -5,7 +5,7 @@ use crate::types::Sticker;
/// This object represents a sticker set.
///
/// [The official docs](https://core.telegram.org/bots/api#stickerset).
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct StickerSet {
/// Sticker set name.
pub name: String,

View file

@ -6,7 +6,7 @@ use crate::types::OrderInfo;
///
/// [The official docs](https://core.telegram.org/bots/api#successfulpayment).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct SuccessfulPayment {
/// Three-letter ISO 4217 [currency] code.
///

View file

@ -9,7 +9,7 @@ use crate::types::{CallbackQuery, ChosenInlineResult, InlineQuery, Message};
/// [The official docs](https://core.telegram.org/bots/api#update).
///
/// [object]: https://core.telegram.org/bots/api#available-types
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Update {
/// The updates unique identifier. Update identifiers start from a certain
/// positive number and increase sequentially. This ID becomes especially
@ -27,7 +27,7 @@ pub struct Update {
pub kind: UpdateKind,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum UpdateKind {
/// New incoming message of any kind — text, photo, sticker, etc.

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
///
/// [The official docs](https://core.telegram.org/bots/api#user).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct User {
/// Unique identifier for this user or bot.
pub id: i32,

View file

@ -5,7 +5,7 @@ use crate::types::PhotoSize;
/// This object represent a user's profile pictures.
///
/// [The official docs](https://core.telegram.org/bots/api#userprofilephotos).
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct UserProfilePhotos {
/// Total number of profile pictures the target user has.
pub total_count: u32,

View file

@ -4,7 +4,7 @@ use crate::types::Location;
/// This object represents a venue.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Venue {
/// Venue location.
pub location: Location,

View file

@ -6,7 +6,7 @@ use crate::types::PhotoSize;
///
/// [The official docs](https://core.telegram.org/bots/api#video).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Video {
/// Identifier for this file.
pub file_id: String,

View file

@ -10,7 +10,7 @@ use crate::types::PhotoSize;
/// [video message]: https://telegram.org/blog/video-messages-and-telescope
/// [v4.0]: https://telegram.org/blog/video-messages-and-telescope
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct VideoNote {
/// Identifier for this file.
pub file_id: String,

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
///
/// [The official docs](https://core.telegram.org/bots/api#voice).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Voice {
/// Identifier for this file.
pub file_id: String,

View file

@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
///
/// [The official docs](https://core.telegram.org/bots/api#webhookinfo).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct WebhookInfo {
/// Webhook URL, may be empty if webhook is not set up.
pub url: String,