tg_flows/types/contact.rs
1use serde::{Deserialize, Serialize};
2
3use crate::types::UserId;
4
5/// This object represents a phone contact.
6///
7/// [The official docs](https://core.telegram.org/bots/api#contact).
8#[serde_with_macros::skip_serializing_none]
9#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
10pub struct Contact {
11 /// A contact's phone number.
12 pub phone_number: String,
13
14 /// A contact's first name.
15 pub first_name: String,
16
17 /// A contact's last name.
18 pub last_name: Option<String>,
19
20 /// A contact's user identifier in Telegram.
21 pub user_id: Option<UserId>,
22
23 /// Additional data about the contact in the form of a [vCard].
24 ///
25 /// [vCard]: https://en.wikipedia.org/wiki/VCard
26 pub vcard: Option<String>,
27}