Skip to main content

rustigram_types/
webhook.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4/// Current status of a registered webhook.
5///
6/// Returned by [`getWebhookInfo`](https://core.telegram.org/bots/api#getwebhookinfo).
7/// Check `last_error_message` and `last_error_date` to diagnose delivery
8/// failures.
9pub struct WebhookInfo {
10    /// Webhook URL.
11    pub url: String,
12    /// `true` if a custom certificate was provided for the webhook.
13    pub has_custom_certificate: bool,
14    /// Number of updates awaiting delivery.
15    pub pending_update_count: u32,
16    /// Currently used webhook IP address.
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub ip_address: Option<String>,
19    /// Unix timestamp of the most recent error when delivering updates.
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub last_error_date: Option<i64>,
22    /// Description of the most recent delivery error.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub last_error_message: Option<String>,
25    /// Unix timestamp of the most recent error when synchronising with the webhook.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub last_synchronization_error_date: Option<i64>,
28    /// Maximum allowed number of simultaneous HTTPS connections to the webhook.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub max_connections: Option<u32>,
31    /// List of update types the bot is subscribed to.
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub allowed_updates: Option<Vec<String>>,
34}