/* 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::resource_meta::ResourceMeta;
use super::version::Version;

/// Resource entity
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct Resource {
    /// Resource identifier.
    pub id: String,

    /// Full XID path.
    pub xid: String,

    /// An object that contains most of the Resource-level attributes.
    pub meta: ResourceMeta,

    /// A specific Version of a Resource.
    #[serde(rename = "defaultVersion")]
    pub default_version: Version,

    /// The number of Versions contained on the Resource.
    #[serde(rename = "versionsCount")]
    pub versions_count: u64,

    /// Extension-specific attributes (e.g., `format` and `content_type` for schemas).
    #[builder(default)]
    pub extensions: HashMap<String, Bytes>,
}
