proxmox-api 0.2.0

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