clientapi_pve/models/pve_error.rs
1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PveError : Proxmox VE error envelope. Returned for all 4xx/5xx responses. `message` is always populated; `errors` is populated for validation failures with one entry per offending parameter.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PveError {
17
18 #[serde(rename = "data", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub data: Option<Option<serde_json::Value>>,
20
21 #[serde(rename = "message")]
22 pub message: String,
23
24 #[serde(rename = "errors", skip_serializing_if = "Option::is_none")]
25 pub errors: Option<std::collections::HashMap<String, String>>,
26
27
28}
29
30impl PveError {
31 /// Proxmox VE error envelope. Returned for all 4xx/5xx responses. `message` is always populated; `errors` is populated for validation failures with one entry per offending parameter.
32 pub fn new(message: String) -> PveError {
33 PveError {
34
35 data: None,
36
37 message,
38
39 errors: None,
40
41 }
42 }
43}
44
45