proxmox_api/generated/cluster/mapping/usb/
id.rs1pub 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 USB 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, ¶ms)
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}
55impl PutParams {
56 pub fn new(map: Vec<String>) -> Self {
57 Self {
58 map,
59 delete: Default::default(),
60 description: Default::default(),
61 digest: Default::default(),
62 additional_properties: Default::default(),
63 }
64 }
65}
66#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
67pub struct PutParams {
68 #[serde(skip_serializing_if = "Option::is_none", default)]
69 #[doc = "A list of settings you want to delete."]
70 pub delete: Option<String>,
71 #[serde(skip_serializing_if = "Option::is_none", default)]
72 #[doc = "Description of the logical USB device."]
73 pub description: Option<String>,
74 #[serde(skip_serializing_if = "Option::is_none", default)]
75 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
76 pub digest: Option<String>,
77 #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
78 #[doc = "A list of maps for the cluster nodes."]
79 pub map: Vec<String>,
80 #[serde(
81 flatten,
82 default,
83 skip_serializing_if = "::std::collections::HashMap::is_empty"
84 )]
85 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
86}