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

/// BulkWritableVirtualMachineRequest : 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 BulkWritableVirtualMachineRequest {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[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>>>,
    /// Override the software image files associated with the software version for this virtual machine
    #[serde(
        rename = "software_image_files",
        skip_serializing_if = "Option::is_none"
    )]
    pub software_image_files: Option<Vec<crate::models::SoftwareImageFiles>>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>>,
    #[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,
        >,
    >,
}

impl BulkWritableVirtualMachineRequest {
    /// 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(
        id: uuid::Uuid,
        name: String,
        cluster: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> BulkWritableVirtualMachineRequest {
        BulkWritableVirtualMachineRequest {
            id,
            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,
            software_image_files: None,
            tags: None,
            custom_fields: None,
            relationships: None,
        }
    }
}