#[derive(Debug, serde::Serialize)]
pub struct Service {
pub workspace: Workspace,
#[serde(rename = "@xml:base")]
pub base_url: String,
#[serde(rename = "@xmlns")]
pub ns: String,
#[serde(rename = "@xmlns:atom")]
pub ns_atom: String,
}
impl Service {
pub fn new(base_url: String, workspace: Workspace) -> Self {
Self {
workspace,
base_url,
ns: "http://www.w3.org/2007/app".to_string(),
ns_atom: "http://www.w3.org/2005/Atom".to_string(),
}
}
}
#[derive(Debug, serde::Serialize)]
pub struct Workspace {
#[serde(rename = "atom:title")]
pub title: String,
#[serde(rename = "collection")]
pub collections: Vec<Collection>,
}
#[derive(Debug, serde::Serialize)]
pub struct Collection {
#[serde(rename = "@href")]
pub href: String,
#[serde(rename = "atom:title")]
pub title: String,
}