Skip to main content

netbox_openapi/models/
patched_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/// PatchedBulkVmInterfaceRequest : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkVmInterfaceRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "virtual_machine", skip_serializing_if = "Option::is_none")]
18    pub virtual_machine: Option<Box<crate::models::BulkVmInterfaceRequestVirtualMachine>>,
19    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
20    pub name: Option<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 PatchedBulkVmInterfaceRequest {
102    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
103    pub fn new(id: i32) -> PatchedBulkVmInterfaceRequest {
104        PatchedBulkVmInterfaceRequest {
105            id,
106            virtual_machine: None,
107            name: None,
108            enabled: None,
109            parent: None,
110            bridge: None,
111            mtu: None,
112            primary_mac_address: None,
113            description: None,
114            mode: None,
115            untagged_vlan: None,
116            tagged_vlans: None,
117            qinq_svlan: None,
118            vlan_translation_policy: None,
119            vrf: None,
120            owner: None,
121            tags: None,
122            custom_fields: None,
123        }
124    }
125}
126
127/// * `access` - Access * `tagged` - Tagged * `tagged-all` - Tagged (All) * `q-in-q` - Q-in-Q (802.1ad)
128#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
129pub enum Mode {
130    #[serde(rename = "access")]
131    Access,
132    #[serde(rename = "tagged")]
133    Tagged,
134    #[serde(rename = "tagged-all")]
135    TaggedAll,
136    #[serde(rename = "q-in-q")]
137    QInQ,
138    #[serde(rename = "")]
139    Empty,
140}
141
142impl Default for Mode {
143    fn default() -> Mode {
144        Self::Access
145    }
146}