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 pub ip_address: Option<String>,
18 /// Unix timestamp of the most recent error when delivering updates.
19 pub last_error_date: Option<i64>,
20 /// Description of the most recent delivery error.
21 pub last_error_message: Option<String>,
22 /// Unix timestamp of the most recent error when synchronising with the webhook.
23 pub last_synchronization_error_date: Option<i64>,
24 /// Maximum allowed number of simultaneous HTTPS connections to the webhook.
25 pub max_connections: Option<u32>,
26 /// List of update types the bot is subscribed to.
27 pub allowed_updates: Option<Vec<String>>,
28}