Skip to main content

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