1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableVmInterfaceRequest {
15 #[serde(rename = "virtual_machine")]
16 pub virtual_machine: Box<crate::models::BulkVmInterfaceRequestVirtualMachine>,
17 #[serde(rename = "name")]
18 pub name: 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 WritableVmInterfaceRequest {
105 pub fn new(
107 virtual_machine: crate::models::BulkVmInterfaceRequestVirtualMachine,
108 name: String,
109 ) -> WritableVmInterfaceRequest {
110 WritableVmInterfaceRequest {
111 virtual_machine: Box::new(virtual_machine),
112 name,
113 enabled: None,
114 parent: None,
115 bridge: None,
116 mtu: None,
117 primary_mac_address: None,
118 description: None,
119 mode: None,
120 untagged_vlan: None,
121 tagged_vlans: None,
122 qinq_svlan: None,
123 vlan_translation_policy: None,
124 vrf: None,
125 owner: None,
126 tags: None,
127 custom_fields: None,
128 }
129 }
130}
131
132#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
134pub enum Mode {
135 #[serde(rename = "access")]
136 Access,
137 #[serde(rename = "tagged")]
138 Tagged,
139 #[serde(rename = "tagged-all")]
140 TaggedAll,
141 #[serde(rename = "q-in-q")]
142 QInQ,
143 #[serde(rename = "")]
144 Empty,
145 #[serde(rename = "null")]
146 Null,
147}
148
149impl Default for Mode {
150 fn default() -> Mode {
151 Self::Access
152 }
153}