Add #[non_exhaustive] to all the API types

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 13:20:33 +06:00
parent 709fe18ade
commit d85b7fdab0
86 changed files with 177 additions and 25 deletions

View file

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

View file

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

View file

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

View file

@ -9,4 +9,5 @@ use serde::{Deserialize, Serialize};
/// ///
/// [@Botfather]: https://t.me/botfather /// [@Botfather]: https://t.me/botfather
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct CallbackGame; pub struct CallbackGame;

View file

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

View file

@ -7,6 +7,7 @@ use crate::types::{ChatPermissions, ChatPhoto, Message};
/// [The official docs](https://core.telegram.org/bots/api#chat). /// [The official docs](https://core.telegram.org/bots/api#chat).
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Chat { pub struct Chat {
/// A unique identifier for this chat. This number may be greater than 32 /// A unique identifier for this chat. This number may be greater than 32
/// bits and some programming languages may have difficulty/silent defects /// bits and some programming languages may have difficulty/silent defects
@ -27,6 +28,7 @@ pub struct Chat {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum ChatKind { pub enum ChatKind {
Public(ChatPublic), Public(ChatPublic),
Private(ChatPrivate), Private(ChatPrivate),
@ -34,6 +36,7 @@ pub enum ChatKind {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatPublic { pub struct ChatPublic {
/// A title, for supergroups, channels and group chats. /// A title, for supergroups, channels and group chats.
pub title: Option<String>, pub title: Option<String>,
@ -68,6 +71,7 @@ pub struct ChatPublic {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatPrivate { pub struct ChatPrivate {
/// A dummy field. Used to ensure that the `type` field is equal to /// A dummy field. Used to ensure that the `type` field is equal to
/// `private`. /// `private`.
@ -90,6 +94,7 @@ pub struct ChatPrivate {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[serde(tag = "type")] #[serde(tag = "type")]
#[non_exhaustive]
pub enum PublicChatKind { pub enum PublicChatKind {
Channel(PublicChatChannel), Channel(PublicChatChannel),
Group(PublicChatGroup), Group(PublicChatGroup),
@ -98,6 +103,7 @@ pub enum PublicChatKind {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PublicChatChannel { pub struct PublicChatChannel {
/// A username, for private chats, supergroups and channels if available. /// A username, for private chats, supergroups and channels if available.
pub username: Option<String>, pub username: Option<String>,
@ -105,6 +111,7 @@ pub struct PublicChatChannel {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PublicChatGroup { pub struct PublicChatGroup {
/// A default chat member permissions, for groups and supergroups. Returned /// A default chat member permissions, for groups and supergroups. Returned
/// only from [`Bot::get_chat`]. /// only from [`Bot::get_chat`].
@ -115,6 +122,7 @@ pub struct PublicChatGroup {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PublicChatSupergroup { pub struct PublicChatSupergroup {
/// A username, for private chats, supergroups and channels if /// A username, for private chats, supergroups and channels if
/// available. /// available.

View file

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

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// (in the format `@channelusername`). /// (in the format `@channelusername`).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, From)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Display, From)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum ChatId { pub enum ChatId {
/// A chat identifier. /// A chat identifier.
#[display(fmt = "{}", _0)] #[display(fmt = "{}", _0)]

View file

@ -7,6 +7,7 @@ use crate::types::User;
/// ///
/// [The official docs](https://core.telegram.org/bots/api#chatmember). /// [The official docs](https://core.telegram.org/bots/api#chatmember).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatMember { pub struct ChatMember {
/// Information about the user. /// Information about the user.
pub user: User, pub user: User,

View file

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

View file

@ -5,7 +5,8 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#chatpermissions). /// [The official docs](https://core.telegram.org/bots/api#chatpermissions).
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ChatPermissions { pub struct ChatPermissions {
/// `true`, if the user is allowed to send text messages, contacts, /// `true`, if the user is allowed to send text messages, contacts,
/// locations and venues. /// locations and venues.
@ -39,18 +40,3 @@ pub struct ChatPermissions {
/// supergroups. /// supergroups.
pub can_pin_messages: Option<bool>, pub can_pin_messages: Option<bool>,
} }
impl Default for ChatPermissions {
fn default() -> Self {
Self {
can_send_messages: None,
can_send_media_messages: None,
can_send_polls: None,
can_send_other_messages: None,
can_add_web_page_previews: None,
can_change_info: None,
can_invite_users: None,
can_pin_messages: None,
}
}
}

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#chatphoto). /// [The official docs](https://core.telegram.org/bots/api#chatphoto).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
/// used only for photo download and only for as long as the photo is /// used only for photo download and only for as long as the photo is

View file

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

View file

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

View file

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

View file

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

View file

@ -7,6 +7,7 @@ use super::PassportFile;
/// ///
/// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement). /// [The official docs](https://core.telegram.org/bots/api#encryptedpassportelement).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElement { pub struct EncryptedPassportElement {
/// Base64-encoded element hash for using in /// Base64-encoded element hash for using in
/// [`PassportElementErrorKind::Unspecified`]. /// [`PassportElementErrorKind::Unspecified`].
@ -22,6 +23,7 @@ pub struct EncryptedPassportElement {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[allow(clippy::large_enum_variant)] #[allow(clippy::large_enum_variant)]
#[non_exhaustive]
pub enum EncryptedPassportElementKind { pub enum EncryptedPassportElementKind {
PersonalDetails(EncryptedPassportElementPersonalDetails), PersonalDetails(EncryptedPassportElementPersonalDetails),
Passport(EncryptedPassportElementPassport), Passport(EncryptedPassportElementPassport),
@ -40,6 +42,7 @@ pub enum EncryptedPassportElementKind {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementPersonalDetails { pub struct EncryptedPassportElementPersonalDetails {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -54,6 +57,7 @@ pub struct EncryptedPassportElementPersonalDetails {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementPassport { pub struct EncryptedPassportElementPassport {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -98,6 +102,7 @@ pub struct EncryptedPassportElementPassport {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementDriverLicense { pub struct EncryptedPassportElementDriverLicense {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -151,6 +156,7 @@ pub struct EncryptedPassportElementDriverLicense {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementIdentityCard { pub struct EncryptedPassportElementIdentityCard {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -204,7 +210,7 @@ pub struct EncryptedPassportElementIdentityCard {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementInternalPassport { pub struct EncryptedPassportElementInternalPassport {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -249,6 +255,7 @@ pub struct EncryptedPassportElementInternalPassport {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementAddress { pub struct EncryptedPassportElementAddress {
/// Base64-encoded encrypted Telegram Passport element data provided /// Base64-encoded encrypted Telegram Passport element data provided
/// by the user, available for `personal_details`, `passport`, /// by the user, available for `personal_details`, `passport`,
@ -263,6 +270,7 @@ pub struct EncryptedPassportElementAddress {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementUtilityBill { pub struct EncryptedPassportElementUtilityBill {
/// Array of encrypted files with documents provided by the user, /// Array of encrypted files with documents provided by the user,
/// available for `utility_bill`, `bank_statement`, `rental_agreement`, /// available for `utility_bill`, `bank_statement`, `rental_agreement`,
@ -289,7 +297,7 @@ pub struct EncryptedPassportElementUtilityBill {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementBankStatement { pub struct EncryptedPassportElementBankStatement {
/// Array of encrypted files with documents provided by the user, /// Array of encrypted files with documents provided by the user,
/// available for `utility_bill`, `bank_statement`, `rental_agreement`, /// available for `utility_bill`, `bank_statement`, `rental_agreement`,
@ -316,6 +324,7 @@ pub struct EncryptedPassportElementBankStatement {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementRentalAgreement { pub struct EncryptedPassportElementRentalAgreement {
/// Array of encrypted files with documents provided by the user, /// Array of encrypted files with documents provided by the user,
/// available for `utility_bill`, `bank_statement`, `rental_agreement`, /// available for `utility_bill`, `bank_statement`, `rental_agreement`,
@ -342,7 +351,7 @@ pub struct EncryptedPassportElementRentalAgreement {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementPassportRegistration { pub struct EncryptedPassportElementPassportRegistration {
/// Array of encrypted files with documents provided by the user, /// Array of encrypted files with documents provided by the user,
/// available for `utility_bill`, `bank_statement`, `rental_agreement`, /// available for `utility_bill`, `bank_statement`, `rental_agreement`,
@ -369,6 +378,7 @@ pub struct EncryptedPassportElementPassportRegistration {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementTemporaryRegistration { pub struct EncryptedPassportElementTemporaryRegistration {
/// Array of encrypted files with documents provided by the user, /// Array of encrypted files with documents provided by the user,
/// available for `utility_bill`, `bank_statement`, `rental_agreement`, /// available for `utility_bill`, `bank_statement`, `rental_agreement`,
@ -395,6 +405,7 @@ pub struct EncryptedPassportElementTemporaryRegistration {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementPhoneNumber { pub struct EncryptedPassportElementPhoneNumber {
/// User's verified phone number, available only for `phone_number` /// User's verified phone number, available only for `phone_number`
/// type. /// type.
@ -403,7 +414,7 @@ pub struct EncryptedPassportElementPhoneNumber {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct EncryptedPassportElementEmail { pub struct EncryptedPassportElementEmail {
/// User's verified email address, available only for `email` type. /// User's verified email address, available only for `email` type.
pub email: String, pub email: String,

View file

@ -10,6 +10,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [`Bot::get_file`]: crate::Bot::get_file /// [`Bot::get_file`]: crate::Bot::get_file
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct File { pub struct File {
/// Identifier for this file. /// Identifier for this file.
pub file_id: String, pub file_id: String,

View file

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

View file

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

View file

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

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton). /// [The official docs](https://core.telegram.org/bots/api#inlinekeyboardbutton).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InlineKeyboardButton { pub struct InlineKeyboardButton {
/// Label text on the button. /// Label text on the button.
pub text: String, pub text: String,
@ -15,6 +16,7 @@ pub struct InlineKeyboardButton {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum InlineKeyboardButtonKind { pub enum InlineKeyboardButtonKind {
/// HTTP or tg:// url to be opened when button is pressed. /// HTTP or tg:// url to be opened when button is pressed.
Url(String), Url(String),

View file

@ -12,6 +12,7 @@ use crate::types::InlineKeyboardButton;
/// ///
/// [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
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Default)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Default)]
#[non_exhaustive]
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
/// [`InlineKeyboardButton`] objects. /// [`InlineKeyboardButton`] objects.

View file

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

View file

@ -19,6 +19,7 @@ use crate::types::{
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, From)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, From)]
#[serde(tag = "type")] #[serde(tag = "type")]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum InlineQueryResult { pub enum InlineQueryResult {
#[serde(rename = "audio")] #[serde(rename = "audio")]
CachedAudio(InlineQueryResultCachedAudio), CachedAudio(InlineQueryResultCachedAudio),

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -6,6 +6,7 @@ use std::{borrow::Cow, path::PathBuf};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#inputfile). /// [The official docs](https://core.telegram.org/bots/api#inputfile).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Deserialize)]
#[non_exhaustive]
pub enum InputFile { pub enum InputFile {
File(PathBuf), File(PathBuf),
Memory { file_name: String, data: Cow<'static, [u8]> }, Memory { file_name: String, data: Cow<'static, [u8]> },

View file

@ -2,13 +2,13 @@ use serde::{Deserialize, Serialize};
use crate::types::{InputFile, ParseMode}; use crate::types::{InputFile, ParseMode};
// TODO: should variants use new-type?
#[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. /// This object represents the content of a media message to be sent.
/// ///
/// [The official docs](https://core.telegram.org/bots/api#inputmedia). /// [The official docs](https://core.telegram.org/bots/api#inputmedia).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum InputMedia { pub enum InputMedia {
Photo(InputMediaPhoto), Photo(InputMediaPhoto),
Video(InputMediaVideo), Video(InputMediaVideo),

View file

@ -8,6 +8,7 @@ use crate::types::ParseMode;
/// [The official docs](https://core.telegram.org/bots/api#inputmessagecontent). /// [The official docs](https://core.telegram.org/bots/api#inputmessagecontent).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum InputMessageContent { pub enum InputMessageContent {
Text(InputMessageContentText), Text(InputMessageContentText),
Location(InputMessageContentLocation), Location(InputMessageContentLocation),
@ -18,6 +19,7 @@ pub enum InputMessageContent {
/// inline query. /// inline query.
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InputMessageContentText { pub struct InputMessageContentText {
/// Text of the message to be sent, 1-4096 characters. /// Text of the message to be sent, 1-4096 characters.
pub message_text: String, pub message_text: String,
@ -38,6 +40,7 @@ pub struct InputMessageContentText {
/// inline query. /// inline query.
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InputMessageContentLocation { pub struct InputMessageContentLocation {
/// Latitude of the location in degrees. /// Latitude of the location in degrees.
pub latitude: f64, pub latitude: f64,
@ -54,7 +57,7 @@ pub struct InputMessageContentLocation {
/// an inline query. /// an inline query.
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InputMessageContentVenue { pub struct InputMessageContentVenue {
/// Latitude of the venue in degrees. /// Latitude of the venue in degrees.
pub latitude: f64, pub latitude: f64,
@ -81,6 +84,7 @@ pub struct InputMessageContentVenue {
/// an inline query. /// an inline query.
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct InputMessageContentContact { pub struct InputMessageContentContact {
/// Contact's phone number. /// Contact's phone number.
pub phone_number: String, pub phone_number: String,

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#invoice). /// [The official docs](https://core.telegram.org/bots/api#invoice).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Invoice { pub struct Invoice {
/// Product name. /// Product name.
pub title: String, pub title: String,

View file

@ -10,6 +10,7 @@ use crate::types::{KeyboardButtonPollType, True};
/// [The official docs](https://core.telegram.org/bots/api#keyboardbutton). /// [The official docs](https://core.telegram.org/bots/api#keyboardbutton).
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct KeyboardButton { pub struct KeyboardButton {
/// Text of the button. If none of the optional fields are used, it will /// Text of the button. If none of the optional fields are used, it will
/// be sent as a message when the button is pressed. /// be sent as a message when the button is pressed.
@ -45,6 +46,7 @@ impl KeyboardButton {
// Serialize + Deserialize are implemented by hand // Serialize + Deserialize are implemented by hand
#[derive(Clone, Debug, Eq, Hash, PartialEq)] #[derive(Clone, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum ButtonRequest { pub enum ButtonRequest {
Location, Location,
Contact, Contact,
@ -54,6 +56,7 @@ pub enum ButtonRequest {
/// Helper struct for (de)serializing [`ButtonRequest`](ButtonRequest) /// Helper struct for (de)serializing [`ButtonRequest`](ButtonRequest)
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]
#[non_exhaustive]
struct RawRequest { struct RawRequest {
/// If `true`, the user's phone number will be sent as a contact /// If `true`, the user's phone number will be sent as a contact
/// when the button is pressed. Available in private chats only. /// when the button is pressed. Available in private chats only.

View file

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct KeyboardButtonPollType { pub struct KeyboardButtonPollType {
poll_type: String, poll_type: String,
} }

View file

@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#labeledprice). /// [The official docs](https://core.telegram.org/bots/api#labeledprice).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct LabeledPrice { pub struct LabeledPrice {
/// Portion label. /// Portion label.
pub label: String, pub label: String,

View file

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

View file

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

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#maskposition). /// [The official docs](https://core.telegram.org/bots/api#maskposition).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
/// of `forehead`, `eyes`, `mouth`, or `chin`. /// of `forehead`, `eyes`, `mouth`, or `chin`.

View file

@ -13,6 +13,7 @@ use crate::types::{
/// ///
/// [The official docs](https://core.telegram.org/bots/api#message). /// [The official docs](https://core.telegram.org/bots/api#message).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Message { pub struct Message {
/// Unique message identifier inside this chat. /// Unique message identifier inside this chat.
#[serde(rename = "message_id")] #[serde(rename = "message_id")]
@ -30,6 +31,7 @@ pub struct Message {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum MessageKind { pub enum MessageKind {
Common(MessageCommon), Common(MessageCommon),
NewChatMembers(MessageNewChatMembers), NewChatMembers(MessageNewChatMembers),
@ -50,6 +52,7 @@ pub enum MessageKind {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageCommon { pub struct MessageCommon {
/// Sender, empty for messages sent to channels. /// Sender, empty for messages sent to channels.
pub from: Option<User>, pub from: Option<User>,
@ -69,6 +72,7 @@ pub struct MessageCommon {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageNewChatMembers { pub struct MessageNewChatMembers {
/// New members that were added to the group or supergroup and /// New members that were added to the group or supergroup and
/// information about them (the bot itself may be one of these /// information about them (the bot itself may be one of these
@ -77,6 +81,7 @@ pub struct MessageNewChatMembers {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageLeftChatMember { pub struct MessageLeftChatMember {
/// A member was removed from the group, information about them (this /// A member was removed from the group, information about them (this
/// member may be the bot itself). /// member may be the bot itself).
@ -84,30 +89,35 @@ pub struct MessageLeftChatMember {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageNewChatTitle { pub struct MessageNewChatTitle {
/// A chat title was changed to this value. /// A chat title was changed to this value.
pub new_chat_title: String, pub new_chat_title: String,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageNewChatPhoto { pub struct MessageNewChatPhoto {
/// A chat photo was change to this value. /// A chat photo was change to this value.
pub new_chat_photo: Vec<PhotoSize>, pub new_chat_photo: Vec<PhotoSize>,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageDeleteChatPhoto { pub struct MessageDeleteChatPhoto {
/// Service message: the chat photo was deleted. /// Service message: the chat photo was deleted.
pub delete_chat_photo: True, pub delete_chat_photo: True,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageGroupChatCreated { pub struct MessageGroupChatCreated {
/// Service message: the group has been created. /// Service message: the group has been created.
pub group_chat_created: True, pub group_chat_created: True,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageSupergroupChatCreated { pub struct MessageSupergroupChatCreated {
/// Service message: the supergroup has been created. This field cant /// Service message: the supergroup has been created. This field cant
/// be received in a message coming through updates, because bot cant /// be received in a message coming through updates, because bot cant
@ -118,6 +128,7 @@ pub struct MessageSupergroupChatCreated {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageChannelChatCreated { pub struct MessageChannelChatCreated {
/// Service message: the channel has been created. This field cant be /// Service message: the channel has been created. This field cant be
/// received in a message coming through updates, because bot cant be /// received in a message coming through updates, because bot cant be
@ -128,6 +139,7 @@ pub struct MessageChannelChatCreated {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageMigrate { pub struct MessageMigrate {
/// The group has been migrated to a supergroup with the specified /// The group has been migrated to a supergroup with the specified
/// identifier. This number may be greater than 32 bits and some /// identifier. This number may be greater than 32 bits and some
@ -147,6 +159,7 @@ pub struct MessageMigrate {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessagePinned { pub struct MessagePinned {
/// Specified message was pinned. Note that the Message object in this /// Specified message was pinned. Note that the Message object in this
/// field will not contain further `reply_to_message` fields even if it /// field will not contain further `reply_to_message` fields even if it
@ -156,6 +169,7 @@ pub struct MessagePinned {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageInvoice { pub struct MessageInvoice {
/// Message is an invoice for a [payment], information about the /// Message is an invoice for a [payment], information about the
/// invoice. [More about payments »]. /// invoice. [More about payments »].
@ -166,6 +180,7 @@ pub struct MessageInvoice {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageSuccessfulPayment { pub struct MessageSuccessfulPayment {
/// Message is a service message about a successful payment, /// Message is a service message about a successful payment,
/// information about the payment. [More about payments »]. /// information about the payment. [More about payments »].
@ -175,6 +190,7 @@ pub struct MessageSuccessfulPayment {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageConnectedWebsite { pub struct MessageConnectedWebsite {
/// The domain name of the website on which the user has logged in. /// The domain name of the website on which the user has logged in.
/// [More about Telegram Login »]. /// [More about Telegram Login »].
@ -184,12 +200,14 @@ pub struct MessageConnectedWebsite {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessagePassportData { pub struct MessagePassportData {
/// Telegram Passport data. /// Telegram Passport data.
pub passport_data: PassportData, pub passport_data: PassportData,
} }
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub enum ForwardedFrom { pub enum ForwardedFrom {
#[serde(rename = "forward_from")] #[serde(rename = "forward_from")]
User(User), User(User),
@ -199,6 +217,7 @@ pub enum ForwardedFrom {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum ForwardKind { pub enum ForwardKind {
Channel(ForwardChannel), Channel(ForwardChannel),
NonChannel(ForwardNonChannel), NonChannel(ForwardNonChannel),
@ -206,6 +225,7 @@ pub enum ForwardKind {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ForwardChannel { pub struct ForwardChannel {
#[serde(rename = "forward_date")] #[serde(rename = "forward_date")]
pub date: i32, pub date: i32,
@ -221,6 +241,7 @@ pub struct ForwardChannel {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ForwardNonChannel { pub struct ForwardNonChannel {
#[serde(rename = "forward_date")] #[serde(rename = "forward_date")]
pub date: i32, pub date: i32,
@ -230,12 +251,14 @@ pub struct ForwardNonChannel {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ForwardOrigin { pub struct ForwardOrigin {
pub reply_to_message: Option<Box<Message>>, pub reply_to_message: Option<Box<Message>>,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum MediaKind { pub enum MediaKind {
Animation(MediaAnimation), Animation(MediaAnimation),
Audio(MediaAudio), Audio(MediaAudio),
@ -254,6 +277,7 @@ pub enum MediaKind {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaAnimation { pub struct MediaAnimation {
/// Message is an animation, information about the animation. For /// Message is an animation, information about the animation. For
/// backward compatibility, when this field is set, the document field /// backward compatibility, when this field is set, the document field
@ -276,6 +300,7 @@ pub struct MediaAnimation {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaAudio { pub struct MediaAudio {
/// Message is an audio file, information about the file. /// Message is an audio file, information about the file.
pub audio: Audio, pub audio: Audio,
@ -290,6 +315,7 @@ pub struct MediaAudio {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaContact { pub struct MediaContact {
/// Message is a shared contact, information about the contact. /// Message is a shared contact, information about the contact.
contact: Contact, contact: Contact,
@ -297,6 +323,7 @@ pub struct MediaContact {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaDocument { pub struct MediaDocument {
/// Message is a general file, information about the file. /// Message is a general file, information about the file.
pub document: Document, pub document: Document,
@ -311,6 +338,7 @@ pub struct MediaDocument {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaGame { pub struct MediaGame {
/// Message is a game, information about the game. [More /// Message is a game, information about the game. [More
/// about games »]. /// about games »].
@ -320,6 +348,7 @@ pub struct MediaGame {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaLocation { pub struct MediaLocation {
/// Message is a shared location, information about the location. /// Message is a shared location, information about the location.
pub location: Location, pub location: Location,
@ -327,6 +356,7 @@ pub struct MediaLocation {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaPhoto { pub struct MediaPhoto {
/// Message is a photo, available sizes of the photo. /// Message is a photo, available sizes of the photo.
pub photo: Vec<PhotoSize>, pub photo: Vec<PhotoSize>,
@ -345,18 +375,21 @@ pub struct MediaPhoto {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaPoll { pub struct MediaPoll {
/// Message is a native poll, information about the poll. /// Message is a native poll, information about the poll.
pub poll: Poll, pub poll: Poll,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaSticker { pub struct MediaSticker {
/// Message is a sticker, information about the sticker. /// Message is a sticker, information about the sticker.
pub sticker: Sticker, pub sticker: Sticker,
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaText { pub struct MediaText {
/// For text messages, the actual UTF-8 text of the message, 0-4096 /// For text messages, the actual UTF-8 text of the message, 0-4096
/// characters. /// characters.
@ -370,6 +403,7 @@ pub struct MediaText {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaVideo { pub struct MediaVideo {
/// Message is a video, information about the video. /// Message is a video, information about the video.
pub video: Video, pub video: Video,
@ -388,6 +422,7 @@ pub struct MediaVideo {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaVideoNote { pub struct MediaVideoNote {
/// Message is a [video note], information about the video message. /// Message is a [video note], information about the video message.
/// ///
@ -397,6 +432,7 @@ pub struct MediaVideoNote {
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaVoice { pub struct MediaVoice {
/// Message is a voice message, information about the file. /// Message is a voice message, information about the file.
pub voice: Voice, pub voice: Voice,
@ -411,6 +447,7 @@ pub struct MediaVoice {
} }
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MediaVenue { pub struct MediaVenue {
/// Message is a venue, information about the venue. /// Message is a venue, information about the venue.
pub venue: Venue, pub venue: Venue,

View file

@ -8,6 +8,7 @@ use crate::types::{Message, User};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#messageentity). /// [The official docs](https://core.telegram.org/bots/api#messageentity).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct MessageEntity { pub struct MessageEntity {
#[serde(flatten)] #[serde(flatten)]
pub kind: MessageEntityKind, pub kind: MessageEntityKind,
@ -22,6 +23,7 @@ pub struct MessageEntity {
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[serde(tag = "type")] #[serde(tag = "type")]
#[non_exhaustive]
pub enum MessageEntityKind { pub enum MessageEntityKind {
Mention, Mention,
Hashtag, Hashtag,

View file

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

View file

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

View file

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

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerror). /// [The official docs](https://core.telegram.org/bots/api#passportelementerror).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PassportElementError { pub struct PassportElementError {
/// Error message. /// Error message.
message: String, message: String,
@ -16,6 +17,7 @@ pub struct PassportElementError {
// TODO: use different types? // TODO: use different types?
#[serde(tag = "source")] #[serde(tag = "source")]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub enum PassportElementErrorKind { pub enum PassportElementErrorKind {
#[serde(rename = "data")] #[serde(rename = "data")]
DataField(PassportElementErrorDataField), DataField(PassportElementErrorDataField),
@ -52,6 +54,7 @@ pub enum PassportElementErrorKind {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrordatafield). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrordatafield).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorDataFieldType, pub r#type: PassportElementErrorDataFieldType,
@ -70,6 +73,7 @@ pub struct PassportElementErrorDataField {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfrontside). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfrontside).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorFrontSideType, pub r#type: PassportElementErrorFrontSideType,
@ -86,6 +90,7 @@ pub struct PassportElementErrorFrontSide {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorreverseside). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorreverseside).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorReverseSideType, pub r#type: PassportElementErrorReverseSideType,
@ -101,6 +106,7 @@ pub struct PassportElementErrorReverseSide {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorselfie). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorselfie).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorSelfieType, pub r#type: PassportElementErrorSelfieType,
@ -116,6 +122,7 @@ pub struct PassportElementErrorSelfie {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfile). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfile).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorFileType, pub r#type: PassportElementErrorFileType,
@ -131,6 +138,7 @@ pub struct PassportElementErrorFile {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfiles). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorfiles).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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.
pub r#type: PassportElementErrorFilesType, pub r#type: PassportElementErrorFilesType,
@ -146,6 +154,7 @@ pub struct PassportElementErrorFiles {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfile). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfile).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
/// issue. /// issue.
@ -162,6 +171,7 @@ pub struct PassportElementErrorTranslationFile {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfiles). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrortranslationfiles).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
pub r#type: PassportElementErrorTranslationFilesType, pub r#type: PassportElementErrorTranslationFilesType,
@ -176,6 +186,7 @@ pub struct PassportElementErrorTranslationFiles {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#passportelementerrorunspecified). /// [The official docs](https://core.telegram.org/bots/api#passportelementerrorunspecified).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
/// issue. /// issue.
@ -187,6 +198,7 @@ pub struct PassportElementErrorUnspecified {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorDataFieldType { pub enum PassportElementErrorDataFieldType {
PersonalDetails, PersonalDetails,
Passport, Passport,
@ -198,6 +210,7 @@ pub enum PassportElementErrorDataFieldType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorFrontSideType { pub enum PassportElementErrorFrontSideType {
Passport, Passport,
DriverLicense, DriverLicense,
@ -207,6 +220,7 @@ pub enum PassportElementErrorFrontSideType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorReverseSideType { pub enum PassportElementErrorReverseSideType {
DriverLicense, DriverLicense,
IdentityCard, IdentityCard,
@ -214,6 +228,7 @@ pub enum PassportElementErrorReverseSideType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorSelfieType { pub enum PassportElementErrorSelfieType {
Passport, Passport,
DriverLicense, DriverLicense,
@ -223,6 +238,7 @@ pub enum PassportElementErrorSelfieType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorFileType { pub enum PassportElementErrorFileType {
UtilityBill, UtilityBill,
BankStatement, BankStatement,
@ -233,6 +249,7 @@ pub enum PassportElementErrorFileType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorFilesType { pub enum PassportElementErrorFilesType {
UtilityBill, UtilityBill,
BankStatement, BankStatement,
@ -243,6 +260,7 @@ pub enum PassportElementErrorFilesType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorTranslationFileType { pub enum PassportElementErrorTranslationFileType {
Passport, Passport,
DriverLicense, DriverLicense,
@ -257,6 +275,7 @@ pub enum PassportElementErrorTranslationFileType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorTranslationFilesType { pub enum PassportElementErrorTranslationFilesType {
Passport, Passport,
DriverLicense, DriverLicense,
@ -271,6 +290,7 @@ pub enum PassportElementErrorTranslationFilesType {
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum PassportElementErrorUnspecifiedType { pub enum PassportElementErrorUnspecifiedType {
DataField, DataField,
FrontSide, FrontSide,

View file

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

View file

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

View file

@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
/// [The official docs](https://core.telegram.org/bots/api#poll). /// [The official docs](https://core.telegram.org/bots/api#poll).
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Poll { pub struct Poll {
/// Unique poll identifier. /// Unique poll identifier.
pub id: String, pub id: String,
@ -42,6 +43,7 @@ pub struct Poll {
/// ///
/// [The official docs](https://core.telegram.org/bots/api#polloption). /// [The official docs](https://core.telegram.org/bots/api#polloption).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct PollOption { pub struct PollOption {
/// Option text, 1-100 characters. /// Option text, 1-100 characters.
pub text: String, pub text: String,

View file

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

View file

@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[non_exhaustive]
pub enum PollType { pub enum PollType {
Quiz, Quiz,
Regular, Regular,

View file

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

View file

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

View file

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

View file

@ -5,6 +5,7 @@ use crate::types::{ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyK
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, From)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, From)]
#[serde(untagged)] #[serde(untagged)]
#[non_exhaustive]
pub enum ReplyMarkup { pub enum ReplyMarkup {
InlineKeyboardMarkup(InlineKeyboardMarkup), InlineKeyboardMarkup(InlineKeyboardMarkup),
ReplyKeyboardMarkup(ReplyKeyboardMarkup), ReplyKeyboardMarkup(ReplyKeyboardMarkup),

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// [The official docs](https://core.telegram.org/bots/api#responseparameters). /// [The official docs](https://core.telegram.org/bots/api#responseparameters).
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum ResponseParameters { pub enum ResponseParameters {
/// The group has been migrated to a supergroup with the specified /// The group has been migrated to a supergroup with the specified
/// identifier. This number may be greater than 32 bits and some /// identifier. This number may be greater than 32 bits and some

View file

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

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// ///
/// [The official docs](https://core.telegram.org/bots/api#shippingaddress). /// [The official docs](https://core.telegram.org/bots/api#shippingaddress).
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ShippingAddress { pub struct ShippingAddress {
/// ISO 3166-1 alpha-2 country code. /// ISO 3166-1 alpha-2 country code.
pub country_code: CountryCode, pub country_code: CountryCode,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -14,6 +14,7 @@ use serde_json::Value;
/// ///
/// [object]: https://core.telegram.org/bots/api#available-types /// [object]: https://core.telegram.org/bots/api#available-types
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
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
/// positive number and increase sequentially. This ID becomes especially /// positive number and increase sequentially. This ID becomes especially
@ -54,6 +55,7 @@ impl Update {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub enum UpdateKind { pub enum UpdateKind {
/// New incoming message of any kind — text, photo, sticker, etc. /// New incoming message of any kind — text, photo, sticker, etc.
Message(Message), Message(Message),

View file

@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};
/// [The official docs](https://core.telegram.org/bots/api#user). /// [The official docs](https://core.telegram.org/bots/api#user).
#[serde_with_macros::skip_serializing_none] #[serde_with_macros::skip_serializing_none]
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct User { pub struct User {
/// Unique identifier for this user or bot. /// Unique identifier for this user or bot.
pub id: i32, pub id: i32,
@ -48,6 +49,7 @@ impl User {
/// ///
/// [`Bot::get_me`]: crate::Bot::get_me /// [`Bot::get_me`]: crate::Bot::get_me
#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Me { pub struct Me {
#[serde(flatten)] #[serde(flatten)]
pub user: User, pub user: User,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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