// Code generated by oagen. DO NOT EDIT.

#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PrimitiveError {
    /// Machine-readable error code.
    pub code: String,
    /// Human-readable error message.
    pub message: String,
    /// Optional structured error context.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub details: Option<std::collections::HashMap<String, serde_json::Value>>,
}
impl PrimitiveError {
    /// Construct a new `PrimitiveError` with the required fields set.
    #[allow(deprecated)]
    pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self {
        Self {
            code: code.into(),
            message: message.into(),
            details: Default::default(),
        }
    }
}
