/* Code generated by Azure.Iot.Operations.ProtocolCompilerLib v0.10.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_code::SchemaRegistryErrorCode;
use super::schema_registry_error_details::SchemaRegistryErrorDetails;
use super::schema_registry_error_target::SchemaRegistryErrorTarget;

/// 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: SchemaRegistryErrorCode,

    /// 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<SchemaRegistryErrorTarget>,
}
