1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
use serde::{Serialize, Deserialize};
use uuid::Uuid;

/// Чат не найден
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChatNotFoundWithEventId {
    /// id сообщения 
    pub sync_id: Uuid,

    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: ChatNotFoundWithEventIdData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChatNotFoundWithEventIdData {
    /// id не найденного чата 
    pub group_chat_id: Uuid,

    /// Описание ошибки
    pub error_description: String,
}

/// Чат не найден
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChatNotFound {
    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: ChatNotFoundData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ChatNotFoundData {
    /// id не найденного чата 
    pub group_chat_id: Uuid,

    /// Описание ошибки
    pub error_description: String,
}

/// Ошибка от Messaging сервиса
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ErrorFromMessagingServiceWithEventId {
    /// id сообщения 
    pub sync_id: Uuid,

    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: ErrorFromMessagingServiceWithEventIdData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ErrorFromMessagingServiceWithEventIdData {
    /// id чата из события 
    pub group_chat_id: Uuid,

    /// Причина ошибки
    pub reason: String,

    /// Описание ошибки
    pub error_description: String,
}

/// Ошибка от Messaging сервиса
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ErrorFromMessagingService {
    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: ErrorFromMessagingServiceData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ErrorFromMessagingServiceData {
    /// id чата из события 
    pub group_chat_id: Uuid,

    /// Причина ошибки
    pub reason: String,

    /// Описание ошибки
    pub error_description: String,
}

/// Бот отправитель не является участником чата
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BotIsNotAChatMember {
    /// id сообщения 
    pub sync_id: Uuid,

    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: BotIsNotAChatMemberData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct BotIsNotAChatMemberData {
    /// id чата
    pub group_chat_id: Uuid,

    /// id бота отправившего событие
    pub bot_id: Uuid,

    /// Описание ошибки
    pub error_description: String,
}

/// Итоговый список получателей события пуст
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventRecipientsListIsEmpty {
    /// id сообщения 
    pub sync_id: Uuid,

    /// Список ошибок
    pub errors: Vec<String>,

    /// Дополнительная информация об ошибке
    pub error_data: EventRecipientsListIsEmptyData,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct EventRecipientsListIsEmptyData {
    /// id чата из события
    pub group_chat_id: Uuid,

    /// id бота отправившего событие
    pub bot_id: Uuid,

    /// Список получателей
    pub recipients_param: Vec<Uuid>,

    /// Описание ошибки
    pub error_description: String,
}