Skip to main content

esi_openapi/groups/
mail.rs

1#![allow(unused)]
2
3use crate::prelude::*;
4
5/// Endpoints for Mail
6pub struct MailGroup<'a> {
7    pub(crate) esi: &'a Esi,
8}
9
10#[derive(Debug, Deserialize, Serialize, Clone)]
11/// Information about all mail labels.
12pub struct MailLabels {
13    /// List of individual mail labels.
14    #[serde(default)]
15    pub labels: Vec<MailLabel>,
16    /// Total unread count across all labels.
17    pub total_unread_count: Option<i32>,
18}
19
20#[derive(Debug, Deserialize, Serialize, Clone)]
21/// Information about an individual mail label.
22pub struct MailLabel {
23    /// Color of the label as RGB Hex (`#rrggbb`).
24    pub color: String,
25    /// ID of the label.
26    pub label_id: i32,
27    /// Name of the label.
28    pub name: String,
29    /// Number of unread messages with this label.
30    #[serde(default)]
31    pub unread_count: Option<i32>,
32}
33
34impl MailGroup<'_> {
35    api_get!(
36        /// Return a list of the users mail labels, unread counts for each
37        /// label and a total unread count.
38        get_character_mail_labels,
39        "GetCharactersCharacterIdMailLabels",
40        RequestType::Authenticated,
41        MailLabels,
42        (character_id: i32) => "{character_id}"
43    );
44}