From 8b39c5fb68e5bd54808bd8d9eadcba4c98e41c4b Mon Sep 17 00:00:00 2001 From: RustemB Date: Tue, 3 Sep 2019 22:37:18 +0500 Subject: [PATCH] WebhookInfo --- src/core/types/webhook_info.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/core/types/webhook_info.rs diff --git a/src/core/types/webhook_info.rs b/src/core/types/webhook_info.rs new file mode 100644 index 00000000..4290c0a8 --- /dev/null +++ b/src/core/types/webhook_info.rs @@ -0,0 +1,24 @@ +use serde::Deserialize; + +/// Contains information about the current status of a webhook. +#[derive(Debug, Deserialize, Hash, PartialEq, Eq)] +pub struct WebhookInfo { + /// Webhook URL, may be empty if webhook is not set up + pub url: String, + /// True, if a custom certificate was provided for webhook certificate checks + pub has_custom_certificate: bool, + /// Number of updates awaiting delivery + pub pending_update_count: u32, + /// Optional. Unix time for the most recent error that happened when trying + /// to deliver an update via webhook + pub last_error_date: Option, + /// Optional. Error message in human-readable format for the most recent + /// error that happened when trying to deliver an update via webhook + pub last_error_message: Option, + /// Optional. Maximum allowed number of simultaneous HTTPS connections to + /// the webhook for update delivery + pub max_connections: Option, + /// Optional. A list of update types the bot is subscribed to. Defaults + /// to all update types + pub allowed_updates: Option>, +}