mod backups;
mod batch;
mod classification;
mod meta;
mod modules;
mod nodes;
mod objects;
mod oidc;
mod schema;
pub use self::backups::_Backups;
pub use self::batch::_Batch;
pub use self::classification::_Classification;
pub use self::meta::_Meta;
pub use self::modules::_Modules;
pub use self::nodes::_Nodes;
pub use self::objects::_Objects;
pub use self::oidc::_OIDC;
pub use self::schema::Schema;
use reqwest::Url;
use std::error::Error;
pub struct Client {
pub base_url: Url,
pub schema: Schema,
pub objects: _Objects,
pub batch: _Batch,
pub backups: _Backups,
pub classification: _Classification,
pub meta: _Meta,
pub nodes: _Nodes,
pub oidc: _OIDC,
pub modules: _Modules,
}
impl Client {
pub fn new(url: &str) -> Result<Self, Box<dyn Error>> {
let base = Url::parse(url)?;
let schema = Schema::new(&base)?;
let objects = _Objects::new(&base)?;
let batch = _Batch::new(&base)?;
let backups = _Backups::new(&base)?;
let classification = _Classification::new(&base)?;
let meta = _Meta::new(&base)?;
let nodes = _Nodes::new(&base)?;
let oidc = _OIDC::new(&base)?;
let modules = _Modules::new(&base)?;
Ok(Client {
base_url: base,
schema,
objects,
batch,
backups,
classification,
meta,
nodes,
oidc,
modules,
})
}
}
#[cfg(test)]
mod tests {
}