netbox_openapi/models/
patched_writable_vm_interface_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedWritableVmInterfaceRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableVmInterfaceRequest {
15    #[serde(rename = "virtual_machine", skip_serializing_if = "Option::is_none")]
16    pub virtual_machine: Option<Box<crate::models::PatchedVirtualDiskRequestVirtualMachine>>,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
20    pub enabled: Option<bool>,
21    #[serde(
22        rename = "parent",
23        default,
24        with = "::serde_with::rust::double_option",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub parent: Option<Option<i32>>,
28    #[serde(
29        rename = "bridge",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub bridge: Option<Option<i32>>,
35    #[serde(
36        rename = "mtu",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub mtu: Option<Option<i32>>,
42    #[serde(
43        rename = "primary_mac_address",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub primary_mac_address: Option<Option<Box<crate::models::InterfaceRequestPrimaryMacAddress>>>,
49    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
50    pub description: Option<String>,
51    /// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
52    #[serde(
53        rename = "mode",
54        default,
55        with = "::serde_with::rust::double_option",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub mode: Option<Option<Mode>>,
59    #[serde(
60        rename = "untagged_vlan",
61        default,
62        with = "::serde_with::rust::double_option",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub untagged_vlan: Option<Option<Box<crate::models::InterfaceRequestUntaggedVlan>>>,
66    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
67    pub tagged_vlans: Option<Vec<i32>>,
68    #[serde(
69        rename = "qinq_svlan",
70        default,
71        with = "::serde_with::rust::double_option",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub qinq_svlan: Option<Option<Box<crate::models::InterfaceRequestUntaggedVlan>>>,
75    #[serde(
76        rename = "vlan_translation_policy",
77        default,
78        with = "::serde_with::rust::double_option",
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub vlan_translation_policy:
82        Option<Option<Box<crate::models::InterfaceRequestVlanTranslationPolicy>>>,
83    #[serde(
84        rename = "vrf",
85        default,
86        with = "::serde_with::rust::double_option",
87        skip_serializing_if = "Option::is_none"
88    )]
89    pub vrf: Option<Option<Box<crate::models::IpAddressRequestVrf>>>,
90    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
91    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
92    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
93    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
94}
95
96impl PatchedWritableVmInterfaceRequest {
97    /// Adds support for custom fields and tags.
98    pub fn new() -> PatchedWritableVmInterfaceRequest {
99        PatchedWritableVmInterfaceRequest {
100            virtual_machine: None,
101            name: None,
102            enabled: None,
103            parent: None,
104            bridge: None,
105            mtu: None,
106            primary_mac_address: None,
107            description: None,
108            mode: None,
109            untagged_vlan: None,
110            tagged_vlans: None,
111            qinq_svlan: None,
112            vlan_translation_policy: None,
113            vrf: None,
114            tags: None,
115            custom_fields: None,
116        }
117    }
118}
119
120/// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
121#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
122pub enum Mode {
123    #[serde(rename = "access")]
124    Access,
125    #[serde(rename = "tagged")]
126    Tagged,
127    #[serde(rename = "tagged-all")]
128    TaggedAll,
129    #[serde(rename = "q-in-q")]
130    QInQ,
131    #[serde(rename = "")]
132    Empty,
133    #[serde(rename = "null")]
134    Null,
135}
136
137impl Default for Mode {
138    fn default() -> Mode {
139        Self::Access
140    }
141}