pub mod id;
pub struct MgrClient<T> {
client: T,
path: String,
}
impl<T> MgrClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str) -> Self {
Self {
client,
path: format!("{}{}", parent_path, "/mgr"),
}
}
}
impl<T> MgrClient<T>
where
T: crate::client::Client,
{
#[doc = "MGR directory index."]
pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
let path = self.path.to_string();
self.client.get(&path, &())
}
}
impl GetOutputItems {
pub fn new(state: String) -> Self {
Self {
state,
addr: Default::default(),
host: Default::default(),
additional_properties: Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub addr: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub host: Option<String>,
#[doc = "State of the MGR"]
pub state: String,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl<T> MgrClient<T>
where
T: crate::client::Client,
{
pub fn id(&self, id: &str) -> id::IdClient<T> {
id::IdClient::<T>::new(self.client.clone(), &self.path, id)
}
}