169 lines
3 KiB
Rust
169 lines
3 KiB
Rust
|
use derive_more::derive::Display;
|
||
|
//
|
||
|
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,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
"Title of the Board"
|
||
|
);
|
||
|
newtype!(
|
||
|
NextcloudBoardOwner,
|
||
|
String,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
"Owner of the Board"
|
||
|
);
|
||
|
newtype!(
|
||
|
NextcloudBoardColour,
|
||
|
String,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
"Colour of the Board"
|
||
|
);
|
||
|
|
||
|
newtype!(
|
||
|
NextcloudStackTitle,
|
||
|
String,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
"Title of the Stack"
|
||
|
);
|
||
|
newtype!(
|
||
|
NextcloudCardTitle,
|
||
|
String,
|
||
|
PartialOrd,
|
||
|
Ord,
|
||
|
"Title of the Card"
|
||
|
);
|
||
|
|
||
|
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
|
||
|
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,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||
|
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,
|
||
|
pub due_date: Option<String>,
|
||
|
pub labels: Vec<NextcloudLabelId>,
|
||
|
}
|
||
|
|
||
|
#[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,
|
||
|
}
|