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

/// WritableVmInterfaceRequest : 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 WritableVmInterfaceRequest {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    #[serde(
        rename = "mac_address",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mac_address: Option<Option<String>>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(
        rename = "mtu",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mtu: Option<Option<i32>>,
    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
    pub mode: Option<Box<crate::models::PatchedWritableInterfaceRequestMode>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[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 = "parent_interface",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent_interface:
        Option<Option<Box<crate::models::BulkWritableInterfaceRequestParentInterface>>>,
    #[serde(
        rename = "bridge",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub bridge: Option<Option<Box<crate::models::BridgeInterface>>>,
    #[serde(rename = "virtual_machine")]
    pub virtual_machine: Box<crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage>,
    #[serde(
        rename = "untagged_vlan",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub untagged_vlan: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(
        rename = "vrf",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vrf: Option<Option<Box<crate::models::ApprovalWorkflowUser>>>,
    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
    pub tagged_vlans: Option<Vec<crate::models::TaggedVlans>>,
    #[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 WritableVmInterfaceRequest {
    /// 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,
        status: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
        virtual_machine: crate::models::ApprovalWorkflowStageResponseApprovalWorkflowStage,
    ) -> WritableVmInterfaceRequest {
        WritableVmInterfaceRequest {
            id: None,
            mac_address: None,
            enabled: None,
            mtu: None,
            mode: None,
            name,
            description: None,
            status: Box::new(status),
            role: None,
            parent_interface: None,
            bridge: None,
            virtual_machine: Box::new(virtual_machine),
            untagged_vlan: None,
            vrf: None,
            tagged_vlans: None,
            custom_fields: None,
            relationships: None,
            tags: None,
        }
    }
}