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

/// Request payload for creating a generic xRegistry Resource entity along with its default Version.
#[derive(Serialize, Deserialize, Debug, Clone, Builder)]
pub struct CreateResourceRequestPayload {
    /// 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>,

    /// The attributes needed to create the Resource Meta (its `meta` sub-entity).
    pub meta: ResourceMetaAttributes,

    /// The attributes of the Resource's default Version, which will be created along side this Resource.
    #[serde(rename = "defaultVersion")]
    pub default_version: VersionAttributes,

    /// Version identifier for the Resource's default Version, which is created along with this Resource. If omitted, the server determines the versionId.
    #[serde(rename = "defaultVersionId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[builder(default = "None")]
    pub default_version_id: Option<String>,

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