forked from proxmox-mirrors/proxmox
notify: use builder for ObjectSchema
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3c34ef5573
commit
4378d44bcb
@ -17,15 +17,14 @@ const PBS_NODE_CFG_FILENAME: &str = "/etc/proxmox-backup/node.cfg";
|
|||||||
// it with the less restrictive schema should be enough for the purpose of getting the mail address.
|
// it with the less restrictive schema should be enough for the purpose of getting the mail address.
|
||||||
const DUMMY_ID_SCHEMA: Schema = StringSchema::new("dummy ID").min_length(3).schema();
|
const DUMMY_ID_SCHEMA: Schema = StringSchema::new("dummy ID").min_length(3).schema();
|
||||||
const DUMMY_EMAIL_SCHEMA: Schema = StringSchema::new("dummy email").schema();
|
const DUMMY_EMAIL_SCHEMA: Schema = StringSchema::new("dummy email").schema();
|
||||||
const DUMMY_USER_SCHEMA: ObjectSchema = ObjectSchema {
|
const DUMMY_USER_SCHEMA: ObjectSchema = ObjectSchema::new(
|
||||||
description: "minimal PBS user",
|
"minimal PBS user",
|
||||||
properties: &[
|
&[
|
||||||
("userid", false, &DUMMY_ID_SCHEMA),
|
("userid", false, &DUMMY_ID_SCHEMA),
|
||||||
("email", true, &DUMMY_EMAIL_SCHEMA),
|
("email", true, &DUMMY_EMAIL_SCHEMA),
|
||||||
],
|
],
|
||||||
additional_properties: true,
|
)
|
||||||
default_key: None,
|
.additional_properties(true);
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct DummyPbsUser {
|
struct DummyPbsUser {
|
||||||
|
Loading…
Reference in New Issue
Block a user