2024-11-30 11:30:36 +00:00
|
|
|
//
|
2024-12-04 19:37:39 +00:00
|
|
|
use derive_more::derive::Display;
|
2024-11-30 11:30:36 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
use crate::newtype;
|
|
|
|
|
|
|
|
newtype!(
|
|
|
|
NextcloudHostname,
|
|
|
|
String,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Hostname of the Nextcloud server"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudUsername,
|
|
|
|
String,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Username to authenticate as"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudPassword,
|
|
|
|
String,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Password to authenticate with"
|
|
|
|
);
|
|
|
|
|
|
|
|
newtype!(
|
|
|
|
NextcloudBoardId,
|
|
|
|
i64,
|
|
|
|
Copy,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"ID of a Nextcloud Board"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudStackId,
|
|
|
|
i64,
|
|
|
|
Copy,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"ID of a Nextcloud Stack"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudCardId,
|
|
|
|
i64,
|
|
|
|
Copy,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"ID of a Nextcloud Card"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudLabelId,
|
|
|
|
i64,
|
|
|
|
Copy,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"ID of a Nextcloud Label"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudOrder,
|
|
|
|
i64,
|
|
|
|
Copy,
|
|
|
|
Display,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Relative position of the item amongst its peers"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudETag,
|
|
|
|
String,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"ETag for a resource"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudBoardTitle,
|
|
|
|
String,
|
2024-12-04 19:37:39 +00:00
|
|
|
Display,
|
2024-11-30 11:30:36 +00:00
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Title of the Board"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudBoardColour,
|
|
|
|
String,
|
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Colour of the Board"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudStackTitle,
|
|
|
|
String,
|
2024-11-30 18:04:48 +00:00
|
|
|
Display,
|
2024-11-30 11:30:36 +00:00
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Title of the Stack"
|
|
|
|
);
|
|
|
|
newtype!(
|
|
|
|
NextcloudCardTitle,
|
|
|
|
String,
|
2024-11-30 18:04:48 +00:00
|
|
|
Display,
|
2024-11-30 11:30:36 +00:00
|
|
|
PartialOrd,
|
|
|
|
Ord,
|
|
|
|
"Title of the Card"
|
|
|
|
);
|
|
|
|
|
2024-11-29 14:31:40 +00:00
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
2024-12-04 19:37:39 +00:00
|
|
|
pub struct NextcloudBoardOwner {
|
|
|
|
#[serde(rename = "primaryKey")]
|
|
|
|
pub primary_key: String,
|
|
|
|
pub uid: String,
|
|
|
|
#[serde(rename = "displayname")]
|
|
|
|
pub display_name: String,
|
|
|
|
}
|
|
|
|
|
2024-11-29 14:31:40 +00:00
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
2024-11-30 11:30:36 +00:00
|
|
|
pub struct Board {
|
|
|
|
pub id: NextcloudBoardId,
|
|
|
|
pub title: NextcloudBoardTitle,
|
|
|
|
pub owner: NextcloudBoardOwner,
|
|
|
|
pub color: NextcloudBoardColour,
|
|
|
|
pub archived: bool,
|
|
|
|
pub labels: Vec<Label>,
|
|
|
|
pub acl: Vec<Acl>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
|
|
|
pub struct Stack {
|
|
|
|
pub id: NextcloudStackId,
|
|
|
|
pub title: NextcloudStackTitle,
|
|
|
|
pub order: NextcloudOrder,
|
|
|
|
#[serde(rename = "boardId")]
|
|
|
|
pub board_id: NextcloudBoardId,
|
|
|
|
#[serde(rename = "ETag")]
|
|
|
|
pub etag: NextcloudETag,
|
2024-11-30 18:04:48 +00:00
|
|
|
#[serde(default)]
|
|
|
|
pub cards: Vec<Card>,
|
2024-11-30 11:30:36 +00:00
|
|
|
}
|
|
|
|
|
2024-11-30 18:04:48 +00:00
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
2024-11-30 11:30:36 +00:00
|
|
|
pub struct Card {
|
|
|
|
pub id: NextcloudCardId,
|
|
|
|
pub title: NextcloudCardTitle,
|
|
|
|
pub description: Option<String>,
|
|
|
|
#[serde(rename = "stackId")]
|
|
|
|
pub stack_id: NextcloudStackId,
|
|
|
|
pub order: NextcloudOrder,
|
|
|
|
pub archived: bool,
|
2024-11-30 18:04:48 +00:00
|
|
|
#[serde(default)]
|
2024-11-30 11:30:36 +00:00
|
|
|
pub due_date: Option<String>,
|
2024-11-30 18:04:48 +00:00
|
|
|
#[serde(default)]
|
2024-11-29 14:31:40 +00:00
|
|
|
pub labels: Option<Vec<Label>>,
|
2024-11-30 11:30:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
|
|
|
pub struct Label {
|
|
|
|
pub id: NextcloudLabelId,
|
|
|
|
pub title: String,
|
|
|
|
pub color: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
|
|
|
pub struct Acl {
|
|
|
|
pub participant: String,
|
|
|
|
pub permission_edit: bool,
|
|
|
|
pub permission_share: bool,
|
|
|
|
pub permission_manage: bool,
|
|
|
|
}
|