proxmox_api/generated/access/
password.rs

1pub struct PasswordClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> PasswordClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/password"),
13        }
14    }
15}
16impl<T> PasswordClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Change user password."]
21    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.put(&path, &params)
24    }
25}
26impl PutParams {
27    pub fn new(password: String, userid: String) -> Self {
28        Self {
29            password,
30            userid,
31            confirmation_password: Default::default(),
32            additional_properties: Default::default(),
33        }
34    }
35}
36#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
37pub struct PutParams {
38    #[serde(rename = "confirmation-password")]
39    #[serde(skip_serializing_if = "Option::is_none", default)]
40    #[doc = "The current password of the user performing the change."]
41    pub confirmation_password: Option<String>,
42    #[doc = "The new password."]
43    pub password: String,
44    #[doc = "Full User ID, in the `name@realm` format."]
45    pub userid: String,
46    #[serde(
47        flatten,
48        default,
49        skip_serializing_if = "::std::collections::HashMap::is_empty"
50    )]
51    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
52}