netbox-openapi 0.6.0

low level netbox bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * NetBox REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.6.2 (4.6)
 *
 * Generated by: https://openapi-generator.tech
 */

/// PatchedWritableVmInterfaceRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PatchedWritableVmInterfaceRequest {
    #[serde(rename = "virtual_machine", skip_serializing_if = "Option::is_none")]
    pub virtual_machine: Option<Box<crate::models::PatchedVirtualDiskRequestVirtualMachine>>,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(
        rename = "parent",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub parent: Option<Option<i32>>,
    #[serde(
        rename = "bridge",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub bridge: Option<Option<i32>>,
    #[serde(
        rename = "mtu",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mtu: Option<Option<i32>>,
    #[serde(
        rename = "primary_mac_address",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub primary_mac_address: Option<Option<Box<crate::models::InterfaceRequestPrimaryMacAddress>>>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
    #[serde(
        rename = "mode",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub mode: Option<Option<Mode>>,
    #[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::InterfaceRequestUntaggedVlan>>>,
    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
    pub tagged_vlans: Option<Vec<i32>>,
    #[serde(
        rename = "qinq_svlan",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub qinq_svlan: Option<Option<Box<crate::models::InterfaceRequestUntaggedVlan>>>,
    #[serde(
        rename = "vlan_translation_policy",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vlan_translation_policy:
        Option<Option<Box<crate::models::InterfaceRequestVlanTranslationPolicy>>>,
    #[serde(
        rename = "vrf",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub vrf: Option<Option<Box<crate::models::IpAddressRequestVrf>>>,
    #[serde(
        rename = "owner",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl PatchedWritableVmInterfaceRequest {
    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
    pub fn new() -> PatchedWritableVmInterfaceRequest {
        PatchedWritableVmInterfaceRequest {
            virtual_machine: None,
            name: None,
            enabled: None,
            parent: None,
            bridge: None,
            mtu: None,
            primary_mac_address: None,
            description: None,
            mode: None,
            untagged_vlan: None,
            tagged_vlans: None,
            qinq_svlan: None,
            vlan_translation_policy: None,
            vrf: None,
            owner: None,
            tags: None,
            custom_fields: None,
        }
    }
}

/// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
    #[serde(rename = "access")]
    Access,
    #[serde(rename = "tagged")]
    Tagged,
    #[serde(rename = "tagged-all")]
    TaggedAll,
    #[serde(rename = "q-in-q")]
    QInQ,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

impl Default for Mode {
    fn default() -> Mode {
        Self::Access
    }
}