conogram/entities/
passport_element_error_data_field.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
4///
5/// API Reference: [link](https://core.telegram.org/bots/api/#passportelementerrordatafield)
6#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
7pub struct PassportElementErrorDataField {
8    /// The section of the user's Telegram Passport which has the error, one of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address”
9    #[serde(rename = "type")]
10    pub type_: PassportElementErrorDataFieldType,
11
12    /// Name of the data field which has the error
13    pub field_name: String,
14
15    /// Base64-encoded data hash
16    pub data_hash: String,
17
18    /// Error message
19    pub message: String,
20}
21
22/// The section of the user's Telegram Passport which has the error, one of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address”
23#[derive(Debug, Clone, Copy, Default, PartialEq, Serialize, Deserialize)]
24pub enum PassportElementErrorDataFieldType {
25    /// `personal_details`
26    #[default]
27    #[serde(rename = "personal_details")]
28    PersonalDetails,
29
30    /// `passport`
31    #[serde(rename = "passport")]
32    Passport,
33
34    /// `driver_license`
35    #[serde(rename = "driver_license")]
36    DriverLicense,
37
38    /// `identity_card`
39    #[serde(rename = "identity_card")]
40    IdentityCard,
41
42    /// `internal_passport`
43    #[serde(rename = "internal_passport")]
44    InternalPassport,
45
46    /// `address`
47    #[serde(rename = "address")]
48    Address,
49}
50
51// Divider: all content below this line will be preserved after code regen