proxmox_api/generated/nodes/node/sdn/
zones.rs

1pub mod zone;
2pub struct ZonesClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> ZonesClient<T>
7where
8    T: crate::client::Client,
9{
10    pub fn new(client: T, parent_path: &str) -> Self {
11        Self {
12            client,
13            path: format!("{}{}", parent_path, "/zones"),
14        }
15    }
16}
17impl<T> ZonesClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Get status for all zones."]
22    pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23        let path = self.path.to_string();
24        self.client.get(&path, &())
25    }
26}
27impl GetOutputItems {
28    pub fn new(status: Status, zone: String) -> Self {
29        Self {
30            status,
31            zone,
32            additional_properties: Default::default(),
33        }
34    }
35}
36#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
37pub struct GetOutputItems {
38    #[doc = "Status of zone"]
39    pub status: Status,
40    #[doc = "The SDN zone object identifier."]
41    pub zone: String,
42    #[serde(
43        flatten,
44        default,
45        skip_serializing_if = "::std::collections::HashMap::is_empty"
46    )]
47    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
48}
49#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
50pub enum Status {
51    #[serde(rename = "available")]
52    Available,
53    #[serde(rename = "error")]
54    Error,
55    #[serde(rename = "pending")]
56    Pending,
57}
58impl<T> ZonesClient<T>
59where
60    T: crate::client::Client,
61{
62    pub fn zone(&self, zone: &str) -> zone::ZoneClient<T> {
63        zone::ZoneClient::<T>::new(self.client.clone(), &self.path, zone)
64    }
65}