enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * 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,
        }
    }
}