botx_api/api/v4/notification/internal/
models.rs1use serde::{Serialize, Deserialize};
2use uuid::Uuid;
3
4use crate::api::{models::*};
5
6#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder)]
7#[builder(setter(into, prefix = "with", strip_option))]
8pub struct InternalNotificationRequest<TData, TOptions> {
9 pub group_chat_id: Uuid,
11
12 pub data: TData,
14
15 pub opts: TOptions,
17
18 #[builder(default)]
20 pub recipients: Option<Vec<Uuid>>,
21}
22
23#[derive(Debug, Serialize, Deserialize, Clone)]
24pub struct InternalNotificationResponse {
25 pub result: InternalNotificationResult,
26}
27
28#[derive(Debug, Serialize, Deserialize, Clone)]
29pub struct InternalNotificationResult {
30 pub sync_id: Uuid,
32}
33
34#[derive(Debug, Serialize, Deserialize, Clone)]
43#[serde(tag = "reason")]
44pub enum InternalNotificationExpressError {
46 #[serde(rename(serialize = "too_many_requests", deserialize = "too_many_requests"))]
48 TooManyRequests(TooManyRequests),
49
50 #[serde(rename(serialize = "chat_not_found", deserialize = "chat_not_found"))]
52 ChatNotFound(ChatNotFoundWithEventId),
53
54 #[serde(rename(serialize = "error_from_messaging_service", deserialize = "error_from_messaging_service"))]
56 ErrorFromMessagingService(ErrorFromMessagingServiceWithEventId),
57
58 #[serde(rename(serialize = "bot_is_not_a_chat_member", deserialize = "bot_is_not_a_chat_member"))]
60 BotIsNotAChatMember(BotIsNotAChatMember),
61
62 #[serde(rename(serialize = "event_recipients_list_is_empty", deserialize = "event_recipients_list_is_empty"))]
64 EventRecipientsListIsEmpty(EventRecipientsListIsEmpty),
65
66 #[serde(other)]
69 Other,
70}
71
72#[derive(Debug, Serialize, Deserialize, Clone)]
73pub struct TooManyRequests {
75 pub errors: Vec<String>,
76 pub error_data: TooManyRequestsData,
77}
78
79#[derive(Debug, Serialize, Deserialize, Clone)]
80pub struct TooManyRequestsData {
82 pub bot_id: Uuid,
83}
84
85