Add BusinessConnection struct

This commit is contained in:
Akshett Rai Jindal 2024-08-21 01:28:31 +05:30
parent 6bec7a84ff
commit e8afdc58fc
2 changed files with 30 additions and 0 deletions

View file

@ -9,6 +9,7 @@ pub use bot_command_scope::*;
pub use bot_description::*; pub use bot_description::*;
pub use bot_name::*; pub use bot_name::*;
pub use bot_short_description::*; pub use bot_short_description::*;
pub use business_connection::*;
pub use business_intro::*; pub use business_intro::*;
pub use business_location::*; pub use business_location::*;
pub use business_opening_hours::*; pub use business_opening_hours::*;
@ -167,6 +168,7 @@ mod bot_command_scope;
mod bot_description; mod bot_description;
mod bot_name; mod bot_name;
mod bot_short_description; mod bot_short_description;
mod business_connection;
mod business_intro; mod business_intro;
mod business_location; mod business_location;
mod business_opening_hours; mod business_opening_hours;

View file

@ -0,0 +1,28 @@
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use crate::types::{User, UserId};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BusinessConnection {
/// Unique identifier of the business connection
pub id: String,
/// Business account user that created the business connection
pub user: User,
/// The user id of the private chat with the user who created the business
/// connection
pub user_chat_id: UserId,
/// Date the connection was established in Unix time
#[serde(with = "crate::types::serde_date_from_unix_timestamp")]
pub date: DateTime<Utc>,
/// `true`, if the bot can act on behalf of the business account in chats
/// that were active in the last 24 hours
pub can_reply: bool,
/// `true`, if the connection is alive
pub is_enabled: bool,
}