Skip to main content

devboy_yougile/
types.rs

1//! Shared YouGile wire and helper types.
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6/// Board descriptor used by the YouGile provider.
7#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
8pub struct YouGileBoardRef {
9    pub id: String,
10    pub title: String,
11}
12
13/// Column descriptor used by the YouGile provider.
14#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
15pub struct YouGileColumnRef {
16    pub id: String,
17    pub title: String,
18    #[serde(default)]
19    pub board_id: Option<String>,
20}
21
22#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
23pub struct YouGilePaging {
24    pub limit: u32,
25    pub offset: u32,
26    pub next: bool,
27}
28
29#[derive(Debug, Clone, Deserialize, PartialEq)]
30pub struct YouGileListResponse<T> {
31    pub paging: YouGilePaging,
32    pub content: Vec<T>,
33}
34
35#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
36pub struct YouGileColumn {
37    pub id: String,
38    pub title: String,
39    #[serde(rename = "boardId")]
40    pub board_id: String,
41    #[serde(default)]
42    pub deleted: bool,
43}
44
45#[derive(Debug, Clone, Deserialize, PartialEq)]
46pub struct YouGileTask {
47    pub id: String,
48    pub title: String,
49    pub timestamp: u64,
50    #[serde(rename = "columnId")]
51    pub column_id: Option<String>,
52    #[serde(default)]
53    pub description: Option<String>,
54    #[serde(default)]
55    pub archived: bool,
56    #[serde(default)]
57    pub completed: bool,
58    #[serde(default)]
59    pub deleted: bool,
60    #[serde(default, rename = "subtasks")]
61    pub subtask_ids: Vec<String>,
62    #[serde(default, rename = "assigned")]
63    pub assigned_ids: Vec<String>,
64    #[serde(default, rename = "createdBy")]
65    pub created_by: Option<String>,
66    #[serde(default, rename = "idTaskCommon")]
67    pub id_task_common: Option<String>,
68    #[serde(default, rename = "idTaskProject")]
69    pub id_task_project: Option<String>,
70    #[serde(default)]
71    pub stickers: Option<Value>,
72}
73
74#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
75pub struct YouGileUser {
76    pub id: String,
77    pub email: String,
78    #[serde(rename = "realName")]
79    pub real_name: String,
80}
81
82#[derive(Debug, Clone, Deserialize, PartialEq)]
83pub struct YouGileChatMessage {
84    pub id: u64,
85    #[serde(rename = "fromUserId")]
86    pub from_user_id: String,
87    pub text: String,
88    #[serde(default, rename = "textHtml")]
89    pub text_html: Option<String>,
90    #[serde(default)]
91    pub label: String,
92    #[serde(rename = "editTimestamp")]
93    pub edit_timestamp: u64,
94    #[serde(default)]
95    pub deleted: bool,
96}