/* 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::format::Format;
use super::schema_type::SchemaType;

/// Schema object
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct Schema {
    /// Human-readable description of the schema.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub description: Option<String>,

    /// Human-readable display name.
    #[serde(rename = "displayName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub display_name: Option<String>,

    /// Format of the schema.
    pub format: Format,

    /// Hash of the schema content.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub hash: Option<String>,

    /// Schema name.
    pub name: String,

    /// Schema registry namespace. Uniquely identifies a schema registry within a tenant.
    pub namespace: String,

    /// Content stored in the schema.
    #[serde(rename = "schemaContent")]
    pub schema_content: String,

    /// Type of the schema.
    #[serde(rename = "schemaType")]
    pub schema_type: SchemaType,

    /// Schema tags.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub tags: Option<HashMap<String, String>>,

    /// Version of the schema. Allowed between 0-9.
    pub version: String,
}
