botx_api/api/v3/chats/add_admin/
models.rs1use serde::{Serialize, Deserialize};
2use uuid::Uuid;
3
4use crate::api::{
5 models::ChatNotFound,
6 v3::chats::models::*
7};
8
9#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder)]
11#[builder(setter(into, prefix = "with", strip_option))]
12pub struct AddAdminRequest {
13 pub group_chat_id: Uuid,
15
16 pub user_huids: Vec<Uuid>,
18}
19
20#[derive(Debug, Serialize, Deserialize, Clone)]
22pub struct AddAdminResponse {
23 pub result: bool,
27}
28
29#[derive(Debug, Serialize, Deserialize, Clone)]
31#[serde(tag = "reason")]
32pub enum AddAdminError {
33 #[serde(rename(serialize = "chat_not_found", deserialize = "chat_not_found"))]
35 ChatNotFound(ChatNotFound),
36
37 #[serde(rename(serialize = "no_permission_for_operation", deserialize = "no_permission_for_operation"))]
39 NoPermissionForOperation(NoPermissionForOperation),
40
41 #[serde(rename(serialize = "chat_members_not_modifiable", deserialize = "chat_members_not_modifiable"))]
43 ChatMemberNotModifiable(ChatMemberNotModifiable),
44
45 #[serde(other)]
48 Other,
49}