proxmox_api/generated/cluster/mapping/pci/
id.rs

1pub struct IdClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> IdClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str, id: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}/{}", parent_path, id),
13        }
14    }
15}
16impl<T> IdClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Remove Hardware Mapping."]
21    pub fn delete(&self) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &())
24    }
25}
26impl<T> IdClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Get PCI Mapping."]
31    pub fn get(&self) -> Result<GetOutput, T::Error> {
32        let path = self.path.to_string();
33        self.client.get(&path, &())
34    }
35}
36impl<T> IdClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update a hardware mapping."]
41    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42        let path = self.path.to_string();
43        self.client.put(&path, &params)
44    }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct GetOutput {
48    #[serde(
49        flatten,
50        default,
51        skip_serializing_if = "::std::collections::HashMap::is_empty"
52    )]
53    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
54}
55#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
56pub struct PutParams {
57    #[serde(skip_serializing_if = "Option::is_none", default)]
58    #[doc = "A list of settings you want to delete."]
59    pub delete: Option<String>,
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    #[doc = "Description of the logical PCI device."]
62    pub description: Option<String>,
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
65    pub digest: Option<String>,
66    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
67    #[doc = "A list of maps for the cluster nodes."]
68    pub map: Vec<String>,
69    #[serde(
70        serialize_with = "crate::types::serialize_bool_optional",
71        deserialize_with = "crate::types::deserialize_bool_optional"
72    )]
73    #[serde(skip_serializing_if = "Option::is_none", default)]
74    pub mdev: Option<bool>,
75    #[serde(
76        flatten,
77        default,
78        skip_serializing_if = "::std::collections::HashMap::is_empty"
79    )]
80    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
81}