Skip to main content

proxmox_api/generated/nodes/node/scan/
cifs.rs

1#[derive(Debug, Clone)]
2pub struct CifsClient<T> {
3    client: T,
4    path: String,
5}
6impl<T> CifsClient<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, "/cifs"),
14        }
15    }
16}
17impl<T> CifsClient<T>
18where
19    T: crate::client::Client,
20{
21    #[doc = "Scan remote CIFS server."]
22    #[doc = ""]
23    #[doc = "Permission check: perm(\"/storage\", [\"Datastore.Allocate\"])"]
24    pub async fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
25        let path = self.path.to_string();
26        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &params).await?;
27        Ok(optional_vec.unwrap_or_default())
28    }
29}
30impl GetOutputItems {
31    pub fn new(description: String, share: String) -> Self {
32        Self {
33            description,
34            share,
35            additional_properties: ::std::default::Default::default(),
36        }
37    }
38}
39#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
40pub struct GetOutputItems {
41    #[doc = "Descriptive text from server."]
42    #[doc = ""]
43    pub description: String,
44    #[doc = "The cifs share name."]
45    #[doc = ""]
46    pub share: String,
47    #[serde(
48        flatten,
49        default,
50        skip_serializing_if = "::std::collections::HashMap::is_empty"
51    )]
52    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}
54impl GetParams {
55    pub fn new(server: String) -> Self {
56        Self {
57            server,
58            domain: ::std::default::Default::default(),
59            password: ::std::default::Default::default(),
60            username: ::std::default::Default::default(),
61            additional_properties: ::std::default::Default::default(),
62        }
63    }
64}
65#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
66pub struct GetParams {
67    #[serde(skip_serializing_if = "Option::is_none", default)]
68    #[doc = "SMB domain (Workgroup)."]
69    #[doc = ""]
70    pub domain: Option<String>,
71    #[serde(skip_serializing_if = "Option::is_none", default)]
72    #[doc = "User password."]
73    #[doc = ""]
74    pub password: Option<String>,
75    #[doc = "The server address (name or IP)."]
76    #[doc = ""]
77    pub server: String,
78    #[serde(skip_serializing_if = "Option::is_none", default)]
79    #[doc = "User name."]
80    #[doc = ""]
81    pub username: Option<String>,
82    #[serde(
83        flatten,
84        default,
85        skip_serializing_if = "::std::collections::HashMap::is_empty"
86    )]
87    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
88}