/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v1.0.0.0; DO NOT EDIT. */
#![allow(unused_imports)]

use std::collections::HashMap;

use chrono::{DateTime, Utc};
use derive_builder::Builder;
use iso8601_duration::Duration;
use serde::{Deserialize, Serialize};
use uuid::Uuid;

use super::super::common_types::{b64::Bytes, date_only::Date, decimal::Decimal, time_only::Time};
use super::schema_registry_error_details::SchemaRegistryErrorDetails;

/// Error object for schema operations
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct SchemaRegistryError {
    /// Error code for classification of errors (ex: '400', '404', '500', etc.).
    pub code: i32,

    /// Additional details about the error, if available.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub details: Option<SchemaRegistryErrorDetails>,

    /// Inner error object for nested errors, if applicable.
    #[serde(rename = "innerError")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub inner_error: Option<SchemaRegistryErrorDetails>,

    /// Human-readable error message.
    pub message: String,

    /// Target of the error, if applicable (e.g., 'schemaType').
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub target: Option<String>,
}
