1#[derive(Debug, Clone)]
2pub struct ZoneClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> ZoneClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str, zone: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}/{}", parent_path, zone),
14 }
15 }
16}
17impl<T> ZoneClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Delete sdn zone object configuration."]
22 #[doc = ""]
23 #[doc = "Permission check: perm(\"/sdn/zones/{zone}\", [\"SDN.Allocate\"])"]
24 pub async fn delete(&self, params: DeleteParams) -> Result<(), T::Error> {
25 let path = self.path.to_string();
26 self.client.delete(&path, ¶ms).await
27 }
28}
29impl<T> ZoneClient<T>
30where
31 T: crate::client::Client,
32{
33 #[doc = "Read sdn zone configuration."]
34 #[doc = ""]
35 #[doc = "Permission check: perm(\"/sdn/zones/{zone}\", [\"SDN.Allocate\"])"]
36 pub async fn get(&self, params: GetParams) -> Result<GetOutput, T::Error> {
37 let path = self.path.to_string();
38 self.client.get(&path, ¶ms).await
39 }
40}
41impl<T> ZoneClient<T>
42where
43 T: crate::client::Client,
44{
45 #[doc = "Update sdn zone object configuration."]
46 #[doc = ""]
47 #[doc = "Permission check: perm(\"/sdn/zones/{zone}\", [\"SDN.Allocate\"])"]
48 pub async fn put(&self, params: PutParams) -> Result<(), T::Error> {
49 let path = self.path.to_string();
50 self.client.put(&path, ¶ms).await
51 }
52}
53#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
54pub struct DeleteParams {
55 #[serde(rename = "lock-token")]
56 #[serde(skip_serializing_if = "Option::is_none", default)]
57 #[doc = "the token for unlocking the global SDN configuration"]
58 #[doc = ""]
59 pub lock_token: Option<String>,
60 #[serde(
61 flatten,
62 default,
63 skip_serializing_if = "::std::collections::HashMap::is_empty"
64 )]
65 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
66}
67impl GetOutput {
68 pub fn new(ty: Type, zone: String) -> Self {
69 Self {
70 ty,
71 zone,
72 advertise_subnets: ::std::default::Default::default(),
73 bridge: ::std::default::Default::default(),
74 bridge_disable_mac_learning: ::std::default::Default::default(),
75 controller: ::std::default::Default::default(),
76 dhcp: ::std::default::Default::default(),
77 digest: ::std::default::Default::default(),
78 disable_arp_nd_suppression: ::std::default::Default::default(),
79 dns: ::std::default::Default::default(),
80 dnszone: ::std::default::Default::default(),
81 exitnodes: ::std::default::Default::default(),
82 exitnodes_local_routing: ::std::default::Default::default(),
83 exitnodes_primary: ::std::default::Default::default(),
84 ipam: ::std::default::Default::default(),
85 mac: ::std::default::Default::default(),
86 mtu: ::std::default::Default::default(),
87 nodes: ::std::default::Default::default(),
88 peers: ::std::default::Default::default(),
89 pending: ::std::default::Default::default(),
90 reversedns: ::std::default::Default::default(),
91 rt_import: ::std::default::Default::default(),
92 state: ::std::default::Default::default(),
93 tag: ::std::default::Default::default(),
94 vlan_protocol: ::std::default::Default::default(),
95 vrf_vxlan: ::std::default::Default::default(),
96 vxlan_port: ::std::default::Default::default(),
97 additional_properties: ::std::default::Default::default(),
98 }
99 }
100}
101#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
102pub struct GetOutput {
103 #[serde(rename = "advertise-subnets")]
104 #[serde(
105 serialize_with = "crate::types::serialize_bool_optional",
106 deserialize_with = "crate::types::deserialize_bool_optional"
107 )]
108 #[serde(skip_serializing_if = "Option::is_none", default)]
109 #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes). EVPN zone only."]
110 #[doc = ""]
111 pub advertise_subnets: Option<bool>,
112 #[serde(skip_serializing_if = "Option::is_none", default)]
113 #[doc = "the bridge for which VLANs should be managed. VLAN & QinQ zone only."]
114 #[doc = ""]
115 pub bridge: Option<String>,
116 #[serde(rename = "bridge-disable-mac-learning")]
117 #[serde(
118 serialize_with = "crate::types::serialize_bool_optional",
119 deserialize_with = "crate::types::deserialize_bool_optional"
120 )]
121 #[serde(skip_serializing_if = "Option::is_none", default)]
122 #[doc = "Disable auto mac learning. VLAN zone only."]
123 #[doc = ""]
124 pub bridge_disable_mac_learning: Option<bool>,
125 #[serde(skip_serializing_if = "Option::is_none", default)]
126 #[doc = "ID of the controller for this zone. EVPN zone only."]
127 #[doc = ""]
128 pub controller: Option<String>,
129 #[serde(skip_serializing_if = "Option::is_none", default)]
130 #[doc = "Name of DHCP server backend for this zone."]
131 #[doc = ""]
132 pub dhcp: Option<Dhcp>,
133 #[serde(skip_serializing_if = "Option::is_none", default)]
134 #[doc = "Digest of the controller section."]
135 #[doc = ""]
136 pub digest: Option<String>,
137 #[serde(rename = "disable-arp-nd-suppression")]
138 #[serde(
139 serialize_with = "crate::types::serialize_bool_optional",
140 deserialize_with = "crate::types::deserialize_bool_optional"
141 )]
142 #[serde(skip_serializing_if = "Option::is_none", default)]
143 #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages. EVPN zone only."]
144 #[doc = ""]
145 pub disable_arp_nd_suppression: Option<bool>,
146 #[serde(skip_serializing_if = "Option::is_none", default)]
147 #[doc = "ID of the DNS server for this zone."]
148 #[doc = ""]
149 pub dns: Option<String>,
150 #[serde(skip_serializing_if = "Option::is_none", default)]
151 #[doc = "Domain name for this zone."]
152 #[doc = ""]
153 pub dnszone: Option<String>,
154 #[serde(skip_serializing_if = "Option::is_none", default)]
155 #[doc = "List of PVE Nodes that should act as exit node for this zone. EVPN zone only."]
156 #[doc = ""]
157 pub exitnodes: Option<String>,
158 #[serde(rename = "exitnodes-local-routing")]
159 #[serde(
160 serialize_with = "crate::types::serialize_bool_optional",
161 deserialize_with = "crate::types::deserialize_bool_optional"
162 )]
163 #[serde(skip_serializing_if = "Option::is_none", default)]
164 #[doc = "Create routes on the exit nodes, so they can connect to EVPN guests. EVPN zone only."]
165 #[doc = ""]
166 pub exitnodes_local_routing: Option<bool>,
167 #[serde(rename = "exitnodes-primary")]
168 #[serde(skip_serializing_if = "Option::is_none", default)]
169 #[doc = "Force traffic through this exitnode first. EVPN zone only."]
170 #[doc = ""]
171 pub exitnodes_primary: Option<String>,
172 #[serde(skip_serializing_if = "Option::is_none", default)]
173 #[doc = "ID of the IPAM for this zone."]
174 #[doc = ""]
175 pub ipam: Option<String>,
176 #[serde(skip_serializing_if = "Option::is_none", default)]
177 #[doc = "MAC address of the anycast router for this zone."]
178 #[doc = ""]
179 pub mac: Option<String>,
180 #[serde(
181 serialize_with = "crate::types::serialize_int_optional",
182 deserialize_with = "crate::types::deserialize_int_optional"
183 )]
184 #[serde(skip_serializing_if = "Option::is_none", default)]
185 #[doc = "MTU of the zone, will be used for the created VNet bridges."]
186 #[doc = ""]
187 pub mtu: Option<i64>,
188 #[serde(skip_serializing_if = "Option::is_none", default)]
189 #[doc = "Nodes where this zone should be created."]
190 #[doc = ""]
191 pub nodes: Option<String>,
192 #[serde(skip_serializing_if = "Option::is_none", default)]
193 #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes. VXLAN zone only."]
194 #[doc = ""]
195 pub peers: Option<String>,
196 #[serde(skip_serializing_if = "Option::is_none", default)]
197 #[doc = "Changes that have not yet been applied to the running configuration."]
198 #[doc = ""]
199 pub pending: Option<PendingGetOutputPending>,
200 #[serde(skip_serializing_if = "Option::is_none", default)]
201 #[doc = "ID of the reverse DNS server for this zone."]
202 #[doc = ""]
203 pub reversedns: Option<String>,
204 #[serde(rename = "rt-import")]
205 #[serde(skip_serializing_if = "Option::is_none", default)]
206 #[doc = "Route-Targets that should be imported into the VRF of this zone via BGP. EVPN zone only."]
207 #[doc = ""]
208 pub rt_import: Option<String>,
209 #[serde(skip_serializing_if = "Option::is_none", default)]
210 #[doc = "State of the SDN configuration object."]
211 #[doc = ""]
212 pub state: Option<State>,
213 #[serde(
214 serialize_with = "crate::types::serialize_unsigned_int_optional",
215 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
216 )]
217 #[serde(skip_serializing_if = "Option::is_none", default)]
218 #[doc = "Service-VLAN Tag (outer VLAN). QinQ zone only"]
219 #[doc = ""]
220 pub tag: Option<u64>,
221 #[serde(rename = "type")]
222 #[doc = "Type of the zone."]
223 #[doc = ""]
224 pub ty: Type,
225 #[serde(rename = "vlan-protocol")]
226 #[serde(skip_serializing_if = "Option::is_none", default)]
227 #[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
228 #[doc = ""]
229 pub vlan_protocol: Option<VlanProtocol>,
230 #[serde(rename = "vrf-vxlan")]
231 #[serde(skip_serializing_if = "Option::is_none", default)]
232 #[doc = "VNI for the zone VRF. EVPN zone only."]
233 #[doc = ""]
234 pub vrf_vxlan: Option<VrfVxlanInt>,
235 #[serde(rename = "vxlan-port")]
236 #[serde(skip_serializing_if = "Option::is_none", default)]
237 #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789). VXLAN zone only."]
238 #[doc = ""]
239 pub vxlan_port: Option<VxlanPortInt>,
240 #[doc = "Name of the zone."]
241 #[doc = ""]
242 pub zone: String,
243 #[serde(
244 flatten,
245 default,
246 skip_serializing_if = "::std::collections::HashMap::is_empty"
247 )]
248 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
249}
250#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
251pub struct GetParams {
252 #[serde(
253 serialize_with = "crate::types::serialize_bool_optional",
254 deserialize_with = "crate::types::deserialize_bool_optional"
255 )]
256 #[serde(skip_serializing_if = "Option::is_none", default)]
257 #[doc = "Display pending config."]
258 #[doc = ""]
259 pub pending: Option<bool>,
260 #[serde(
261 serialize_with = "crate::types::serialize_bool_optional",
262 deserialize_with = "crate::types::deserialize_bool_optional"
263 )]
264 #[serde(skip_serializing_if = "Option::is_none", default)]
265 #[doc = "Display running config."]
266 #[doc = ""]
267 pub running: Option<bool>,
268 #[serde(
269 flatten,
270 default,
271 skip_serializing_if = "::std::collections::HashMap::is_empty"
272 )]
273 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
274}
275#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
276pub struct PendingGetOutputPending {
277 #[serde(rename = "advertise-subnets")]
278 #[serde(
279 serialize_with = "crate::types::serialize_bool_optional",
280 deserialize_with = "crate::types::deserialize_bool_optional"
281 )]
282 #[serde(skip_serializing_if = "Option::is_none", default)]
283 #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes). EVPN zone only."]
284 #[doc = ""]
285 pub advertise_subnets: Option<bool>,
286 #[serde(skip_serializing_if = "Option::is_none", default)]
287 #[doc = "the bridge for which VLANs should be managed. VLAN & QinQ zone only."]
288 #[doc = ""]
289 pub bridge: Option<String>,
290 #[serde(rename = "bridge-disable-mac-learning")]
291 #[serde(
292 serialize_with = "crate::types::serialize_bool_optional",
293 deserialize_with = "crate::types::deserialize_bool_optional"
294 )]
295 #[serde(skip_serializing_if = "Option::is_none", default)]
296 #[doc = "Disable auto mac learning. VLAN zone only."]
297 #[doc = ""]
298 pub bridge_disable_mac_learning: Option<bool>,
299 #[serde(skip_serializing_if = "Option::is_none", default)]
300 #[doc = "ID of the controller for this zone. EVPN zone only."]
301 #[doc = ""]
302 pub controller: Option<String>,
303 #[serde(skip_serializing_if = "Option::is_none", default)]
304 #[doc = "Name of DHCP server backend for this zone."]
305 #[doc = ""]
306 pub dhcp: Option<Dhcp>,
307 #[serde(rename = "disable-arp-nd-suppression")]
308 #[serde(
309 serialize_with = "crate::types::serialize_bool_optional",
310 deserialize_with = "crate::types::deserialize_bool_optional"
311 )]
312 #[serde(skip_serializing_if = "Option::is_none", default)]
313 #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages. EVPN zone only."]
314 #[doc = ""]
315 pub disable_arp_nd_suppression: Option<bool>,
316 #[serde(skip_serializing_if = "Option::is_none", default)]
317 #[doc = "ID of the DNS server for this zone."]
318 #[doc = ""]
319 pub dns: Option<String>,
320 #[serde(skip_serializing_if = "Option::is_none", default)]
321 #[doc = "Domain name for this zone."]
322 #[doc = ""]
323 pub dnszone: Option<String>,
324 #[serde(skip_serializing_if = "Option::is_none", default)]
325 #[doc = "List of PVE Nodes that should act as exit node for this zone. EVPN zone only."]
326 #[doc = ""]
327 pub exitnodes: Option<String>,
328 #[serde(rename = "exitnodes-local-routing")]
329 #[serde(
330 serialize_with = "crate::types::serialize_bool_optional",
331 deserialize_with = "crate::types::deserialize_bool_optional"
332 )]
333 #[serde(skip_serializing_if = "Option::is_none", default)]
334 #[doc = "Create routes on the exit nodes, so they can connect to EVPN guests. EVPN zone only."]
335 #[doc = ""]
336 pub exitnodes_local_routing: Option<bool>,
337 #[serde(rename = "exitnodes-primary")]
338 #[serde(skip_serializing_if = "Option::is_none", default)]
339 #[doc = "Force traffic through this exitnode first. EVPN zone only."]
340 #[doc = ""]
341 pub exitnodes_primary: Option<String>,
342 #[serde(skip_serializing_if = "Option::is_none", default)]
343 #[doc = "ID of the IPAM for this zone."]
344 #[doc = ""]
345 pub ipam: Option<String>,
346 #[serde(skip_serializing_if = "Option::is_none", default)]
347 #[doc = "MAC address of the anycast router for this zone."]
348 #[doc = ""]
349 pub mac: Option<String>,
350 #[serde(
351 serialize_with = "crate::types::serialize_int_optional",
352 deserialize_with = "crate::types::deserialize_int_optional"
353 )]
354 #[serde(skip_serializing_if = "Option::is_none", default)]
355 #[doc = "MTU of the zone, will be used for the created VNet bridges."]
356 #[doc = ""]
357 pub mtu: Option<i64>,
358 #[serde(skip_serializing_if = "Option::is_none", default)]
359 #[doc = "Nodes where this zone should be created."]
360 #[doc = ""]
361 pub nodes: Option<String>,
362 #[serde(skip_serializing_if = "Option::is_none", default)]
363 #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes. VXLAN zone only."]
364 #[doc = ""]
365 pub peers: Option<String>,
366 #[serde(skip_serializing_if = "Option::is_none", default)]
367 #[doc = "ID of the reverse DNS server for this zone."]
368 #[doc = ""]
369 pub reversedns: Option<String>,
370 #[serde(rename = "rt-import")]
371 #[serde(skip_serializing_if = "Option::is_none", default)]
372 #[doc = "Route-Targets that should be imported into the VRF of this zone via BGP. EVPN zone only."]
373 #[doc = ""]
374 pub rt_import: Option<String>,
375 #[serde(
376 serialize_with = "crate::types::serialize_unsigned_int_optional",
377 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
378 )]
379 #[serde(skip_serializing_if = "Option::is_none", default)]
380 #[doc = "Service-VLAN Tag (outer VLAN). QinQ zone only"]
381 #[doc = ""]
382 pub tag: Option<u64>,
383 #[serde(rename = "vlan-protocol")]
384 #[serde(skip_serializing_if = "Option::is_none", default)]
385 #[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
386 #[doc = ""]
387 pub vlan_protocol: Option<VlanProtocol>,
388 #[serde(rename = "vrf-vxlan")]
389 #[serde(skip_serializing_if = "Option::is_none", default)]
390 #[doc = "VNI for the zone VRF. EVPN zone only."]
391 #[doc = ""]
392 pub vrf_vxlan: Option<VrfVxlanInt>,
393 #[serde(rename = "vxlan-port")]
394 #[serde(skip_serializing_if = "Option::is_none", default)]
395 #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789). VXLAN zone only."]
396 #[doc = ""]
397 pub vxlan_port: Option<VxlanPortInt>,
398 #[serde(
399 flatten,
400 default,
401 skip_serializing_if = "::std::collections::HashMap::is_empty"
402 )]
403 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
404}
405#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
406pub struct PutParams {
407 #[serde(rename = "advertise-subnets")]
408 #[serde(
409 serialize_with = "crate::types::serialize_bool_optional",
410 deserialize_with = "crate::types::deserialize_bool_optional"
411 )]
412 #[serde(skip_serializing_if = "Option::is_none", default)]
413 #[doc = "Advertise IP prefixes (Type-5 routes) instead of MAC/IP pairs (Type-2 routes)."]
414 #[doc = ""]
415 pub advertise_subnets: Option<bool>,
416 #[serde(skip_serializing_if = "Option::is_none", default)]
417 #[doc = "The bridge for which VLANs should be managed."]
418 #[doc = ""]
419 pub bridge: Option<String>,
420 #[serde(rename = "bridge-disable-mac-learning")]
421 #[serde(
422 serialize_with = "crate::types::serialize_bool_optional",
423 deserialize_with = "crate::types::deserialize_bool_optional"
424 )]
425 #[serde(skip_serializing_if = "Option::is_none", default)]
426 #[doc = "Disable auto mac learning."]
427 #[doc = ""]
428 pub bridge_disable_mac_learning: Option<bool>,
429 #[serde(skip_serializing_if = "Option::is_none", default)]
430 #[doc = "Controller for this zone."]
431 #[doc = ""]
432 pub controller: Option<String>,
433 #[serde(skip_serializing_if = "Option::is_none", default)]
434 #[doc = "A list of settings you want to delete."]
435 #[doc = ""]
436 pub delete: Option<DeleteStr>,
437 #[serde(skip_serializing_if = "Option::is_none", default)]
438 #[doc = "Type of the DHCP backend for this zone"]
439 #[doc = ""]
440 pub dhcp: Option<Dhcp>,
441 #[serde(skip_serializing_if = "Option::is_none", default)]
442 #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
443 #[doc = ""]
444 pub digest: Option<DigestStr>,
445 #[serde(rename = "disable-arp-nd-suppression")]
446 #[serde(
447 serialize_with = "crate::types::serialize_bool_optional",
448 deserialize_with = "crate::types::deserialize_bool_optional"
449 )]
450 #[serde(skip_serializing_if = "Option::is_none", default)]
451 #[doc = "Suppress IPv4 ARP && IPv6 Neighbour Discovery messages."]
452 #[doc = ""]
453 pub disable_arp_nd_suppression: Option<bool>,
454 #[serde(skip_serializing_if = "Option::is_none", default)]
455 #[doc = "dns api server"]
456 #[doc = ""]
457 pub dns: Option<String>,
458 #[serde(skip_serializing_if = "Option::is_none", default)]
459 #[doc = "dns domain zone ex: mydomain.com"]
460 #[doc = ""]
461 pub dnszone: Option<String>,
462 #[serde(rename = "dp-id")]
463 #[serde(
464 serialize_with = "crate::types::serialize_int_optional",
465 deserialize_with = "crate::types::deserialize_int_optional"
466 )]
467 #[serde(skip_serializing_if = "Option::is_none", default)]
468 #[doc = "Faucet dataplane id"]
469 #[doc = ""]
470 pub dp_id: Option<i64>,
471 #[serde(skip_serializing_if = "Option::is_none", default)]
472 #[doc = "List of cluster node names."]
473 #[doc = ""]
474 pub exitnodes: Option<String>,
475 #[serde(rename = "exitnodes-local-routing")]
476 #[serde(
477 serialize_with = "crate::types::serialize_bool_optional",
478 deserialize_with = "crate::types::deserialize_bool_optional"
479 )]
480 #[serde(skip_serializing_if = "Option::is_none", default)]
481 #[doc = "Allow exitnodes to connect to EVPN guests."]
482 #[doc = ""]
483 pub exitnodes_local_routing: Option<bool>,
484 #[serde(rename = "exitnodes-primary")]
485 #[serde(skip_serializing_if = "Option::is_none", default)]
486 #[doc = "Force traffic through this exitnode first."]
487 #[doc = ""]
488 pub exitnodes_primary: Option<String>,
489 #[serde(skip_serializing_if = "Option::is_none", default)]
490 #[doc = "SDN fabric to use as underlay for this VXLAN zone."]
491 #[doc = ""]
492 pub fabric: Option<String>,
493 #[serde(skip_serializing_if = "Option::is_none", default)]
494 #[doc = "use a specific ipam"]
495 #[doc = ""]
496 pub ipam: Option<String>,
497 #[serde(rename = "lock-token")]
498 #[serde(skip_serializing_if = "Option::is_none", default)]
499 #[doc = "the token for unlocking the global SDN configuration"]
500 #[doc = ""]
501 pub lock_token: Option<String>,
502 #[serde(skip_serializing_if = "Option::is_none", default)]
503 #[doc = "Anycast logical router mac address."]
504 #[doc = ""]
505 pub mac: Option<crate::types::MacAddr<true>>,
506 #[serde(
507 serialize_with = "crate::types::serialize_int_optional",
508 deserialize_with = "crate::types::deserialize_int_optional"
509 )]
510 #[serde(skip_serializing_if = "Option::is_none", default)]
511 #[doc = "MTU of the zone, will be used for the created VNet bridges."]
512 #[doc = ""]
513 pub mtu: Option<i64>,
514 #[serde(skip_serializing_if = "Option::is_none", default)]
515 #[doc = "List of cluster node names."]
516 #[doc = ""]
517 pub nodes: Option<String>,
518 #[serde(skip_serializing_if = "Option::is_none", default)]
519 #[doc = "Comma-separated list of peers, that are part of the VXLAN zone. Usually the IPs of the nodes."]
520 #[doc = ""]
521 pub peers: Option<String>,
522 #[serde(skip_serializing_if = "Option::is_none", default)]
523 #[doc = "reverse dns api server"]
524 #[doc = ""]
525 pub reversedns: Option<String>,
526 #[serde(rename = "rt-import")]
527 #[serde(skip_serializing_if = "Option::is_none", default)]
528 #[doc = "List of Route Targets that should be imported into the VRF of the zone."]
529 #[doc = ""]
530 pub rt_import: Option<String>,
531 #[serde(
532 serialize_with = "crate::types::serialize_unsigned_int_optional",
533 deserialize_with = "crate::types::deserialize_unsigned_int_optional"
534 )]
535 #[serde(skip_serializing_if = "Option::is_none", default)]
536 #[doc = "Service-VLAN Tag (outer VLAN)"]
537 #[doc = ""]
538 pub tag: Option<u64>,
539 #[serde(rename = "vlan-protocol")]
540 #[serde(skip_serializing_if = "Option::is_none", default)]
541 #[doc = "Which VLAN protocol should be used for the creation of the QinQ zone."]
542 #[doc = ""]
543 pub vlan_protocol: Option<VlanProtocol>,
544 #[serde(rename = "vrf-vxlan")]
545 #[serde(skip_serializing_if = "Option::is_none", default)]
546 #[doc = "VNI for the zone VRF."]
547 #[doc = ""]
548 pub vrf_vxlan: Option<VrfVxlanInt>,
549 #[serde(rename = "vxlan-port")]
550 #[serde(skip_serializing_if = "Option::is_none", default)]
551 #[doc = "UDP port that should be used for the VXLAN tunnel (default 4789)."]
552 #[doc = ""]
553 pub vxlan_port: Option<VxlanPortInt>,
554 #[serde(
555 flatten,
556 default,
557 skip_serializing_if = "::std::collections::HashMap::is_empty"
558 )]
559 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
560}
561#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
562#[doc = "Name of DHCP server backend for this zone."]
563#[doc = ""]
564pub enum Dhcp {
565 #[serde(rename = "dnsmasq")]
566 Dnsmasq,
567}
568impl TryFrom<&str> for Dhcp {
569 type Error = String;
570 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
571 match value {
572 "dnsmasq" => Ok(Self::Dnsmasq),
573 v => Err(format!("Unknown variant {v}")),
574 }
575 }
576}
577#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
578#[doc = "State of the SDN configuration object."]
579#[doc = ""]
580pub enum State {
581 #[serde(rename = "changed")]
582 Changed,
583 #[serde(rename = "deleted")]
584 Deleted,
585 #[serde(rename = "new")]
586 New,
587}
588impl TryFrom<&str> for State {
589 type Error = String;
590 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
591 match value {
592 "changed" => Ok(Self::Changed),
593 "deleted" => Ok(Self::Deleted),
594 "new" => Ok(Self::New),
595 v => Err(format!("Unknown variant {v}")),
596 }
597 }
598}
599#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
600#[doc = "Type of the zone."]
601#[doc = ""]
602pub enum Type {
603 #[serde(rename = "evpn")]
604 Evpn,
605 #[serde(rename = "faucet")]
606 Faucet,
607 #[serde(rename = "qinq")]
608 Qinq,
609 #[serde(rename = "simple")]
610 Simple,
611 #[serde(rename = "vlan")]
612 Vlan,
613 #[serde(rename = "vxlan")]
614 Vxlan,
615}
616impl TryFrom<&str> for Type {
617 type Error = String;
618 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
619 match value {
620 "evpn" => Ok(Self::Evpn),
621 "faucet" => Ok(Self::Faucet),
622 "qinq" => Ok(Self::Qinq),
623 "simple" => Ok(Self::Simple),
624 "vlan" => Ok(Self::Vlan),
625 "vxlan" => Ok(Self::Vxlan),
626 v => Err(format!("Unknown variant {v}")),
627 }
628 }
629}
630#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
631#[doc = "VLAN protocol for the creation of the QinQ zone. QinQ zone only."]
632#[doc = ""]
633pub enum VlanProtocol {
634 #[serde(rename = "802.1ad")]
635 _8021ad,
636 #[serde(rename = "802.1q")]
637 #[default]
638 _8021q,
639}
640impl TryFrom<&str> for VlanProtocol {
641 type Error = String;
642 fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
643 match value {
644 "802.1ad" => Ok(Self::_8021ad),
645 "802.1q" => Ok(Self::_8021q),
646 v => Err(format!("Unknown variant {v}")),
647 }
648 }
649}
650#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
651pub struct VrfVxlanInt(i128);
652impl crate::types::bounded_integer::BoundedInteger for VrfVxlanInt {
653 const MIN: Option<i128> = Some(1i128);
654 const MAX: Option<i128> = Some(16777215i128);
655 const DEFAULT: Option<i128> = None::<i128>;
656 const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 16777215";
657 fn get(&self) -> i128 {
658 self.0
659 }
660 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
661 Self::validate(value)?;
662 Ok(Self(value))
663 }
664}
665impl std::convert::TryFrom<i128> for VrfVxlanInt {
666 type Error = crate::types::bounded_integer::BoundedIntegerError;
667 fn try_from(value: i128) -> Result<Self, Self::Error> {
668 crate::types::bounded_integer::BoundedInteger::new(value)
669 }
670}
671impl ::serde::Serialize for VrfVxlanInt {
672 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
673 where
674 S: ::serde::Serializer,
675 {
676 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
677 }
678}
679impl<'de> ::serde::Deserialize<'de> for VrfVxlanInt {
680 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
681 where
682 D: ::serde::Deserializer<'de>,
683 {
684 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
685 }
686}
687#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
688pub struct VxlanPortInt(i128);
689impl crate::types::bounded_integer::BoundedInteger for VxlanPortInt {
690 const MIN: Option<i128> = Some(1i128);
691 const MAX: Option<i128> = Some(65536i128);
692 const DEFAULT: Option<i128> = Some(4789i128);
693 const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 65536";
694 fn get(&self) -> i128 {
695 self.0
696 }
697 fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
698 Self::validate(value)?;
699 Ok(Self(value))
700 }
701}
702impl std::convert::TryFrom<i128> for VxlanPortInt {
703 type Error = crate::types::bounded_integer::BoundedIntegerError;
704 fn try_from(value: i128) -> Result<Self, Self::Error> {
705 crate::types::bounded_integer::BoundedInteger::new(value)
706 }
707}
708impl ::serde::Serialize for VxlanPortInt {
709 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
710 where
711 S: ::serde::Serializer,
712 {
713 crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
714 }
715}
716impl<'de> ::serde::Deserialize<'de> for VxlanPortInt {
717 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
718 where
719 D: ::serde::Deserializer<'de>,
720 {
721 crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
722 }
723}
724#[derive(Debug, Clone, PartialEq, PartialOrd)]
725pub struct DeleteStr {
726 value: String,
727}
728impl crate::types::bounded_string::BoundedString for DeleteStr {
729 const MIN_LENGTH: Option<usize> = None::<usize>;
730 const MAX_LENGTH: Option<usize> = Some(4096usize);
731 const DEFAULT: Option<&'static str> = None::<&'static str>;
732 const PATTERN: Option<&'static str> = None::<&'static str>;
733 const TYPE_DESCRIPTION: &'static str = "a string with length at most 4096";
734 fn get_value(&self) -> &str {
735 &self.value
736 }
737 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
738 Self::validate(&value)?;
739 Ok(Self { value })
740 }
741}
742impl std::convert::TryFrom<String> for DeleteStr {
743 type Error = crate::types::bounded_string::BoundedStringError;
744 fn try_from(value: String) -> Result<Self, Self::Error> {
745 crate::types::bounded_string::BoundedString::new(value)
746 }
747}
748impl ::serde::Serialize for DeleteStr {
749 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
750 where
751 S: ::serde::Serializer,
752 {
753 crate::types::bounded_string::serialize_bounded_string(self, serializer)
754 }
755}
756impl<'de> ::serde::Deserialize<'de> for DeleteStr {
757 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
758 where
759 D: ::serde::Deserializer<'de>,
760 {
761 crate::types::bounded_string::deserialize_bounded_string(deserializer)
762 }
763}
764#[derive(Debug, Clone, PartialEq, PartialOrd)]
765pub struct DigestStr {
766 value: String,
767}
768impl crate::types::bounded_string::BoundedString for DigestStr {
769 const MIN_LENGTH: Option<usize> = None::<usize>;
770 const MAX_LENGTH: Option<usize> = Some(64usize);
771 const DEFAULT: Option<&'static str> = None::<&'static str>;
772 const PATTERN: Option<&'static str> = None::<&'static str>;
773 const TYPE_DESCRIPTION: &'static str = "a string with length at most 64";
774 fn get_value(&self) -> &str {
775 &self.value
776 }
777 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
778 Self::validate(&value)?;
779 Ok(Self { value })
780 }
781}
782impl std::convert::TryFrom<String> for DigestStr {
783 type Error = crate::types::bounded_string::BoundedStringError;
784 fn try_from(value: String) -> Result<Self, Self::Error> {
785 crate::types::bounded_string::BoundedString::new(value)
786 }
787}
788impl ::serde::Serialize for DigestStr {
789 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
790 where
791 S: ::serde::Serializer,
792 {
793 crate::types::bounded_string::serialize_bounded_string(self, serializer)
794 }
795}
796impl<'de> ::serde::Deserialize<'de> for DigestStr {
797 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
798 where
799 D: ::serde::Deserializer<'de>,
800 {
801 crate::types::bounded_string::deserialize_bounded_string(deserializer)
802 }
803}