botx_api/bot/models/
status_request.rs

1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4use crate::api::models::Status;
5
6use super::ChatType;
7
8#[derive(Deserialize, Debug)]
9pub struct StatusRequest {
10    pub bot_id: Uuid,
11    pub user_huid: Uuid,
12    pub ad_login: Option<String>,
13    pub ad_domain: Option<String>,
14    pub is_admin: Option<bool>,
15    pub chat_type: Option<ChatType>,
16}
17
18#[derive(Serialize, Debug, Clone, Builder)]
19#[builder(setter(into, prefix = "with", strip_option))]
20pub struct StatusResponse {
21    /// Успешность обработки ответа “ok”|“error”
22    pub status: Status,
23
24    /// Ответ
25    pub result: StatusResponseResult,
26}
27
28#[derive(Serialize, Debug, Clone, Builder)]
29#[builder(setter(into, prefix = "with", strip_option))]
30pub struct StatusResponseResult {
31    /// Бот включен/выключен
32    pub enabled: bool,
33
34    /// Текущий статус бота
35    #[builder(default)]
36    pub status_message: Option<String>,
37
38    /// Список команд бота 
39    #[builder(default)]
40    pub commands: Vec<BotCommand>,
41}
42
43/// Команда бота 
44#[derive(Serialize, Debug, Clone, Builder)]
45#[builder(setter(into, prefix = "with", strip_option))]
46pub struct BotCommand {
47    /// Описание команды
48    pub description: String,
49
50    /// Тело команды
51    pub body: String,
52
53    /// Имя команды
54    pub name: String,
55}