conogram/entities/
contact.rs

1use serde::{Deserialize, Serialize};
2
3/// This object represents a phone contact.
4///
5/// API Reference: [link](https://core.telegram.org/bots/api/#contact)
6#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7pub struct Contact {
8    /// Contact's phone number
9    pub phone_number: String,
10
11    /// Contact's first name
12    pub first_name: String,
13
14    /// *Optional*. Contact's last name
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub last_name: Option<String>,
17
18    /// *Optional*. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
19    #[serde(default, skip_serializing_if = "Option::is_none")]
20    pub user_id: Option<i64>,
21
22    /// *Optional*. Additional data about the contact in the form of a [vCard](https://en.wikipedia.org/wiki/VCard)
23    #[serde(default, skip_serializing_if = "Option::is_none")]
24    pub vcard: Option<String>,
25}
26
27// Divider: all content below this line will be preserved after code regen