/* 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::label::Label;

/// Attributes needed to create a Version.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct VersionAttributes {
    /// Human-readable name.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub name: Option<String>,

    /// A human-readable summary of the purpose of the entity.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub description: Option<String>,

    /// A URL to additional information about this entity.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub documentation: Option<String>,

    /// A URL to a graphical icon for the owning entity.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub icon: Option<String>,

    /// Queryable Key Value pairs to be added to the Version.
    #[builder(default)]
    pub labels: Vec<Label>,

    /// The versionId of this Version's ancestor if it has an ancestor.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub ancestor: Option<String>,

    /// Content type of the Version document.
    #[serde(rename = "contentType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub content_type: Option<String>,

    /// Format identifier of the Version document (resource-type-specific, e.g. `JsonSchema/draft-07`, `JSON-LD/1.1`).
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub format: Option<String>,

    /// Base64-encoded document content for the Version. The interpretation (schema, thing description, thing model, etc.) is determined by the Resource type.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub document: Option<Bytes>,

    /// Extension-specific attributes.
    #[builder(default)]
    pub extensions: HashMap<String, Bytes>,
}
