trello-to-deck/src/nextcloud/model.rs
Paul Campbell 0e123898db
Some checks failed
Test / build (map[name:nightly]) (push) Successful in 1m59s
Test / build (map[name:stable]) (push) Successful in 2m18s
Release Please / Release-plz (push) Failing after 13s
feat: split into actors
2024-12-22 14:28:51 +00:00

178 lines
3.1 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,
Hash,
PartialOrd,
Ord,
kameo::Reply,
"ID of a Nextcloud Label"
);
newtype!(
NextcloudLabelTitle,
String,
Display,
Hash,
PartialOrd,
Ord,
"Title of a Nextcloud Label"
);
newtype!(
NextcloudLabelColour,
String,
Display,
Hash,
PartialOrd,
Ord,
"Colour 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,
Display,
PartialOrd,
Ord,
"Title of the Board"
);
newtype!(
NextcloudBoardColour,
String,
PartialOrd,
Ord,
"Colour of the Board"
);
newtype!(
NextcloudStackTitle,
String,
Display,
PartialOrd,
Ord,
"Title of the Stack"
);
newtype!(
NextcloudCardTitle,
String,
Display,
PartialOrd,
Ord,
"Title of the Card"
);
newtype!(
NextcloudCardDescription,
String,
Display,
PartialOrd,
Ord,
"Description of the Card"
);
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Board {
pub(crate) id: NextcloudBoardId,
pub(crate) title: NextcloudBoardTitle,
pub(crate) labels: Vec<Label>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Stack {
pub(crate) id: NextcloudStackId,
pub(crate) title: NextcloudStackTitle,
pub(crate) order: NextcloudOrder,
#[serde(default)]
pub(crate) cards: Vec<Card>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Card {
pub(crate) id: NextcloudCardId,
pub(crate) title: NextcloudCardTitle,
pub(crate) order: NextcloudOrder,
}
#[derive(Clone, Debug, Serialize, Deserialize, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Label {
pub(crate) id: NextcloudLabelId,
pub(crate) title: NextcloudLabelTitle,
pub(crate) color: NextcloudLabelColour,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) struct Attachment {
pub(crate) id: i64,
#[serde(rename = "type")]
pub(crate) attachment_type: String,
}