1#[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::BulkVmInterfaceRequestVirtualMachine>>,
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:
49 Option<Option<Box<crate::models::BulkInterfaceRequestPrimaryMacAddress>>>,
50 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
51 pub description: Option<String>,
52 #[serde(
54 rename = "mode",
55 default,
56 with = "::serde_with::rust::double_option",
57 skip_serializing_if = "Option::is_none"
58 )]
59 pub mode: Option<Option<Mode>>,
60 #[serde(
61 rename = "untagged_vlan",
62 default,
63 with = "::serde_with::rust::double_option",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub untagged_vlan: Option<Option<Box<crate::models::BulkInterfaceRequestUntaggedVlan>>>,
67 #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
68 pub tagged_vlans: Option<Vec<i32>>,
69 #[serde(
70 rename = "qinq_svlan",
71 default,
72 with = "::serde_with::rust::double_option",
73 skip_serializing_if = "Option::is_none"
74 )]
75 pub qinq_svlan: Option<Option<Box<crate::models::BulkInterfaceRequestUntaggedVlan>>>,
76 #[serde(
77 rename = "vlan_translation_policy",
78 default,
79 with = "::serde_with::rust::double_option",
80 skip_serializing_if = "Option::is_none"
81 )]
82 pub vlan_translation_policy:
83 Option<Option<Box<crate::models::BulkInterfaceRequestVlanTranslationPolicy>>>,
84 #[serde(
85 rename = "vrf",
86 default,
87 with = "::serde_with::rust::double_option",
88 skip_serializing_if = "Option::is_none"
89 )]
90 pub vrf: Option<Option<Box<crate::models::BulkIpAddressRequestVrf>>>,
91 #[serde(
92 rename = "owner",
93 default,
94 with = "::serde_with::rust::double_option",
95 skip_serializing_if = "Option::is_none"
96 )]
97 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
98 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
99 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
100 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
101 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
102}
103
104impl PatchedWritableVmInterfaceRequest {
105 pub fn new() -> PatchedWritableVmInterfaceRequest {
107 PatchedWritableVmInterfaceRequest {
108 virtual_machine: None,
109 name: None,
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#[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}