Skip to main content

netbox_openapi/models/
virtualization_interfaces_create_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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct VirtualizationInterfacesCreateRequest {
13    #[serde(rename = "virtual_machine")]
14    pub virtual_machine: Box<crate::models::BulkVmInterfaceRequestVirtualMachine>,
15    #[serde(rename = "name")]
16    pub name: String,
17    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
18    pub enabled: Option<bool>,
19    #[serde(
20        rename = "parent",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub parent: Option<Option<i32>>,
26    #[serde(
27        rename = "bridge",
28        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub bridge: Option<Option<i32>>,
33    #[serde(
34        rename = "mtu",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub mtu: Option<Option<i32>>,
40    #[serde(
41        rename = "primary_mac_address",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub primary_mac_address:
47        Option<Option<Box<crate::models::BulkInterfaceRequestPrimaryMacAddress>>>,
48    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
49    pub description: Option<String>,
50    /// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
51    #[serde(
52        rename = "mode",
53        default,
54        with = "::serde_with::rust::double_option",
55        skip_serializing_if = "Option::is_none"
56    )]
57    pub mode: Option<Option<Mode>>,
58    #[serde(
59        rename = "untagged_vlan",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub untagged_vlan: Option<Option<Box<crate::models::BulkInterfaceRequestUntaggedVlan>>>,
65    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
66    pub tagged_vlans: Option<Vec<i32>>,
67    #[serde(
68        rename = "qinq_svlan",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub qinq_svlan: Option<Option<Box<crate::models::BulkInterfaceRequestUntaggedVlan>>>,
74    #[serde(
75        rename = "vlan_translation_policy",
76        default,
77        with = "::serde_with::rust::double_option",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub vlan_translation_policy:
81        Option<Option<Box<crate::models::BulkInterfaceRequestVlanTranslationPolicy>>>,
82    #[serde(
83        rename = "vrf",
84        default,
85        with = "::serde_with::rust::double_option",
86        skip_serializing_if = "Option::is_none"
87    )]
88    pub vrf: Option<Option<Box<crate::models::BulkIpAddressRequestVrf>>>,
89    #[serde(
90        rename = "owner",
91        default,
92        with = "::serde_with::rust::double_option",
93        skip_serializing_if = "Option::is_none"
94    )]
95    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
96    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
97    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
98    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
99    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
100}
101
102impl VirtualizationInterfacesCreateRequest {
103    pub fn new(
104        virtual_machine: crate::models::BulkVmInterfaceRequestVirtualMachine,
105        name: String,
106    ) -> VirtualizationInterfacesCreateRequest {
107        VirtualizationInterfacesCreateRequest {
108            virtual_machine: Box::new(virtual_machine),
109            name,
110            enabled: None,
111            parent: None,
112            bridge: None,
113            mtu: None,
114            primary_mac_address: None,
115            description: None,
116            mode: None,
117            untagged_vlan: None,
118            tagged_vlans: None,
119            qinq_svlan: None,
120            vlan_translation_policy: None,
121            vrf: None,
122            owner: None,
123            tags: None,
124            custom_fields: None,
125        }
126    }
127}
128
129/// IEEE 802.1Q tagging strategy  * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
130#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
131pub enum Mode {
132    #[serde(rename = "access")]
133    Access,
134    #[serde(rename = "tagged")]
135    Tagged,
136    #[serde(rename = "tagged-all")]
137    TaggedAll,
138    #[serde(rename = "q-in-q")]
139    QInQ,
140    #[serde(rename = "")]
141    Empty,
142    #[serde(rename = "null")]
143    Null,
144}
145
146impl Default for Mode {
147    fn default() -> Mode {
148        Self::Access
149    }
150}