Skip to main content

proxmox_api/generated/nodes/node/
hardware.rs

1pub mod pci;
2pub mod usb;
3#[derive(Debug, Clone)]
4pub struct HardwareClient<T> {
5    client: T,
6    path: String,
7}
8impl<T> HardwareClient<T>
9where
10    T: crate::client::Client,
11{
12    pub fn new(client: T, parent_path: &str) -> Self {
13        Self {
14            client,
15            path: format!("{}{}", parent_path, "/hardware"),
16        }
17    }
18}
19impl<T> HardwareClient<T>
20where
21    T: crate::client::Client,
22{
23    #[doc = "Index of hardware types"]
24    #[doc = ""]
25    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
26        let path = self.path.to_string();
27        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
28        Ok(optional_vec.unwrap_or_default())
29    }
30}
31impl GetOutputItems {
32    pub fn new(ty: String) -> Self {
33        Self {
34            ty,
35            additional_properties: ::std::default::Default::default(),
36        }
37    }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct GetOutputItems {
41    #[serde(rename = "type")]
42    pub ty: String,
43    #[serde(
44        flatten,
45        default,
46        skip_serializing_if = "::std::collections::HashMap::is_empty"
47    )]
48    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
49}
50impl<T> HardwareClient<T>
51where
52    T: crate::client::Client,
53{
54    pub fn pci(&self) -> pci::PciClient<T> {
55        pci::PciClient::<T>::new(self.client.clone(), &self.path)
56    }
57}
58impl<T> HardwareClient<T>
59where
60    T: crate::client::Client,
61{
62    pub fn usb(&self) -> usb::UsbClient<T> {
63        usb::UsbClient::<T>::new(self.client.clone(), &self.path)
64    }
65}