Add skip_serializing_none for all structures

This commit is contained in:
Oleg A 2023-03-21 11:35:10 +03:00
parent 5c162f4899
commit 15d2f0e3f5
No known key found for this signature in database
GPG key ID: 5FE046817A9657C5
33 changed files with 46 additions and 0 deletions

View file

@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
/// This object represents a bot command. /// This object represents a bot command.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#botcommand). /// [The official docs](https://core.telegram.org/bots/api#botcommand).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct BotCommand { pub struct BotCommand {
/// Text of the command, 1-32 characters. /// Text of the command, 1-32 characters.

View file

@ -8,5 +8,6 @@ use serde::{Deserialize, Serialize};
/// Use [@Botfather] to set up your game. /// Use [@Botfather] to set up your game.
/// ///
/// [@Botfather]: https://t.me/botfather /// [@Botfather]: https://t.me/botfather
#[serde_with_macros::skip_serializing_none]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct CallbackGame; pub struct CallbackGame;

View file

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
/// Represents the rights of an administrator in a chat. /// Represents the rights of an administrator in a chat.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatAdministratorRights { pub struct ChatAdministratorRights {
/// `true`, if the user's presence in the chat is hidden /// `true`, if the user's presence in the chat is hidden

View file

@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::types::User; use crate::types::User;
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatInviteLink { pub struct ChatInviteLink {
/// The invite link. If the link was created by another chat administrator, /// The invite link. If the link was created by another chat administrator,

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
use crate::types::{Chat, ChatInviteLink, User}; use crate::types::{Chat, ChatInviteLink, User};
/// Represents a join request sent to a chat. /// Represents a join request sent to a chat.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChatJoinRequest { pub struct ChatJoinRequest {
/// Chat to which the request was sent /// Chat to which the request was sent

View file

@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::types::Location; use crate::types::Location;
/// Represents a location to which a chat is connected. /// Represents a location to which a chat is connected.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChatLocation { pub struct ChatLocation {
/// The location to which the supergroup is connected. Can't be a live /// The location to which the supergroup is connected. Can't be a live

View file

@ -7,6 +7,7 @@ use crate::types::{UntilDate, User};
/// This object contains information about one member of the chat. /// This object contains information about one member of the chat.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#chatmember). /// [The official docs](https://core.telegram.org/bots/api#chatmember).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ChatMember { pub struct ChatMember {
/// Information about the user. /// Information about the user.
@ -32,6 +33,7 @@ pub enum ChatMemberKind {
} }
/// Owner of the group. This struct is part of the [`ChatMemberKind`] enum. /// Owner of the group. This struct is part of the [`ChatMemberKind`] enum.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Owner { pub struct Owner {
/// Custom title for this user. /// Custom title for this user.
@ -43,6 +45,7 @@ pub struct Owner {
/// Administrator of the group. This struct is part of the [`ChatMemberKind`] /// Administrator of the group. This struct is part of the [`ChatMemberKind`]
/// enum. /// enum.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Administrator { pub struct Administrator {
/// Custom title for this user. /// Custom title for this user.
@ -104,6 +107,7 @@ pub struct Administrator {
/// User, restricted in the group. This struct is part of the [`ChatMemberKind`] /// User, restricted in the group. This struct is part of the [`ChatMemberKind`]
/// enum. /// enum.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Restricted { pub struct Restricted {
/// Date when restrictions will be lifted for this user. /// Date when restrictions will be lifted for this user.
@ -148,6 +152,7 @@ pub struct Restricted {
/// User that was banned in the chat and can't return to it or view chat /// User that was banned in the chat and can't return to it or view chat
/// messages. This struct is part of the [`ChatMemberKind`] enum. /// messages. This struct is part of the [`ChatMemberKind`] enum.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Banned { pub struct Banned {
/// Date when restrictions will be lifted for this user. /// Date when restrictions will be lifted for this user.

View file

@ -3,6 +3,7 @@ use serde::{Deserialize, Serialize};
use crate::types::{Chat, ChatInviteLink, ChatMember, User}; use crate::types::{Chat, ChatInviteLink, ChatMember, User};
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChatMemberUpdated { pub struct ChatMemberUpdated {
/// Chat the user belongs to /// Chat the user belongs to

View file

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

View file

@ -6,6 +6,7 @@ use super::PassportFile;
/// shared with the bot by the user. /// shared with the bot by the user.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement). /// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct EncryptedPassportElement { pub struct EncryptedPassportElement {
/// Base64-encoded element hash for using in /// Base64-encoded element hash for using in

View file

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

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// This object represents one button of an inline keyboard. /// This object represents one button of an inline keyboard.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton). /// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct InlineKeyboardButton { pub struct InlineKeyboardButton {
/// Label text on the button. /// Label text on the button.

View file

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

View file

@ -31,6 +31,7 @@ use crate::types::InputSticker;
/// This object represents the contents of a file to be uploaded. /// This object represents the contents of a file to be uploaded.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#inputfile). /// [The official docs](https://core.telegram.org/bots/api#inputfile).
#[serde_with_macros::skip_serializing_none]
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct InputFile { pub struct InputFile {
id: OnceCell<Arc<str>>, id: OnceCell<Arc<str>>,

View file

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

View file

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

View file

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

View file

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

View file

@ -7,6 +7,7 @@ use crate::types::User;
/// Returned only in [`GetMe`]. /// Returned only in [`GetMe`].
/// ///
/// [`GetMe`]: crate::payloads::GetMe /// [`GetMe`]: crate::payloads::GetMe
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct Me { pub struct Me {
#[serde(flatten)] #[serde(flatten)]

View file

@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize};
/// This object represents a service message about a change in auto-delete timer /// This object represents a service message about a change in auto-delete timer
/// settings. /// settings.
#[serde_with_macros::skip_serializing_none]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct MessageAutoDeleteTimerChanged { pub struct MessageAutoDeleteTimerChanged {
/// New auto-delete time for messages in the chat /// New auto-delete time for messages in the chat

View file

@ -9,6 +9,7 @@ use crate::types::{User, UserId};
/// For example, hashtags, usernames, URLs, etc. /// For example, hashtags, usernames, URLs, etc.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#messageentity). /// [The official docs](https://core.telegram.org/bots/api#messageentity).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct MessageEntity { pub struct MessageEntity {
#[serde(flatten)] #[serde(flatten)]

View file

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

View file

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

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// submitted that should be resolved by the user. /// submitted that should be resolved by the user.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerror). /// [The official docs](https://core.telegram.org/bots/api#passportelementerror).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementError { pub struct PassportElementError {
/// Error message. /// Error message.
@ -73,6 +74,7 @@ pub enum PassportElementErrorKind {
/// The error is considered resolved when the field's value changes. /// The error is considered resolved when the field's value changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrordatafield). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrordatafield).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorDataField { pub struct PassportElementErrorDataField {
/// The section of the user's Telegram Passport which has the error. /// The section of the user's Telegram Passport which has the error.
@ -127,6 +129,7 @@ impl PassportElementErrorDataField {
/// document changes. /// document changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfrontside). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfrontside).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorFrontSide { pub struct PassportElementErrorFrontSide {
/// The section of the user's Telegram Passport which has the issue. /// The section of the user's Telegram Passport which has the issue.
@ -166,6 +169,7 @@ impl PassportElementErrorFrontSide {
/// document changes. /// document changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorreverseside). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorreverseside).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorReverseSide { pub struct PassportElementErrorReverseSide {
/// The section of the user's Telegram Passport which has the issue. /// The section of the user's Telegram Passport which has the issue.
@ -204,6 +208,7 @@ impl PassportElementErrorReverseSide {
/// The error is considered resolved when the file with the selfie changes. /// The error is considered resolved when the file with the selfie changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorselfie). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorselfie).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorSelfie { pub struct PassportElementErrorSelfie {
/// The section of the user's Telegram Passport which has the issue. /// The section of the user's Telegram Passport which has the issue.
@ -242,6 +247,7 @@ impl PassportElementErrorSelfie {
/// changes. /// changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfile). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfile).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorFile { pub struct PassportElementErrorFile {
/// The section of the user's Telegram Passport which has the issue. /// The section of the user's Telegram Passport which has the issue.
@ -280,6 +286,7 @@ impl PassportElementErrorFile {
/// changes. /// changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfiles). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfiles).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorFiles { pub struct PassportElementErrorFiles {
/// The section of the user's Telegram Passport which has the issue. /// The section of the user's Telegram Passport which has the issue.
@ -318,6 +325,7 @@ impl PassportElementErrorFiles {
/// The error is considered resolved when the file changes. /// The error is considered resolved when the file changes.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfile). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfile).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorTranslationFile { pub struct PassportElementErrorTranslationFile {
/// Type of element of the user's Telegram Passport which has the /// Type of element of the user's Telegram Passport which has the
@ -357,6 +365,7 @@ impl PassportElementErrorTranslationFile {
/// change. /// change.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfiles). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfiles).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorTranslationFiles { pub struct PassportElementErrorTranslationFiles {
/// Type of element of the user's Telegram Passport which has the issue /// Type of element of the user's Telegram Passport which has the issue
@ -394,6 +403,7 @@ impl PassportElementErrorTranslationFiles {
/// The error is considered resolved when new data is added. /// The error is considered resolved when new data is added.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorunspecified). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorunspecified).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
pub struct PassportElementErrorUnspecified { pub struct PassportElementErrorUnspecified {
/// Type of element of the user's Telegram Passport which has the /// Type of element of the user's Telegram Passport which has the

View file

@ -10,6 +10,7 @@ use crate::types::FileMeta;
/// don't exceed 10MB. /// don't exceed 10MB.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportfile). /// [The official docs](https://core.telegram.org/bots/api#passportfile).
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Deref)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Deref)]
pub struct PassportFile { pub struct PassportFile {
/// Metadata of the passport file. /// Metadata of the passport file.

View file

@ -1,6 +1,7 @@
use crate::types::User; use crate::types::User;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct PollAnswer { pub struct PollAnswer {
/// Unique poll identifier. /// Unique poll identifier.

View file

@ -4,6 +4,7 @@ use crate::types::User;
/// This object represents the content of a service message, sent whenever a /// This object represents the content of a service message, sent whenever a
/// user in the chat triggers a proximity alert set by another user. /// user in the chat triggers a proximity alert set by another user.
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub struct ProximityAlertTriggered { pub struct ProximityAlertTriggered {
/// User that triggered the alert. /// User that triggered the alert.

View file

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

View file

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

View file

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

View file

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

View file

@ -12,6 +12,7 @@ use crate::types::{
/// [The official docs](https://core.telegram.org/bots/api#update). /// [The official docs](https://core.telegram.org/bots/api#update).
/// ///
/// [object]: https://core.telegram.org/bots/api#available-types /// [object]: https://core.telegram.org/bots/api#available-types
#[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Update { pub struct Update {
/// The updates unique identifier. Update identifiers start from a certain /// The updates unique identifier. Update identifiers start from a certain

View file

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