botx_api/api/v3/chats/disable_stealth/
models.rs

1use serde::{Serialize, Deserialize};
2use uuid::Uuid;
3
4use crate::api::{
5    models::ChatNotFound,
6    v3::chats::models::*
7};
8
9/// Запрос на отключении стелс режима в чате
10#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder)]
11#[builder(setter(into, prefix = "with", strip_option))]
12pub struct DisableStealthRequest {
13    /// Идентификатор чата
14    pub group_chat_id: Uuid,
15}
16
17/// Ответ eXpress на запрос отключении стелс режима в чате
18#[derive(Debug, Serialize, Deserialize, Clone)]
19pub struct DisableStealthResponse {
20    /// Результат запроса
21    /// 
22    /// TODO: Я не знаю что значит false, документация не описывает, откройте issue как станет понятно 
23    pub result: bool,
24}
25
26/// Ошибки при отключении стелс режима в чате
27#[derive(Debug, Serialize, Deserialize, Clone)]
28#[serde(tag = "reason")]
29pub enum DisableStealthError {
30    /// Чат не найден
31    #[serde(rename(serialize = "chat_not_found", deserialize = "chat_not_found"))]
32    ChatNotFound(ChatNotFound),
33
34    /// Бот не является админом чата
35    #[serde(rename(serialize = "no_permission_for_operation", deserialize = "no_permission_for_operation"))]
36    NoPermissionForOperation(NoPermissionForOperation),
37
38    // TODO: добавить десериализацию в HashMap<string, string> когда завезут реализацию
39    /// Неопределенная ошибка, смотрите логи
40    #[serde(other)]
41    Other,
42}