use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Board {
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Card {
pub id: String,
pub name: String,
#[serde(default)]
pub desc: String,
#[serde(rename = "idList")]
pub id_list: String,
#[serde(rename = "idBoard")]
pub id_board: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct List {
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Label {
pub id: String,
#[serde(default)]
pub name: String,
#[serde(default)]
pub color: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Action {
pub id: String,
#[serde(rename = "type")]
pub action_type: String,
pub date: String,
#[serde(rename = "idMemberCreator")]
pub id_member_creator: String,
#[serde(rename = "memberCreator")]
pub member_creator: ActionMember,
pub data: ActionData,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActionData {
#[serde(default)]
pub text: String,
#[serde(default)]
pub card: Option<ActionCard>,
#[serde(default)]
pub board: Option<ActionBoard>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActionCard {
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActionBoard {
pub id: String,
pub name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActionMember {
pub id: String,
pub username: String,
#[serde(rename = "fullName", default)]
pub full_name: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CardDetail {
pub id: String,
pub name: String,
#[serde(default)]
pub desc: String,
#[serde(rename = "idList")]
pub id_list: String,
#[serde(rename = "idBoard")]
pub id_board: String,
#[serde(default)]
pub due: Option<String>,
#[serde(rename = "dueComplete", default)]
pub due_complete: bool,
#[serde(default)]
pub closed: bool,
#[serde(default)]
pub labels: Vec<Label>,
#[serde(rename = "idMembers", default)]
pub id_members: Vec<String>,
#[serde(default)]
pub checklists: Vec<Checklist>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Checklist {
pub id: String,
pub name: String,
#[serde(rename = "checkItems", default)]
pub check_items: Vec<ChecklistItem>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChecklistItem {
pub id: String,
pub name: String,
pub state: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct SearchResult {
#[serde(default)]
pub cards: Vec<Card>,
#[serde(default)]
pub boards: Vec<Board>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CardAttachment {
pub id: String,
pub name: String,
#[serde(rename = "mimeType", default)]
pub mime_type: String,
#[serde(default)]
pub url: Option<String>,
#[serde(rename = "isUpload", default)]
pub is_upload: bool,
#[serde(default)]
pub bytes: Option<i64>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Notification {
pub id: String,
#[serde(rename = "type")]
pub notification_type: String,
pub date: String,
#[serde(default)]
pub unread: bool,
pub data: NotificationData,
#[serde(rename = "memberCreator", default)]
pub member_creator: Option<ActionMember>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct NotificationData {
#[serde(default)]
pub text: Option<String>,
#[serde(default)]
pub card: Option<ActionCard>,
#[serde(default)]
pub board: Option<ActionBoard>,
#[serde(default)]
pub list: Option<ActionCard>, }