/* 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;
use super::version_attributes::VersionAttributes;

/// Request payload for creating a generic xRegistry Version entity. The parent Resource is implicitly created if it doesn't already exist. Create is strictly idempotent: if every field matches the latest Version of the parent Resource (including labels), the latest Version is returned; otherwise a new Version is created.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct CreateVersionRequestPayload {
    /// Group identifier. Uses the default if not specified.
    #[serde(rename = "groupId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub group_id: Option<String>,

    /// Version identifier of the Version to create. If omitted, the server determines the versionId.
    #[serde(rename = "versionId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub version_id: Option<String>,

    /// The attributes of the Version to create.
    pub version: VersionAttributes,

    /// Queryable Key Value pairs to be added to the parent Resource. The parent Resource is implicitly created if it doesn't already exist.
    #[serde(rename = "resourceLabels")]
    #[builder(default)]
    pub resource_labels: Vec<Label>,
}
