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
 */

/// VirtualMachine : Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct VirtualMachine {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(rename = "object_type", skip_serializing_if = "Option::is_none")]
    pub object_type: Option<String>,
    /// Human friendly display value
    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
    pub display: Option<String>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "natural_slug", skip_serializing_if = "Option::is_none")]
    pub natural_slug: Option<String>,
    #[serde(
        rename = "local_config_context_data",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data: Option<Option<serde_json::Value>>,
    #[serde(
        rename = "local_config_context_data_owner_object_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data_owner_object_id: Option<Option<uuid::Uuid>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(
        rename = "vcpus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vcpus: Option<Option<i32>>,
    #[serde(
        rename = "memory",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub memory: Option<Option<i32>>,
    #[serde(
        rename = "disk",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub disk: Option<Option<i32>>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(
        rename = "local_config_context_schema",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_schema:
        Option<Option<Box<crate::models::BulkWritableConfigContextRequestConfigContextSchema>>>,
    #[serde(
        rename = "local_config_context_data_owner_content_type",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub local_config_context_data_owner_content_type:
        Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "cluster")]
    pub cluster: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "tenant",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tenant: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "platform",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub platform: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "status")]
    pub status: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "role",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub role: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "primary_ip4",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub primary_ip4: Option<Option<Box<crate::models::PrimaryIpv4>>>,
    #[serde(
        rename = "primary_ip6",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub primary_ip6: Option<Option<Box<crate::models::PrimaryIpv6>>>,
    #[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::BulkWritableVirtualMachineRequestSoftwareVersion>>>,
    #[serde(
        rename = "created",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub created: Option<Option<String>>,
    #[serde(
        rename = "last_updated",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub last_updated: Option<Option<String>>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[serde(rename = "notes_url", skip_serializing_if = "Option::is_none")]
    pub notes_url: Option<String>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl VirtualMachine {
    /// Base class to use for serializers based on OrganizationalModel or PrimaryModel.  Can also be used for models derived from BaseModel, so long as they support custom fields, notes, and relationships.
    pub fn new(
        name: String,
        cluster: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> VirtualMachine {
        VirtualMachine {
            id: None,
            object_type: None,
            display: None,
            url: None,
            natural_slug: None,
            local_config_context_data: None,
            local_config_context_data_owner_object_id: None,
            name,
            vcpus: None,
            memory: None,
            disk: None,
            comments: None,
            local_config_context_schema: None,
            local_config_context_data_owner_content_type: None,
            cluster: Box::new(cluster),
            tenant: None,
            platform: None,
            status: Box::new(status),
            role: None,
            primary_ip4: None,
            primary_ip6: None,
            software_version: None,
            created: None,
            last_updated: None,
            tags: None,
            notes_url: None,
            custom_fields: None,
        }
    }
}