use new api updater features

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-08-12 09:30:41 +02:00
committed by Wolfgang Bumiller
parent be5b468975
commit a8a20e9210
10 changed files with 164 additions and 173 deletions

View File

@ -30,7 +30,7 @@ use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use proxmox::api::api;
use proxmox::api::schema::{ApiStringFormat, Schema, StringSchema};
use proxmox::api::schema::{ApiStringFormat, Schema, StringSchema, Updatable};
use proxmox::const_regex;
// we only allow a limited set of characters
@ -403,6 +403,12 @@ pub struct Userid {
name_len: usize,
}
impl Updatable for Userid {
type Updater = Option<Userid>;
const UPDATER_IS_OPTION: bool = true;
}
impl Userid {
pub const API_SCHEMA: Schema = StringSchema::new("User ID")
.format(&PROXMOX_USER_ID_FORMAT)