use serde::{Serialize, Deserialize};
use uuid::Uuid;
use crate::api::{models::*};
#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder)]
#[builder(setter(into, prefix = "with", strip_option))]
pub struct InternalNotificationRequest<TData, TOptions> {
pub group_chat_id: Uuid,
pub data: TData,
pub opts: TOptions,
#[builder(default)]
pub recipients: Option<Vec<Uuid>>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct InternalNotificationResponse {
pub result: InternalNotificationResult,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct InternalNotificationResult {
pub sync_id: Uuid,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "reason")]
pub enum InternalNotificationExpressError {
#[serde(rename(serialize = "too_many_requests", deserialize = "too_many_requests"))]
TooManyRequests(TooManyRequests),
#[serde(rename(serialize = "chat_not_found", deserialize = "chat_not_found"))]
ChatNotFound(ChatNotFoundWithEventId),
#[serde(rename(serialize = "error_from_messaging_service", deserialize = "error_from_messaging_service"))]
ErrorFromMessagingService(ErrorFromMessagingServiceWithEventId),
#[serde(rename(serialize = "bot_is_not_a_chat_member", deserialize = "bot_is_not_a_chat_member"))]
BotIsNotAChatMember(BotIsNotAChatMember),
#[serde(rename(serialize = "event_recipients_list_is_empty", deserialize = "event_recipients_list_is_empty"))]
EventRecipientsListIsEmpty(EventRecipientsListIsEmpty),
#[serde(other)]
Other,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TooManyRequests {
pub errors: Vec<String>,
pub error_data: TooManyRequestsData,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct TooManyRequestsData {
pub bot_id: Uuid,
}