nautobot-openapi 0.4.0

low level nautobot bindings (generated by openapi-generator)
Documentation
/*
 * API Documentation
 *
 * Source of truth and network automation platform
 *
 * The version of the OpenAPI document: 3.1.0 (3.1)
 *
 * Generated by: https://openapi-generator.tech
 */

/// BulkWritableInventoryItemRequest : Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct BulkWritableInventoryItemRequest {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "name")]
    pub name: String,
    /// Physical label
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Manufacturer-assigned part identifier
    #[serde(rename = "part_id", skip_serializing_if = "Option::is_none")]
    pub part_id: Option<String>,
    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
    pub serial: Option<String>,
    /// A unique tag used to identify this item
    #[serde(
        rename = "asset_tag",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub asset_tag: Option<Option<String>>,
    /// This item was automatically discovered
    #[serde(rename = "discovered", skip_serializing_if = "Option::is_none")]
    pub discovered: Option<bool>,
    #[serde(
        rename = "parent",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "device")]
    pub device: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "manufacturer",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub manufacturer: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "software_version",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub software_version:
        Option<Option<Box<crate::models::BulkWritableInventoryItemRequestSoftwareVersion>>>,
    /// Override the software image files associated with the software version for this inventory item
    #[serde(
        rename = "software_image_files",
        skip_serializing_if = "Option::is_none"
    )]
    pub software_image_files: Option<Vec<crate::models::SoftwareImageFiles>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<
        ::std::collections::HashMap<
            String,
            crate::models::ApprovalWorkflowDefinitionRequestRelationshipsValue,
        >,
    >,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
}

impl BulkWritableInventoryItemRequest {
    /// Add a `tree_depth` field to non-nested model serializers based on django-tree-queries.
    pub fn new(
        id: uuid::Uuid,
        name: String,
        device: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> BulkWritableInventoryItemRequest {
        BulkWritableInventoryItemRequest {
            id,
            name,
            label: None,
            description: None,
            part_id: None,
            serial: None,
            asset_tag: None,
            discovered: None,
            parent: None,
            device: Box::new(device),
            manufacturer: None,
            software_version: None,
            software_image_files: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}