1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* enbbox API
*
* Notification infrastructure API — open-source alternative to Novu/Courier
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ErrorDetail : RFC 7807 Problem Details — a machine-readable error response with a URI type, human-readable title, and optional detail.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ErrorDetail {
/// Detail: a string for simple errors, or an array of `{loc, msg, type}` for validation errors.
#[serde(rename = "detail", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub detail: Option<Option<models::DetailValue>>,
/// A unique URI identifying this specific occurrence (e.g. trace ID), useful for support.
#[serde(rename = "instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub instance: Option<Option<String>>,
/// A short, human-readable summary of the error type.
#[serde(rename = "title")]
pub title: String,
/// A URI identifier for the error type, linking to documentation.
#[serde(rename = "type")]
pub r#type: String,
}
impl ErrorDetail {
/// RFC 7807 Problem Details — a machine-readable error response with a URI type, human-readable title, and optional detail.
pub fn new(title: String, r#type: String) -> ErrorDetail {
ErrorDetail {
detail: None,
instance: None,
title,
r#type,
}
}
}