Skip to main content

clientapi_pve/apis/
cluster_sdn_api.rs

1/*
2 * Proxmox Virtual Environment API
3 *
4 * Generated from apidoc.js. NOT an official Proxmox specification. See https://pve.proxmox.com/pve-docs/api-viewer/ for the upstream documentation.
5 *
6 * The version of the OpenAPI document: 9.x
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`cluster_sdn_add_fabric`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ClusterSdnAddFabricError {
22    Status400(models::PveError),
23    Status401(models::PveError),
24    Status403(models::PveError),
25    Status404(models::PveError),
26    Status500(models::PveError),
27    Status501(models::PveError),
28    Status503(models::PveError),
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`cluster_sdn_add_node`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ClusterSdnAddNodeError {
36    Status400(models::PveError),
37    Status401(models::PveError),
38    Status403(models::PveError),
39    Status404(models::PveError),
40    Status500(models::PveError),
41    Status501(models::PveError),
42    Status503(models::PveError),
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`cluster_sdn_create_controllers`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ClusterSdnCreateControllersError {
50    Status400(models::PveError),
51    Status401(models::PveError),
52    Status403(models::PveError),
53    Status404(models::PveError),
54    Status500(models::PveError),
55    Status501(models::PveError),
56    Status503(models::PveError),
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`cluster_sdn_create_dns`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ClusterSdnCreateDnsError {
64    Status400(models::PveError),
65    Status401(models::PveError),
66    Status403(models::PveError),
67    Status404(models::PveError),
68    Status500(models::PveError),
69    Status501(models::PveError),
70    Status503(models::PveError),
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`cluster_sdn_create_entries`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum ClusterSdnCreateEntriesError {
78    Status400(models::PveError),
79    Status401(models::PveError),
80    Status403(models::PveError),
81    Status404(models::PveError),
82    Status500(models::PveError),
83    Status501(models::PveError),
84    Status503(models::PveError),
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`cluster_sdn_create_ipams`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ClusterSdnCreateIpamsError {
92    Status400(models::PveError),
93    Status401(models::PveError),
94    Status403(models::PveError),
95    Status404(models::PveError),
96    Status500(models::PveError),
97    Status501(models::PveError),
98    Status503(models::PveError),
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`cluster_sdn_create_prefix_list_entry`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ClusterSdnCreatePrefixListEntryError {
106    Status400(models::PveError),
107    Status401(models::PveError),
108    Status403(models::PveError),
109    Status404(models::PveError),
110    Status500(models::PveError),
111    Status501(models::PveError),
112    Status503(models::PveError),
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`cluster_sdn_create_route_map_entry`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum ClusterSdnCreateRouteMapEntryError {
120    Status400(models::PveError),
121    Status401(models::PveError),
122    Status403(models::PveError),
123    Status404(models::PveError),
124    Status500(models::PveError),
125    Status501(models::PveError),
126    Status503(models::PveError),
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`cluster_sdn_create_rule`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum ClusterSdnCreateRuleError {
134    Status400(models::PveError),
135    Status401(models::PveError),
136    Status403(models::PveError),
137    Status404(models::PveError),
138    Status500(models::PveError),
139    Status501(models::PveError),
140    Status503(models::PveError),
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`cluster_sdn_create_subnets`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum ClusterSdnCreateSubnetsError {
148    Status400(models::PveError),
149    Status401(models::PveError),
150    Status403(models::PveError),
151    Status404(models::PveError),
152    Status500(models::PveError),
153    Status501(models::PveError),
154    Status503(models::PveError),
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`cluster_sdn_create_vnets`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum ClusterSdnCreateVnetsError {
162    Status400(models::PveError),
163    Status401(models::PveError),
164    Status403(models::PveError),
165    Status404(models::PveError),
166    Status500(models::PveError),
167    Status501(models::PveError),
168    Status503(models::PveError),
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`cluster_sdn_create_zones`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum ClusterSdnCreateZonesError {
176    Status400(models::PveError),
177    Status401(models::PveError),
178    Status403(models::PveError),
179    Status404(models::PveError),
180    Status500(models::PveError),
181    Status501(models::PveError),
182    Status503(models::PveError),
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`cluster_sdn_delete_controllers`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum ClusterSdnDeleteControllersError {
190    Status400(models::PveError),
191    Status401(models::PveError),
192    Status403(models::PveError),
193    Status404(models::PveError),
194    Status500(models::PveError),
195    Status501(models::PveError),
196    Status503(models::PveError),
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`cluster_sdn_delete_dns`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum ClusterSdnDeleteDnsError {
204    Status400(models::PveError),
205    Status401(models::PveError),
206    Status403(models::PveError),
207    Status404(models::PveError),
208    Status500(models::PveError),
209    Status501(models::PveError),
210    Status503(models::PveError),
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`cluster_sdn_delete_fabric`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum ClusterSdnDeleteFabricError {
218    Status400(models::PveError),
219    Status401(models::PveError),
220    Status403(models::PveError),
221    Status404(models::PveError),
222    Status500(models::PveError),
223    Status501(models::PveError),
224    Status503(models::PveError),
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`cluster_sdn_delete_ipams`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum ClusterSdnDeleteIpamsError {
232    Status400(models::PveError),
233    Status401(models::PveError),
234    Status403(models::PveError),
235    Status404(models::PveError),
236    Status500(models::PveError),
237    Status501(models::PveError),
238    Status503(models::PveError),
239    UnknownValue(serde_json::Value),
240}
241
242/// struct for typed errors of method [`cluster_sdn_delete_node`]
243#[derive(Debug, Clone, Serialize, Deserialize)]
244#[serde(untagged)]
245pub enum ClusterSdnDeleteNodeError {
246    Status400(models::PveError),
247    Status401(models::PveError),
248    Status403(models::PveError),
249    Status404(models::PveError),
250    Status500(models::PveError),
251    Status501(models::PveError),
252    Status503(models::PveError),
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`cluster_sdn_delete_prefix_list`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum ClusterSdnDeletePrefixListError {
260    Status400(models::PveError),
261    Status401(models::PveError),
262    Status403(models::PveError),
263    Status404(models::PveError),
264    Status500(models::PveError),
265    Status501(models::PveError),
266    Status503(models::PveError),
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`cluster_sdn_delete_prefix_list_entry`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum ClusterSdnDeletePrefixListEntryError {
274    Status400(models::PveError),
275    Status401(models::PveError),
276    Status403(models::PveError),
277    Status404(models::PveError),
278    Status500(models::PveError),
279    Status501(models::PveError),
280    Status503(models::PveError),
281    UnknownValue(serde_json::Value),
282}
283
284/// struct for typed errors of method [`cluster_sdn_delete_route_map_entry`]
285#[derive(Debug, Clone, Serialize, Deserialize)]
286#[serde(untagged)]
287pub enum ClusterSdnDeleteRouteMapEntryError {
288    Status400(models::PveError),
289    Status401(models::PveError),
290    Status403(models::PveError),
291    Status404(models::PveError),
292    Status500(models::PveError),
293    Status501(models::PveError),
294    Status503(models::PveError),
295    UnknownValue(serde_json::Value),
296}
297
298/// struct for typed errors of method [`cluster_sdn_delete_rule`]
299#[derive(Debug, Clone, Serialize, Deserialize)]
300#[serde(untagged)]
301pub enum ClusterSdnDeleteRuleError {
302    Status400(models::PveError),
303    Status401(models::PveError),
304    Status403(models::PveError),
305    Status404(models::PveError),
306    Status500(models::PveError),
307    Status501(models::PveError),
308    Status503(models::PveError),
309    UnknownValue(serde_json::Value),
310}
311
312/// struct for typed errors of method [`cluster_sdn_delete_subnets`]
313#[derive(Debug, Clone, Serialize, Deserialize)]
314#[serde(untagged)]
315pub enum ClusterSdnDeleteSubnetsError {
316    Status400(models::PveError),
317    Status401(models::PveError),
318    Status403(models::PveError),
319    Status404(models::PveError),
320    Status500(models::PveError),
321    Status501(models::PveError),
322    Status503(models::PveError),
323    UnknownValue(serde_json::Value),
324}
325
326/// struct for typed errors of method [`cluster_sdn_delete_vnets`]
327#[derive(Debug, Clone, Serialize, Deserialize)]
328#[serde(untagged)]
329pub enum ClusterSdnDeleteVnetsError {
330    Status400(models::PveError),
331    Status401(models::PveError),
332    Status403(models::PveError),
333    Status404(models::PveError),
334    Status500(models::PveError),
335    Status501(models::PveError),
336    Status503(models::PveError),
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`cluster_sdn_delete_zones`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum ClusterSdnDeleteZonesError {
344    Status400(models::PveError),
345    Status401(models::PveError),
346    Status403(models::PveError),
347    Status404(models::PveError),
348    Status500(models::PveError),
349    Status501(models::PveError),
350    Status503(models::PveError),
351    UnknownValue(serde_json::Value),
352}
353
354/// struct for typed errors of method [`cluster_sdn_dry_run`]
355#[derive(Debug, Clone, Serialize, Deserialize)]
356#[serde(untagged)]
357pub enum ClusterSdnDryRunError {
358    Status400(models::PveError),
359    Status401(models::PveError),
360    Status403(models::PveError),
361    Status404(models::PveError),
362    Status500(models::PveError),
363    Status501(models::PveError),
364    Status503(models::PveError),
365    UnknownValue(serde_json::Value),
366}
367
368/// struct for typed errors of method [`cluster_sdn_get_controllers`]
369#[derive(Debug, Clone, Serialize, Deserialize)]
370#[serde(untagged)]
371pub enum ClusterSdnGetControllersError {
372    Status400(models::PveError),
373    Status401(models::PveError),
374    Status403(models::PveError),
375    Status404(models::PveError),
376    Status500(models::PveError),
377    Status501(models::PveError),
378    Status503(models::PveError),
379    UnknownValue(serde_json::Value),
380}
381
382/// struct for typed errors of method [`cluster_sdn_get_dns`]
383#[derive(Debug, Clone, Serialize, Deserialize)]
384#[serde(untagged)]
385pub enum ClusterSdnGetDnsError {
386    Status400(models::PveError),
387    Status401(models::PveError),
388    Status403(models::PveError),
389    Status404(models::PveError),
390    Status500(models::PveError),
391    Status501(models::PveError),
392    Status503(models::PveError),
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`cluster_sdn_get_fabric`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum ClusterSdnGetFabricError {
400    Status400(models::PveError),
401    Status401(models::PveError),
402    Status403(models::PveError),
403    Status404(models::PveError),
404    Status500(models::PveError),
405    Status501(models::PveError),
406    Status503(models::PveError),
407    UnknownValue(serde_json::Value),
408}
409
410/// struct for typed errors of method [`cluster_sdn_get_fabric_get_fabric`]
411#[derive(Debug, Clone, Serialize, Deserialize)]
412#[serde(untagged)]
413pub enum ClusterSdnGetFabricGetFabricError {
414    Status400(models::PveError),
415    Status401(models::PveError),
416    Status403(models::PveError),
417    Status404(models::PveError),
418    Status500(models::PveError),
419    Status501(models::PveError),
420    Status503(models::PveError),
421    UnknownValue(serde_json::Value),
422}
423
424/// struct for typed errors of method [`cluster_sdn_get_fabrics`]
425#[derive(Debug, Clone, Serialize, Deserialize)]
426#[serde(untagged)]
427pub enum ClusterSdnGetFabricsError {
428    Status400(models::PveError),
429    Status401(models::PveError),
430    Status403(models::PveError),
431    Status404(models::PveError),
432    Status500(models::PveError),
433    Status501(models::PveError),
434    Status503(models::PveError),
435    UnknownValue(serde_json::Value),
436}
437
438/// struct for typed errors of method [`cluster_sdn_get_firewall`]
439#[derive(Debug, Clone, Serialize, Deserialize)]
440#[serde(untagged)]
441pub enum ClusterSdnGetFirewallError {
442    Status400(models::PveError),
443    Status401(models::PveError),
444    Status403(models::PveError),
445    Status404(models::PveError),
446    Status500(models::PveError),
447    Status501(models::PveError),
448    Status503(models::PveError),
449    UnknownValue(serde_json::Value),
450}
451
452/// struct for typed errors of method [`cluster_sdn_get_ipams`]
453#[derive(Debug, Clone, Serialize, Deserialize)]
454#[serde(untagged)]
455pub enum ClusterSdnGetIpamsError {
456    Status400(models::PveError),
457    Status401(models::PveError),
458    Status403(models::PveError),
459    Status404(models::PveError),
460    Status500(models::PveError),
461    Status501(models::PveError),
462    Status503(models::PveError),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`cluster_sdn_get_node`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum ClusterSdnGetNodeError {
470    Status400(models::PveError),
471    Status401(models::PveError),
472    Status403(models::PveError),
473    Status404(models::PveError),
474    Status500(models::PveError),
475    Status501(models::PveError),
476    Status503(models::PveError),
477    UnknownValue(serde_json::Value),
478}
479
480/// struct for typed errors of method [`cluster_sdn_get_options`]
481#[derive(Debug, Clone, Serialize, Deserialize)]
482#[serde(untagged)]
483pub enum ClusterSdnGetOptionsError {
484    Status400(models::PveError),
485    Status401(models::PveError),
486    Status403(models::PveError),
487    Status404(models::PveError),
488    Status500(models::PveError),
489    Status501(models::PveError),
490    Status503(models::PveError),
491    UnknownValue(serde_json::Value),
492}
493
494/// struct for typed errors of method [`cluster_sdn_get_prefix_list`]
495#[derive(Debug, Clone, Serialize, Deserialize)]
496#[serde(untagged)]
497pub enum ClusterSdnGetPrefixListError {
498    Status400(models::PveError),
499    Status401(models::PveError),
500    Status403(models::PveError),
501    Status404(models::PveError),
502    Status500(models::PveError),
503    Status501(models::PveError),
504    Status503(models::PveError),
505    UnknownValue(serde_json::Value),
506}
507
508/// struct for typed errors of method [`cluster_sdn_get_prefix_list_entries`]
509#[derive(Debug, Clone, Serialize, Deserialize)]
510#[serde(untagged)]
511pub enum ClusterSdnGetPrefixListEntriesError {
512    Status400(models::PveError),
513    Status401(models::PveError),
514    Status403(models::PveError),
515    Status404(models::PveError),
516    Status500(models::PveError),
517    Status501(models::PveError),
518    Status503(models::PveError),
519    UnknownValue(serde_json::Value),
520}
521
522/// struct for typed errors of method [`cluster_sdn_get_prefix_list_entry`]
523#[derive(Debug, Clone, Serialize, Deserialize)]
524#[serde(untagged)]
525pub enum ClusterSdnGetPrefixListEntryError {
526    Status400(models::PveError),
527    Status401(models::PveError),
528    Status403(models::PveError),
529    Status404(models::PveError),
530    Status500(models::PveError),
531    Status501(models::PveError),
532    Status503(models::PveError),
533    UnknownValue(serde_json::Value),
534}
535
536/// struct for typed errors of method [`cluster_sdn_get_route_map_entry`]
537#[derive(Debug, Clone, Serialize, Deserialize)]
538#[serde(untagged)]
539pub enum ClusterSdnGetRouteMapEntryError {
540    Status400(models::PveError),
541    Status401(models::PveError),
542    Status403(models::PveError),
543    Status404(models::PveError),
544    Status500(models::PveError),
545    Status501(models::PveError),
546    Status503(models::PveError),
547    UnknownValue(serde_json::Value),
548}
549
550/// struct for typed errors of method [`cluster_sdn_get_rule`]
551#[derive(Debug, Clone, Serialize, Deserialize)]
552#[serde(untagged)]
553pub enum ClusterSdnGetRuleError {
554    Status400(models::PveError),
555    Status401(models::PveError),
556    Status403(models::PveError),
557    Status404(models::PveError),
558    Status500(models::PveError),
559    Status501(models::PveError),
560    Status503(models::PveError),
561    UnknownValue(serde_json::Value),
562}
563
564/// struct for typed errors of method [`cluster_sdn_get_rules`]
565#[derive(Debug, Clone, Serialize, Deserialize)]
566#[serde(untagged)]
567pub enum ClusterSdnGetRulesError {
568    Status400(models::PveError),
569    Status401(models::PveError),
570    Status403(models::PveError),
571    Status404(models::PveError),
572    Status500(models::PveError),
573    Status501(models::PveError),
574    Status503(models::PveError),
575    UnknownValue(serde_json::Value),
576}
577
578/// struct for typed errors of method [`cluster_sdn_get_sdn`]
579#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum ClusterSdnGetSdnError {
582    Status400(models::PveError),
583    Status401(models::PveError),
584    Status403(models::PveError),
585    Status404(models::PveError),
586    Status500(models::PveError),
587    Status501(models::PveError),
588    Status503(models::PveError),
589    UnknownValue(serde_json::Value),
590}
591
592/// struct for typed errors of method [`cluster_sdn_get_subnets`]
593#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum ClusterSdnGetSubnetsError {
596    Status400(models::PveError),
597    Status401(models::PveError),
598    Status403(models::PveError),
599    Status404(models::PveError),
600    Status500(models::PveError),
601    Status501(models::PveError),
602    Status503(models::PveError),
603    UnknownValue(serde_json::Value),
604}
605
606/// struct for typed errors of method [`cluster_sdn_get_vnets`]
607#[derive(Debug, Clone, Serialize, Deserialize)]
608#[serde(untagged)]
609pub enum ClusterSdnGetVnetsError {
610    Status400(models::PveError),
611    Status401(models::PveError),
612    Status403(models::PveError),
613    Status404(models::PveError),
614    Status500(models::PveError),
615    Status501(models::PveError),
616    Status503(models::PveError),
617    UnknownValue(serde_json::Value),
618}
619
620/// struct for typed errors of method [`cluster_sdn_get_zones`]
621#[derive(Debug, Clone, Serialize, Deserialize)]
622#[serde(untagged)]
623pub enum ClusterSdnGetZonesError {
624    Status400(models::PveError),
625    Status401(models::PveError),
626    Status403(models::PveError),
627    Status404(models::PveError),
628    Status500(models::PveError),
629    Status501(models::PveError),
630    Status503(models::PveError),
631    UnknownValue(serde_json::Value),
632}
633
634/// struct for typed errors of method [`cluster_sdn_ipamindex`]
635#[derive(Debug, Clone, Serialize, Deserialize)]
636#[serde(untagged)]
637pub enum ClusterSdnIpamindexError {
638    Status400(models::PveError),
639    Status401(models::PveError),
640    Status403(models::PveError),
641    Status404(models::PveError),
642    Status500(models::PveError),
643    Status501(models::PveError),
644    Status503(models::PveError),
645    UnknownValue(serde_json::Value),
646}
647
648/// struct for typed errors of method [`cluster_sdn_ipcreate`]
649#[derive(Debug, Clone, Serialize, Deserialize)]
650#[serde(untagged)]
651pub enum ClusterSdnIpcreateError {
652    Status400(models::PveError),
653    Status401(models::PveError),
654    Status403(models::PveError),
655    Status404(models::PveError),
656    Status500(models::PveError),
657    Status501(models::PveError),
658    Status503(models::PveError),
659    UnknownValue(serde_json::Value),
660}
661
662/// struct for typed errors of method [`cluster_sdn_ipdelete`]
663#[derive(Debug, Clone, Serialize, Deserialize)]
664#[serde(untagged)]
665pub enum ClusterSdnIpdeleteError {
666    Status400(models::PveError),
667    Status401(models::PveError),
668    Status403(models::PveError),
669    Status404(models::PveError),
670    Status500(models::PveError),
671    Status501(models::PveError),
672    Status503(models::PveError),
673    UnknownValue(serde_json::Value),
674}
675
676/// struct for typed errors of method [`cluster_sdn_ipupdate`]
677#[derive(Debug, Clone, Serialize, Deserialize)]
678#[serde(untagged)]
679pub enum ClusterSdnIpupdateError {
680    Status400(models::PveError),
681    Status401(models::PveError),
682    Status403(models::PveError),
683    Status404(models::PveError),
684    Status500(models::PveError),
685    Status501(models::PveError),
686    Status503(models::PveError),
687    UnknownValue(serde_json::Value),
688}
689
690/// struct for typed errors of method [`cluster_sdn_list_all`]
691#[derive(Debug, Clone, Serialize, Deserialize)]
692#[serde(untagged)]
693pub enum ClusterSdnListAllError {
694    Status400(models::PveError),
695    Status401(models::PveError),
696    Status403(models::PveError),
697    Status404(models::PveError),
698    Status500(models::PveError),
699    Status501(models::PveError),
700    Status503(models::PveError),
701    UnknownValue(serde_json::Value),
702}
703
704/// struct for typed errors of method [`cluster_sdn_list_nodes`]
705#[derive(Debug, Clone, Serialize, Deserialize)]
706#[serde(untagged)]
707pub enum ClusterSdnListNodesError {
708    Status400(models::PveError),
709    Status401(models::PveError),
710    Status403(models::PveError),
711    Status404(models::PveError),
712    Status500(models::PveError),
713    Status501(models::PveError),
714    Status503(models::PveError),
715    UnknownValue(serde_json::Value),
716}
717
718/// struct for typed errors of method [`cluster_sdn_list_nodes_fabric`]
719#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum ClusterSdnListNodesFabricError {
722    Status400(models::PveError),
723    Status401(models::PveError),
724    Status403(models::PveError),
725    Status404(models::PveError),
726    Status500(models::PveError),
727    Status501(models::PveError),
728    Status503(models::PveError),
729    UnknownValue(serde_json::Value),
730}
731
732/// struct for typed errors of method [`cluster_sdn_list_prefix_lists`]
733#[derive(Debug, Clone, Serialize, Deserialize)]
734#[serde(untagged)]
735pub enum ClusterSdnListPrefixListsError {
736    Status400(models::PveError),
737    Status401(models::PveError),
738    Status403(models::PveError),
739    Status404(models::PveError),
740    Status500(models::PveError),
741    Status501(models::PveError),
742    Status503(models::PveError),
743    UnknownValue(serde_json::Value),
744}
745
746/// struct for typed errors of method [`cluster_sdn_list_route_map_entries`]
747#[derive(Debug, Clone, Serialize, Deserialize)]
748#[serde(untagged)]
749pub enum ClusterSdnListRouteMapEntriesError {
750    Status400(models::PveError),
751    Status401(models::PveError),
752    Status403(models::PveError),
753    Status404(models::PveError),
754    Status500(models::PveError),
755    Status501(models::PveError),
756    Status503(models::PveError),
757    UnknownValue(serde_json::Value),
758}
759
760/// struct for typed errors of method [`cluster_sdn_list_route_map_entries_for_route_map`]
761#[derive(Debug, Clone, Serialize, Deserialize)]
762#[serde(untagged)]
763pub enum ClusterSdnListRouteMapEntriesForRouteMapError {
764    Status400(models::PveError),
765    Status401(models::PveError),
766    Status403(models::PveError),
767    Status404(models::PveError),
768    Status500(models::PveError),
769    Status501(models::PveError),
770    Status503(models::PveError),
771    UnknownValue(serde_json::Value),
772}
773
774/// struct for typed errors of method [`cluster_sdn_list_route_maps`]
775#[derive(Debug, Clone, Serialize, Deserialize)]
776#[serde(untagged)]
777pub enum ClusterSdnListRouteMapsError {
778    Status400(models::PveError),
779    Status401(models::PveError),
780    Status403(models::PveError),
781    Status404(models::PveError),
782    Status500(models::PveError),
783    Status501(models::PveError),
784    Status503(models::PveError),
785    UnknownValue(serde_json::Value),
786}
787
788/// struct for typed errors of method [`cluster_sdn_lock`]
789#[derive(Debug, Clone, Serialize, Deserialize)]
790#[serde(untagged)]
791pub enum ClusterSdnLockError {
792    Status400(models::PveError),
793    Status401(models::PveError),
794    Status403(models::PveError),
795    Status404(models::PveError),
796    Status500(models::PveError),
797    Status501(models::PveError),
798    Status503(models::PveError),
799    UnknownValue(serde_json::Value),
800}
801
802/// struct for typed errors of method [`cluster_sdn_read_get_controllers`]
803#[derive(Debug, Clone, Serialize, Deserialize)]
804#[serde(untagged)]
805pub enum ClusterSdnReadGetControllersError {
806    Status400(models::PveError),
807    Status401(models::PveError),
808    Status403(models::PveError),
809    Status404(models::PveError),
810    Status500(models::PveError),
811    Status501(models::PveError),
812    Status503(models::PveError),
813    UnknownValue(serde_json::Value),
814}
815
816/// struct for typed errors of method [`cluster_sdn_read_get_dns`]
817#[derive(Debug, Clone, Serialize, Deserialize)]
818#[serde(untagged)]
819pub enum ClusterSdnReadGetDnsError {
820    Status400(models::PveError),
821    Status401(models::PveError),
822    Status403(models::PveError),
823    Status404(models::PveError),
824    Status500(models::PveError),
825    Status501(models::PveError),
826    Status503(models::PveError),
827    UnknownValue(serde_json::Value),
828}
829
830/// struct for typed errors of method [`cluster_sdn_read_get_ipams`]
831#[derive(Debug, Clone, Serialize, Deserialize)]
832#[serde(untagged)]
833pub enum ClusterSdnReadGetIpamsError {
834    Status400(models::PveError),
835    Status401(models::PveError),
836    Status403(models::PveError),
837    Status404(models::PveError),
838    Status500(models::PveError),
839    Status501(models::PveError),
840    Status503(models::PveError),
841    UnknownValue(serde_json::Value),
842}
843
844/// struct for typed errors of method [`cluster_sdn_read_get_subnets`]
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum ClusterSdnReadGetSubnetsError {
848    Status400(models::PveError),
849    Status401(models::PveError),
850    Status403(models::PveError),
851    Status404(models::PveError),
852    Status500(models::PveError),
853    Status501(models::PveError),
854    Status503(models::PveError),
855    UnknownValue(serde_json::Value),
856}
857
858/// struct for typed errors of method [`cluster_sdn_read_get_vnets`]
859#[derive(Debug, Clone, Serialize, Deserialize)]
860#[serde(untagged)]
861pub enum ClusterSdnReadGetVnetsError {
862    Status400(models::PveError),
863    Status401(models::PveError),
864    Status403(models::PveError),
865    Status404(models::PveError),
866    Status500(models::PveError),
867    Status501(models::PveError),
868    Status503(models::PveError),
869    UnknownValue(serde_json::Value),
870}
871
872/// struct for typed errors of method [`cluster_sdn_read_get_zones`]
873#[derive(Debug, Clone, Serialize, Deserialize)]
874#[serde(untagged)]
875pub enum ClusterSdnReadGetZonesError {
876    Status400(models::PveError),
877    Status401(models::PveError),
878    Status403(models::PveError),
879    Status404(models::PveError),
880    Status500(models::PveError),
881    Status501(models::PveError),
882    Status503(models::PveError),
883    UnknownValue(serde_json::Value),
884}
885
886/// struct for typed errors of method [`cluster_sdn_release_lock`]
887#[derive(Debug, Clone, Serialize, Deserialize)]
888#[serde(untagged)]
889pub enum ClusterSdnReleaseLockError {
890    Status400(models::PveError),
891    Status401(models::PveError),
892    Status403(models::PveError),
893    Status404(models::PveError),
894    Status500(models::PveError),
895    Status501(models::PveError),
896    Status503(models::PveError),
897    UnknownValue(serde_json::Value),
898}
899
900/// struct for typed errors of method [`cluster_sdn_reload`]
901#[derive(Debug, Clone, Serialize, Deserialize)]
902#[serde(untagged)]
903pub enum ClusterSdnReloadError {
904    Status400(models::PveError),
905    Status401(models::PveError),
906    Status403(models::PveError),
907    Status404(models::PveError),
908    Status500(models::PveError),
909    Status501(models::PveError),
910    Status503(models::PveError),
911    UnknownValue(serde_json::Value),
912}
913
914/// struct for typed errors of method [`cluster_sdn_rollback`]
915#[derive(Debug, Clone, Serialize, Deserialize)]
916#[serde(untagged)]
917pub enum ClusterSdnRollbackError {
918    Status400(models::PveError),
919    Status401(models::PveError),
920    Status403(models::PveError),
921    Status404(models::PveError),
922    Status500(models::PveError),
923    Status501(models::PveError),
924    Status503(models::PveError),
925    UnknownValue(serde_json::Value),
926}
927
928/// struct for typed errors of method [`cluster_sdn_set_options`]
929#[derive(Debug, Clone, Serialize, Deserialize)]
930#[serde(untagged)]
931pub enum ClusterSdnSetOptionsError {
932    Status400(models::PveError),
933    Status401(models::PveError),
934    Status403(models::PveError),
935    Status404(models::PveError),
936    Status500(models::PveError),
937    Status501(models::PveError),
938    Status503(models::PveError),
939    UnknownValue(serde_json::Value),
940}
941
942/// struct for typed errors of method [`cluster_sdn_update_controllers`]
943#[derive(Debug, Clone, Serialize, Deserialize)]
944#[serde(untagged)]
945pub enum ClusterSdnUpdateControllersError {
946    Status400(models::PveError),
947    Status401(models::PveError),
948    Status403(models::PveError),
949    Status404(models::PveError),
950    Status500(models::PveError),
951    Status501(models::PveError),
952    Status503(models::PveError),
953    UnknownValue(serde_json::Value),
954}
955
956/// struct for typed errors of method [`cluster_sdn_update_dns`]
957#[derive(Debug, Clone, Serialize, Deserialize)]
958#[serde(untagged)]
959pub enum ClusterSdnUpdateDnsError {
960    Status400(models::PveError),
961    Status401(models::PveError),
962    Status403(models::PveError),
963    Status404(models::PveError),
964    Status500(models::PveError),
965    Status501(models::PveError),
966    Status503(models::PveError),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`cluster_sdn_update_fabric`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum ClusterSdnUpdateFabricError {
974    Status400(models::PveError),
975    Status401(models::PveError),
976    Status403(models::PveError),
977    Status404(models::PveError),
978    Status500(models::PveError),
979    Status501(models::PveError),
980    Status503(models::PveError),
981    UnknownValue(serde_json::Value),
982}
983
984/// struct for typed errors of method [`cluster_sdn_update_ipams`]
985#[derive(Debug, Clone, Serialize, Deserialize)]
986#[serde(untagged)]
987pub enum ClusterSdnUpdateIpamsError {
988    Status400(models::PveError),
989    Status401(models::PveError),
990    Status403(models::PveError),
991    Status404(models::PveError),
992    Status500(models::PveError),
993    Status501(models::PveError),
994    Status503(models::PveError),
995    UnknownValue(serde_json::Value),
996}
997
998/// struct for typed errors of method [`cluster_sdn_update_node`]
999#[derive(Debug, Clone, Serialize, Deserialize)]
1000#[serde(untagged)]
1001pub enum ClusterSdnUpdateNodeError {
1002    Status400(models::PveError),
1003    Status401(models::PveError),
1004    Status403(models::PveError),
1005    Status404(models::PveError),
1006    Status500(models::PveError),
1007    Status501(models::PveError),
1008    Status503(models::PveError),
1009    UnknownValue(serde_json::Value),
1010}
1011
1012/// struct for typed errors of method [`cluster_sdn_update_prefix_list`]
1013#[derive(Debug, Clone, Serialize, Deserialize)]
1014#[serde(untagged)]
1015pub enum ClusterSdnUpdatePrefixListError {
1016    Status400(models::PveError),
1017    Status401(models::PveError),
1018    Status403(models::PveError),
1019    Status404(models::PveError),
1020    Status500(models::PveError),
1021    Status501(models::PveError),
1022    Status503(models::PveError),
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`cluster_sdn_update_prefix_list_entry`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum ClusterSdnUpdatePrefixListEntryError {
1030    Status400(models::PveError),
1031    Status401(models::PveError),
1032    Status403(models::PveError),
1033    Status404(models::PveError),
1034    Status500(models::PveError),
1035    Status501(models::PveError),
1036    Status503(models::PveError),
1037    UnknownValue(serde_json::Value),
1038}
1039
1040/// struct for typed errors of method [`cluster_sdn_update_route_map_entry`]
1041#[derive(Debug, Clone, Serialize, Deserialize)]
1042#[serde(untagged)]
1043pub enum ClusterSdnUpdateRouteMapEntryError {
1044    Status400(models::PveError),
1045    Status401(models::PveError),
1046    Status403(models::PveError),
1047    Status404(models::PveError),
1048    Status500(models::PveError),
1049    Status501(models::PveError),
1050    Status503(models::PveError),
1051    UnknownValue(serde_json::Value),
1052}
1053
1054/// struct for typed errors of method [`cluster_sdn_update_rule`]
1055#[derive(Debug, Clone, Serialize, Deserialize)]
1056#[serde(untagged)]
1057pub enum ClusterSdnUpdateRuleError {
1058    Status400(models::PveError),
1059    Status401(models::PveError),
1060    Status403(models::PveError),
1061    Status404(models::PveError),
1062    Status500(models::PveError),
1063    Status501(models::PveError),
1064    Status503(models::PveError),
1065    UnknownValue(serde_json::Value),
1066}
1067
1068/// struct for typed errors of method [`cluster_sdn_update_subnets`]
1069#[derive(Debug, Clone, Serialize, Deserialize)]
1070#[serde(untagged)]
1071pub enum ClusterSdnUpdateSubnetsError {
1072    Status400(models::PveError),
1073    Status401(models::PveError),
1074    Status403(models::PveError),
1075    Status404(models::PveError),
1076    Status500(models::PveError),
1077    Status501(models::PveError),
1078    Status503(models::PveError),
1079    UnknownValue(serde_json::Value),
1080}
1081
1082/// struct for typed errors of method [`cluster_sdn_update_vnets`]
1083#[derive(Debug, Clone, Serialize, Deserialize)]
1084#[serde(untagged)]
1085pub enum ClusterSdnUpdateVnetsError {
1086    Status400(models::PveError),
1087    Status401(models::PveError),
1088    Status403(models::PveError),
1089    Status404(models::PveError),
1090    Status500(models::PveError),
1091    Status501(models::PveError),
1092    Status503(models::PveError),
1093    UnknownValue(serde_json::Value),
1094}
1095
1096/// struct for typed errors of method [`cluster_sdn_update_zones`]
1097#[derive(Debug, Clone, Serialize, Deserialize)]
1098#[serde(untagged)]
1099pub enum ClusterSdnUpdateZonesError {
1100    Status400(models::PveError),
1101    Status401(models::PveError),
1102    Status403(models::PveError),
1103    Status404(models::PveError),
1104    Status500(models::PveError),
1105    Status501(models::PveError),
1106    Status503(models::PveError),
1107    UnknownValue(serde_json::Value),
1108}
1109
1110
1111/// Add a fabric
1112pub async fn cluster_sdn_add_fabric(configuration: &configuration::Configuration, cluster_sdn_add_fabric_request: models::ClusterSdnAddFabricRequest) -> Result<models::ClusterSdnAddFabricResponse, Error<ClusterSdnAddFabricError>> {
1113    // add a prefix to parameters to efficiently prevent name collisions
1114    let p_body_cluster_sdn_add_fabric_request = cluster_sdn_add_fabric_request;
1115
1116    let uri_str = format!("{}/cluster/sdn/fabrics/fabric", configuration.base_path);
1117    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1118
1119    if let Some(ref user_agent) = configuration.user_agent {
1120        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1121    }
1122    if let Some(ref apikey) = configuration.api_key {
1123        let key = apikey.key.clone();
1124        let value = match apikey.prefix {
1125            Some(ref prefix) => format!("{} {}", prefix, key),
1126            None => key,
1127        };
1128        req_builder = req_builder.header("Authorization", value);
1129    };
1130    if let Some(ref apikey) = configuration.api_key {
1131        let key = apikey.key.clone();
1132        let value = match apikey.prefix {
1133            Some(ref prefix) => format!("{} {}", prefix, key),
1134            None => key,
1135        };
1136        req_builder = req_builder.header("CSRFPreventionToken", value);
1137    };
1138    req_builder = req_builder.json(&p_body_cluster_sdn_add_fabric_request);
1139
1140    let req = req_builder.build()?;
1141    let resp = configuration.client.execute(req).await?;
1142
1143    let status = resp.status();
1144    let content_type = resp
1145        .headers()
1146        .get("content-type")
1147        .and_then(|v| v.to_str().ok())
1148        .unwrap_or("application/octet-stream");
1149    let content_type = super::ContentType::from(content_type);
1150
1151    if !status.is_client_error() && !status.is_server_error() {
1152        let content = resp.text().await?;
1153        match content_type {
1154            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1155            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnAddFabricResponse`"))),
1156            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnAddFabricResponse`")))),
1157        }
1158    } else {
1159        let content = resp.text().await?;
1160        let entity: Option<ClusterSdnAddFabricError> = serde_json::from_str(&content).ok();
1161        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1162    }
1163}
1164
1165/// Add a node
1166pub async fn cluster_sdn_add_node(configuration: &configuration::Configuration, fabric_id: &str, cluster_sdn_add_node_request: models::ClusterSdnAddNodeRequest) -> Result<models::ClusterSdnAddNodeResponse, Error<ClusterSdnAddNodeError>> {
1167    // add a prefix to parameters to efficiently prevent name collisions
1168    let p_path_fabric_id = fabric_id;
1169    let p_body_cluster_sdn_add_node_request = cluster_sdn_add_node_request;
1170
1171    let uri_str = format!("{}/cluster/sdn/fabrics/node/{fabric_id}", configuration.base_path, fabric_id=crate::apis::urlencode(p_path_fabric_id));
1172    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1173
1174    if let Some(ref user_agent) = configuration.user_agent {
1175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1176    }
1177    if let Some(ref apikey) = configuration.api_key {
1178        let key = apikey.key.clone();
1179        let value = match apikey.prefix {
1180            Some(ref prefix) => format!("{} {}", prefix, key),
1181            None => key,
1182        };
1183        req_builder = req_builder.header("Authorization", value);
1184    };
1185    if let Some(ref apikey) = configuration.api_key {
1186        let key = apikey.key.clone();
1187        let value = match apikey.prefix {
1188            Some(ref prefix) => format!("{} {}", prefix, key),
1189            None => key,
1190        };
1191        req_builder = req_builder.header("CSRFPreventionToken", value);
1192    };
1193    req_builder = req_builder.json(&p_body_cluster_sdn_add_node_request);
1194
1195    let req = req_builder.build()?;
1196    let resp = configuration.client.execute(req).await?;
1197
1198    let status = resp.status();
1199    let content_type = resp
1200        .headers()
1201        .get("content-type")
1202        .and_then(|v| v.to_str().ok())
1203        .unwrap_or("application/octet-stream");
1204    let content_type = super::ContentType::from(content_type);
1205
1206    if !status.is_client_error() && !status.is_server_error() {
1207        let content = resp.text().await?;
1208        match content_type {
1209            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1210            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnAddNodeResponse`"))),
1211            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnAddNodeResponse`")))),
1212        }
1213    } else {
1214        let content = resp.text().await?;
1215        let entity: Option<ClusterSdnAddNodeError> = serde_json::from_str(&content).ok();
1216        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1217    }
1218}
1219
1220/// Create a new sdn controller object.
1221pub async fn cluster_sdn_create_controllers(configuration: &configuration::Configuration, cluster_sdn_create_controllers_request: models::ClusterSdnCreateControllersRequest) -> Result<models::ClusterSdnCreateControllersResponse, Error<ClusterSdnCreateControllersError>> {
1222    // add a prefix to parameters to efficiently prevent name collisions
1223    let p_body_cluster_sdn_create_controllers_request = cluster_sdn_create_controllers_request;
1224
1225    let uri_str = format!("{}/cluster/sdn/controllers", configuration.base_path);
1226    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1227
1228    if let Some(ref user_agent) = configuration.user_agent {
1229        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1230    }
1231    if let Some(ref apikey) = configuration.api_key {
1232        let key = apikey.key.clone();
1233        let value = match apikey.prefix {
1234            Some(ref prefix) => format!("{} {}", prefix, key),
1235            None => key,
1236        };
1237        req_builder = req_builder.header("Authorization", value);
1238    };
1239    if let Some(ref apikey) = configuration.api_key {
1240        let key = apikey.key.clone();
1241        let value = match apikey.prefix {
1242            Some(ref prefix) => format!("{} {}", prefix, key),
1243            None => key,
1244        };
1245        req_builder = req_builder.header("CSRFPreventionToken", value);
1246    };
1247    req_builder = req_builder.json(&p_body_cluster_sdn_create_controllers_request);
1248
1249    let req = req_builder.build()?;
1250    let resp = configuration.client.execute(req).await?;
1251
1252    let status = resp.status();
1253    let content_type = resp
1254        .headers()
1255        .get("content-type")
1256        .and_then(|v| v.to_str().ok())
1257        .unwrap_or("application/octet-stream");
1258    let content_type = super::ContentType::from(content_type);
1259
1260    if !status.is_client_error() && !status.is_server_error() {
1261        let content = resp.text().await?;
1262        match content_type {
1263            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1264            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateControllersResponse`"))),
1265            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateControllersResponse`")))),
1266        }
1267    } else {
1268        let content = resp.text().await?;
1269        let entity: Option<ClusterSdnCreateControllersError> = serde_json::from_str(&content).ok();
1270        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1271    }
1272}
1273
1274/// Create a new sdn dns object.
1275pub async fn cluster_sdn_create_dns(configuration: &configuration::Configuration, cluster_sdn_create_dns_request: models::ClusterSdnCreateDnsRequest) -> Result<models::ClusterSdnCreateDnsResponse, Error<ClusterSdnCreateDnsError>> {
1276    // add a prefix to parameters to efficiently prevent name collisions
1277    let p_body_cluster_sdn_create_dns_request = cluster_sdn_create_dns_request;
1278
1279    let uri_str = format!("{}/cluster/sdn/dns", configuration.base_path);
1280    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1281
1282    if let Some(ref user_agent) = configuration.user_agent {
1283        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1284    }
1285    if let Some(ref apikey) = configuration.api_key {
1286        let key = apikey.key.clone();
1287        let value = match apikey.prefix {
1288            Some(ref prefix) => format!("{} {}", prefix, key),
1289            None => key,
1290        };
1291        req_builder = req_builder.header("Authorization", value);
1292    };
1293    if let Some(ref apikey) = configuration.api_key {
1294        let key = apikey.key.clone();
1295        let value = match apikey.prefix {
1296            Some(ref prefix) => format!("{} {}", prefix, key),
1297            None => key,
1298        };
1299        req_builder = req_builder.header("CSRFPreventionToken", value);
1300    };
1301    req_builder = req_builder.json(&p_body_cluster_sdn_create_dns_request);
1302
1303    let req = req_builder.build()?;
1304    let resp = configuration.client.execute(req).await?;
1305
1306    let status = resp.status();
1307    let content_type = resp
1308        .headers()
1309        .get("content-type")
1310        .and_then(|v| v.to_str().ok())
1311        .unwrap_or("application/octet-stream");
1312    let content_type = super::ContentType::from(content_type);
1313
1314    if !status.is_client_error() && !status.is_server_error() {
1315        let content = resp.text().await?;
1316        match content_type {
1317            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1318            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateDnsResponse`"))),
1319            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateDnsResponse`")))),
1320        }
1321    } else {
1322        let content = resp.text().await?;
1323        let entity: Option<ClusterSdnCreateDnsError> = serde_json::from_str(&content).ok();
1324        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1325    }
1326}
1327
1328/// Create Prefix List Entry
1329pub async fn cluster_sdn_create_entries(configuration: &configuration::Configuration, id: &str, cluster_sdn_create_entries_request: models::ClusterSdnCreateEntriesRequest) -> Result<models::ClusterSdnCreateEntriesResponse, Error<ClusterSdnCreateEntriesError>> {
1330    // add a prefix to parameters to efficiently prevent name collisions
1331    let p_path_id = id;
1332    let p_body_cluster_sdn_create_entries_request = cluster_sdn_create_entries_request;
1333
1334    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}/entries", configuration.base_path, id=crate::apis::urlencode(p_path_id));
1335    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1336
1337    if let Some(ref user_agent) = configuration.user_agent {
1338        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1339    }
1340    if let Some(ref apikey) = configuration.api_key {
1341        let key = apikey.key.clone();
1342        let value = match apikey.prefix {
1343            Some(ref prefix) => format!("{} {}", prefix, key),
1344            None => key,
1345        };
1346        req_builder = req_builder.header("Authorization", value);
1347    };
1348    if let Some(ref apikey) = configuration.api_key {
1349        let key = apikey.key.clone();
1350        let value = match apikey.prefix {
1351            Some(ref prefix) => format!("{} {}", prefix, key),
1352            None => key,
1353        };
1354        req_builder = req_builder.header("CSRFPreventionToken", value);
1355    };
1356    req_builder = req_builder.json(&p_body_cluster_sdn_create_entries_request);
1357
1358    let req = req_builder.build()?;
1359    let resp = configuration.client.execute(req).await?;
1360
1361    let status = resp.status();
1362    let content_type = resp
1363        .headers()
1364        .get("content-type")
1365        .and_then(|v| v.to_str().ok())
1366        .unwrap_or("application/octet-stream");
1367    let content_type = super::ContentType::from(content_type);
1368
1369    if !status.is_client_error() && !status.is_server_error() {
1370        let content = resp.text().await?;
1371        match content_type {
1372            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1373            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateEntriesResponse`"))),
1374            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateEntriesResponse`")))),
1375        }
1376    } else {
1377        let content = resp.text().await?;
1378        let entity: Option<ClusterSdnCreateEntriesError> = serde_json::from_str(&content).ok();
1379        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1380    }
1381}
1382
1383/// Create a new sdn ipam object.
1384pub async fn cluster_sdn_create_ipams(configuration: &configuration::Configuration, cluster_sdn_create_ipams_request: models::ClusterSdnCreateIpamsRequest) -> Result<models::ClusterSdnCreateIpamsResponse, Error<ClusterSdnCreateIpamsError>> {
1385    // add a prefix to parameters to efficiently prevent name collisions
1386    let p_body_cluster_sdn_create_ipams_request = cluster_sdn_create_ipams_request;
1387
1388    let uri_str = format!("{}/cluster/sdn/ipams", configuration.base_path);
1389    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1390
1391    if let Some(ref user_agent) = configuration.user_agent {
1392        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1393    }
1394    if let Some(ref apikey) = configuration.api_key {
1395        let key = apikey.key.clone();
1396        let value = match apikey.prefix {
1397            Some(ref prefix) => format!("{} {}", prefix, key),
1398            None => key,
1399        };
1400        req_builder = req_builder.header("Authorization", value);
1401    };
1402    if let Some(ref apikey) = configuration.api_key {
1403        let key = apikey.key.clone();
1404        let value = match apikey.prefix {
1405            Some(ref prefix) => format!("{} {}", prefix, key),
1406            None => key,
1407        };
1408        req_builder = req_builder.header("CSRFPreventionToken", value);
1409    };
1410    req_builder = req_builder.json(&p_body_cluster_sdn_create_ipams_request);
1411
1412    let req = req_builder.build()?;
1413    let resp = configuration.client.execute(req).await?;
1414
1415    let status = resp.status();
1416    let content_type = resp
1417        .headers()
1418        .get("content-type")
1419        .and_then(|v| v.to_str().ok())
1420        .unwrap_or("application/octet-stream");
1421    let content_type = super::ContentType::from(content_type);
1422
1423    if !status.is_client_error() && !status.is_server_error() {
1424        let content = resp.text().await?;
1425        match content_type {
1426            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1427            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateIpamsResponse`"))),
1428            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateIpamsResponse`")))),
1429        }
1430    } else {
1431        let content = resp.text().await?;
1432        let entity: Option<ClusterSdnCreateIpamsError> = serde_json::from_str(&content).ok();
1433        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1434    }
1435}
1436
1437/// Create Prefix List
1438pub async fn cluster_sdn_create_prefix_list_entry(configuration: &configuration::Configuration, cluster_sdn_create_prefix_list_entry_request: models::ClusterSdnCreatePrefixListEntryRequest) -> Result<models::ClusterSdnCreatePrefixListEntryResponse, Error<ClusterSdnCreatePrefixListEntryError>> {
1439    // add a prefix to parameters to efficiently prevent name collisions
1440    let p_body_cluster_sdn_create_prefix_list_entry_request = cluster_sdn_create_prefix_list_entry_request;
1441
1442    let uri_str = format!("{}/cluster/sdn/prefix-lists", configuration.base_path);
1443    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1444
1445    if let Some(ref user_agent) = configuration.user_agent {
1446        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1447    }
1448    if let Some(ref apikey) = configuration.api_key {
1449        let key = apikey.key.clone();
1450        let value = match apikey.prefix {
1451            Some(ref prefix) => format!("{} {}", prefix, key),
1452            None => key,
1453        };
1454        req_builder = req_builder.header("Authorization", value);
1455    };
1456    if let Some(ref apikey) = configuration.api_key {
1457        let key = apikey.key.clone();
1458        let value = match apikey.prefix {
1459            Some(ref prefix) => format!("{} {}", prefix, key),
1460            None => key,
1461        };
1462        req_builder = req_builder.header("CSRFPreventionToken", value);
1463    };
1464    req_builder = req_builder.json(&p_body_cluster_sdn_create_prefix_list_entry_request);
1465
1466    let req = req_builder.build()?;
1467    let resp = configuration.client.execute(req).await?;
1468
1469    let status = resp.status();
1470    let content_type = resp
1471        .headers()
1472        .get("content-type")
1473        .and_then(|v| v.to_str().ok())
1474        .unwrap_or("application/octet-stream");
1475    let content_type = super::ContentType::from(content_type);
1476
1477    if !status.is_client_error() && !status.is_server_error() {
1478        let content = resp.text().await?;
1479        match content_type {
1480            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1481            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreatePrefixListEntryResponse`"))),
1482            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreatePrefixListEntryResponse`")))),
1483        }
1484    } else {
1485        let content = resp.text().await?;
1486        let entity: Option<ClusterSdnCreatePrefixListEntryError> = serde_json::from_str(&content).ok();
1487        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1488    }
1489}
1490
1491/// Create Route Map entry
1492pub async fn cluster_sdn_create_route_map_entry(configuration: &configuration::Configuration, cluster_sdn_create_route_map_entry_request: models::ClusterSdnCreateRouteMapEntryRequest) -> Result<models::ClusterSdnCreateRouteMapEntryResponse, Error<ClusterSdnCreateRouteMapEntryError>> {
1493    // add a prefix to parameters to efficiently prevent name collisions
1494    let p_body_cluster_sdn_create_route_map_entry_request = cluster_sdn_create_route_map_entry_request;
1495
1496    let uri_str = format!("{}/cluster/sdn/route-maps/entries", configuration.base_path);
1497    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1498
1499    if let Some(ref user_agent) = configuration.user_agent {
1500        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1501    }
1502    if let Some(ref apikey) = configuration.api_key {
1503        let key = apikey.key.clone();
1504        let value = match apikey.prefix {
1505            Some(ref prefix) => format!("{} {}", prefix, key),
1506            None => key,
1507        };
1508        req_builder = req_builder.header("Authorization", value);
1509    };
1510    if let Some(ref apikey) = configuration.api_key {
1511        let key = apikey.key.clone();
1512        let value = match apikey.prefix {
1513            Some(ref prefix) => format!("{} {}", prefix, key),
1514            None => key,
1515        };
1516        req_builder = req_builder.header("CSRFPreventionToken", value);
1517    };
1518    req_builder = req_builder.json(&p_body_cluster_sdn_create_route_map_entry_request);
1519
1520    let req = req_builder.build()?;
1521    let resp = configuration.client.execute(req).await?;
1522
1523    let status = resp.status();
1524    let content_type = resp
1525        .headers()
1526        .get("content-type")
1527        .and_then(|v| v.to_str().ok())
1528        .unwrap_or("application/octet-stream");
1529    let content_type = super::ContentType::from(content_type);
1530
1531    if !status.is_client_error() && !status.is_server_error() {
1532        let content = resp.text().await?;
1533        match content_type {
1534            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1535            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateRouteMapEntryResponse`"))),
1536            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateRouteMapEntryResponse`")))),
1537        }
1538    } else {
1539        let content = resp.text().await?;
1540        let entity: Option<ClusterSdnCreateRouteMapEntryError> = serde_json::from_str(&content).ok();
1541        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1542    }
1543}
1544
1545/// Create new rule.  Permissions: Needs SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
1546pub async fn cluster_sdn_create_rule(configuration: &configuration::Configuration, vnet: &str, cluster_firewall_create_rule_request: models::ClusterFirewallCreateRuleRequest) -> Result<models::ClusterSdnCreateRuleResponse, Error<ClusterSdnCreateRuleError>> {
1547    // add a prefix to parameters to efficiently prevent name collisions
1548    let p_path_vnet = vnet;
1549    let p_body_cluster_firewall_create_rule_request = cluster_firewall_create_rule_request;
1550
1551    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/rules", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
1552    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1553
1554    if let Some(ref user_agent) = configuration.user_agent {
1555        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1556    }
1557    if let Some(ref apikey) = configuration.api_key {
1558        let key = apikey.key.clone();
1559        let value = match apikey.prefix {
1560            Some(ref prefix) => format!("{} {}", prefix, key),
1561            None => key,
1562        };
1563        req_builder = req_builder.header("Authorization", value);
1564    };
1565    if let Some(ref apikey) = configuration.api_key {
1566        let key = apikey.key.clone();
1567        let value = match apikey.prefix {
1568            Some(ref prefix) => format!("{} {}", prefix, key),
1569            None => key,
1570        };
1571        req_builder = req_builder.header("CSRFPreventionToken", value);
1572    };
1573    req_builder = req_builder.json(&p_body_cluster_firewall_create_rule_request);
1574
1575    let req = req_builder.build()?;
1576    let resp = configuration.client.execute(req).await?;
1577
1578    let status = resp.status();
1579    let content_type = resp
1580        .headers()
1581        .get("content-type")
1582        .and_then(|v| v.to_str().ok())
1583        .unwrap_or("application/octet-stream");
1584    let content_type = super::ContentType::from(content_type);
1585
1586    if !status.is_client_error() && !status.is_server_error() {
1587        let content = resp.text().await?;
1588        match content_type {
1589            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1590            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateRuleResponse`"))),
1591            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateRuleResponse`")))),
1592        }
1593    } else {
1594        let content = resp.text().await?;
1595        let entity: Option<ClusterSdnCreateRuleError> = serde_json::from_str(&content).ok();
1596        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1597    }
1598}
1599
1600/// Create a new sdn subnet object.  Permissions: Require 'SDN.Allocate' permission on '/sdn/zones/<zone>/<vnet>'
1601pub async fn cluster_sdn_create_subnets(configuration: &configuration::Configuration, vnet: &str, cluster_sdn_create_subnets_request: models::ClusterSdnCreateSubnetsRequest) -> Result<models::ClusterSdnCreateSubnetsResponse, Error<ClusterSdnCreateSubnetsError>> {
1602    // add a prefix to parameters to efficiently prevent name collisions
1603    let p_path_vnet = vnet;
1604    let p_body_cluster_sdn_create_subnets_request = cluster_sdn_create_subnets_request;
1605
1606    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/subnets", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
1607    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1608
1609    if let Some(ref user_agent) = configuration.user_agent {
1610        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1611    }
1612    if let Some(ref apikey) = configuration.api_key {
1613        let key = apikey.key.clone();
1614        let value = match apikey.prefix {
1615            Some(ref prefix) => format!("{} {}", prefix, key),
1616            None => key,
1617        };
1618        req_builder = req_builder.header("Authorization", value);
1619    };
1620    if let Some(ref apikey) = configuration.api_key {
1621        let key = apikey.key.clone();
1622        let value = match apikey.prefix {
1623            Some(ref prefix) => format!("{} {}", prefix, key),
1624            None => key,
1625        };
1626        req_builder = req_builder.header("CSRFPreventionToken", value);
1627    };
1628    req_builder = req_builder.json(&p_body_cluster_sdn_create_subnets_request);
1629
1630    let req = req_builder.build()?;
1631    let resp = configuration.client.execute(req).await?;
1632
1633    let status = resp.status();
1634    let content_type = resp
1635        .headers()
1636        .get("content-type")
1637        .and_then(|v| v.to_str().ok())
1638        .unwrap_or("application/octet-stream");
1639    let content_type = super::ContentType::from(content_type);
1640
1641    if !status.is_client_error() && !status.is_server_error() {
1642        let content = resp.text().await?;
1643        match content_type {
1644            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1645            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateSubnetsResponse`"))),
1646            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateSubnetsResponse`")))),
1647        }
1648    } else {
1649        let content = resp.text().await?;
1650        let entity: Option<ClusterSdnCreateSubnetsError> = serde_json::from_str(&content).ok();
1651        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1652    }
1653}
1654
1655/// Create a new sdn vnet object.
1656pub async fn cluster_sdn_create_vnets(configuration: &configuration::Configuration, cluster_sdn_create_vnets_request: models::ClusterSdnCreateVnetsRequest) -> Result<models::ClusterSdnCreateVnetsResponse, Error<ClusterSdnCreateVnetsError>> {
1657    // add a prefix to parameters to efficiently prevent name collisions
1658    let p_body_cluster_sdn_create_vnets_request = cluster_sdn_create_vnets_request;
1659
1660    let uri_str = format!("{}/cluster/sdn/vnets", configuration.base_path);
1661    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1662
1663    if let Some(ref user_agent) = configuration.user_agent {
1664        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1665    }
1666    if let Some(ref apikey) = configuration.api_key {
1667        let key = apikey.key.clone();
1668        let value = match apikey.prefix {
1669            Some(ref prefix) => format!("{} {}", prefix, key),
1670            None => key,
1671        };
1672        req_builder = req_builder.header("Authorization", value);
1673    };
1674    if let Some(ref apikey) = configuration.api_key {
1675        let key = apikey.key.clone();
1676        let value = match apikey.prefix {
1677            Some(ref prefix) => format!("{} {}", prefix, key),
1678            None => key,
1679        };
1680        req_builder = req_builder.header("CSRFPreventionToken", value);
1681    };
1682    req_builder = req_builder.json(&p_body_cluster_sdn_create_vnets_request);
1683
1684    let req = req_builder.build()?;
1685    let resp = configuration.client.execute(req).await?;
1686
1687    let status = resp.status();
1688    let content_type = resp
1689        .headers()
1690        .get("content-type")
1691        .and_then(|v| v.to_str().ok())
1692        .unwrap_or("application/octet-stream");
1693    let content_type = super::ContentType::from(content_type);
1694
1695    if !status.is_client_error() && !status.is_server_error() {
1696        let content = resp.text().await?;
1697        match content_type {
1698            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1699            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateVnetsResponse`"))),
1700            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateVnetsResponse`")))),
1701        }
1702    } else {
1703        let content = resp.text().await?;
1704        let entity: Option<ClusterSdnCreateVnetsError> = serde_json::from_str(&content).ok();
1705        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1706    }
1707}
1708
1709/// Create a new sdn zone object.
1710pub async fn cluster_sdn_create_zones(configuration: &configuration::Configuration, cluster_sdn_create_zones_request: models::ClusterSdnCreateZonesRequest) -> Result<models::ClusterSdnCreateZonesResponse, Error<ClusterSdnCreateZonesError>> {
1711    // add a prefix to parameters to efficiently prevent name collisions
1712    let p_body_cluster_sdn_create_zones_request = cluster_sdn_create_zones_request;
1713
1714    let uri_str = format!("{}/cluster/sdn/zones", configuration.base_path);
1715    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1716
1717    if let Some(ref user_agent) = configuration.user_agent {
1718        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1719    }
1720    if let Some(ref apikey) = configuration.api_key {
1721        let key = apikey.key.clone();
1722        let value = match apikey.prefix {
1723            Some(ref prefix) => format!("{} {}", prefix, key),
1724            None => key,
1725        };
1726        req_builder = req_builder.header("Authorization", value);
1727    };
1728    if let Some(ref apikey) = configuration.api_key {
1729        let key = apikey.key.clone();
1730        let value = match apikey.prefix {
1731            Some(ref prefix) => format!("{} {}", prefix, key),
1732            None => key,
1733        };
1734        req_builder = req_builder.header("CSRFPreventionToken", value);
1735    };
1736    req_builder = req_builder.json(&p_body_cluster_sdn_create_zones_request);
1737
1738    let req = req_builder.build()?;
1739    let resp = configuration.client.execute(req).await?;
1740
1741    let status = resp.status();
1742    let content_type = resp
1743        .headers()
1744        .get("content-type")
1745        .and_then(|v| v.to_str().ok())
1746        .unwrap_or("application/octet-stream");
1747    let content_type = super::ContentType::from(content_type);
1748
1749    if !status.is_client_error() && !status.is_server_error() {
1750        let content = resp.text().await?;
1751        match content_type {
1752            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1753            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnCreateZonesResponse`"))),
1754            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnCreateZonesResponse`")))),
1755        }
1756    } else {
1757        let content = resp.text().await?;
1758        let entity: Option<ClusterSdnCreateZonesError> = serde_json::from_str(&content).ok();
1759        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1760    }
1761}
1762
1763/// Delete sdn controller object configuration.
1764pub async fn cluster_sdn_delete_controllers(configuration: &configuration::Configuration, controller: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteControllersResponse, Error<ClusterSdnDeleteControllersError>> {
1765    // add a prefix to parameters to efficiently prevent name collisions
1766    let p_path_controller = controller;
1767    let p_query_lock_token = lock_token;
1768
1769    let uri_str = format!("{}/cluster/sdn/controllers/{controller}", configuration.base_path, controller=crate::apis::urlencode(p_path_controller));
1770    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1771
1772    if let Some(ref param_value) = p_query_lock_token {
1773        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
1774    }
1775    if let Some(ref user_agent) = configuration.user_agent {
1776        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1777    }
1778    if let Some(ref apikey) = configuration.api_key {
1779        let key = apikey.key.clone();
1780        let value = match apikey.prefix {
1781            Some(ref prefix) => format!("{} {}", prefix, key),
1782            None => key,
1783        };
1784        req_builder = req_builder.header("Authorization", value);
1785    };
1786    if let Some(ref apikey) = configuration.api_key {
1787        let key = apikey.key.clone();
1788        let value = match apikey.prefix {
1789            Some(ref prefix) => format!("{} {}", prefix, key),
1790            None => key,
1791        };
1792        req_builder = req_builder.header("CSRFPreventionToken", value);
1793    };
1794
1795    let req = req_builder.build()?;
1796    let resp = configuration.client.execute(req).await?;
1797
1798    let status = resp.status();
1799    let content_type = resp
1800        .headers()
1801        .get("content-type")
1802        .and_then(|v| v.to_str().ok())
1803        .unwrap_or("application/octet-stream");
1804    let content_type = super::ContentType::from(content_type);
1805
1806    if !status.is_client_error() && !status.is_server_error() {
1807        let content = resp.text().await?;
1808        match content_type {
1809            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1810            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteControllersResponse`"))),
1811            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteControllersResponse`")))),
1812        }
1813    } else {
1814        let content = resp.text().await?;
1815        let entity: Option<ClusterSdnDeleteControllersError> = serde_json::from_str(&content).ok();
1816        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1817    }
1818}
1819
1820/// Delete sdn dns object configuration.
1821pub async fn cluster_sdn_delete_dns(configuration: &configuration::Configuration, dns: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteDnsResponse, Error<ClusterSdnDeleteDnsError>> {
1822    // add a prefix to parameters to efficiently prevent name collisions
1823    let p_path_dns = dns;
1824    let p_query_lock_token = lock_token;
1825
1826    let uri_str = format!("{}/cluster/sdn/dns/{dns}", configuration.base_path, dns=crate::apis::urlencode(p_path_dns));
1827    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1828
1829    if let Some(ref param_value) = p_query_lock_token {
1830        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
1831    }
1832    if let Some(ref user_agent) = configuration.user_agent {
1833        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1834    }
1835    if let Some(ref apikey) = configuration.api_key {
1836        let key = apikey.key.clone();
1837        let value = match apikey.prefix {
1838            Some(ref prefix) => format!("{} {}", prefix, key),
1839            None => key,
1840        };
1841        req_builder = req_builder.header("Authorization", value);
1842    };
1843    if let Some(ref apikey) = configuration.api_key {
1844        let key = apikey.key.clone();
1845        let value = match apikey.prefix {
1846            Some(ref prefix) => format!("{} {}", prefix, key),
1847            None => key,
1848        };
1849        req_builder = req_builder.header("CSRFPreventionToken", value);
1850    };
1851
1852    let req = req_builder.build()?;
1853    let resp = configuration.client.execute(req).await?;
1854
1855    let status = resp.status();
1856    let content_type = resp
1857        .headers()
1858        .get("content-type")
1859        .and_then(|v| v.to_str().ok())
1860        .unwrap_or("application/octet-stream");
1861    let content_type = super::ContentType::from(content_type);
1862
1863    if !status.is_client_error() && !status.is_server_error() {
1864        let content = resp.text().await?;
1865        match content_type {
1866            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1867            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteDnsResponse`"))),
1868            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteDnsResponse`")))),
1869        }
1870    } else {
1871        let content = resp.text().await?;
1872        let entity: Option<ClusterSdnDeleteDnsError> = serde_json::from_str(&content).ok();
1873        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1874    }
1875}
1876
1877/// Add a fabric
1878pub async fn cluster_sdn_delete_fabric(configuration: &configuration::Configuration, id: &str) -> Result<models::ClusterSdnDeleteFabricResponse, Error<ClusterSdnDeleteFabricError>> {
1879    // add a prefix to parameters to efficiently prevent name collisions
1880    let p_path_id = id;
1881
1882    let uri_str = format!("{}/cluster/sdn/fabrics/fabric/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
1883    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1884
1885    if let Some(ref user_agent) = configuration.user_agent {
1886        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1887    }
1888    if let Some(ref apikey) = configuration.api_key {
1889        let key = apikey.key.clone();
1890        let value = match apikey.prefix {
1891            Some(ref prefix) => format!("{} {}", prefix, key),
1892            None => key,
1893        };
1894        req_builder = req_builder.header("Authorization", value);
1895    };
1896    if let Some(ref apikey) = configuration.api_key {
1897        let key = apikey.key.clone();
1898        let value = match apikey.prefix {
1899            Some(ref prefix) => format!("{} {}", prefix, key),
1900            None => key,
1901        };
1902        req_builder = req_builder.header("CSRFPreventionToken", value);
1903    };
1904
1905    let req = req_builder.build()?;
1906    let resp = configuration.client.execute(req).await?;
1907
1908    let status = resp.status();
1909    let content_type = resp
1910        .headers()
1911        .get("content-type")
1912        .and_then(|v| v.to_str().ok())
1913        .unwrap_or("application/octet-stream");
1914    let content_type = super::ContentType::from(content_type);
1915
1916    if !status.is_client_error() && !status.is_server_error() {
1917        let content = resp.text().await?;
1918        match content_type {
1919            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1920            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteFabricResponse`"))),
1921            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteFabricResponse`")))),
1922        }
1923    } else {
1924        let content = resp.text().await?;
1925        let entity: Option<ClusterSdnDeleteFabricError> = serde_json::from_str(&content).ok();
1926        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1927    }
1928}
1929
1930/// Delete sdn ipam object configuration.
1931pub async fn cluster_sdn_delete_ipams(configuration: &configuration::Configuration, ipam: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteIpamsResponse, Error<ClusterSdnDeleteIpamsError>> {
1932    // add a prefix to parameters to efficiently prevent name collisions
1933    let p_path_ipam = ipam;
1934    let p_query_lock_token = lock_token;
1935
1936    let uri_str = format!("{}/cluster/sdn/ipams/{ipam}", configuration.base_path, ipam=crate::apis::urlencode(p_path_ipam));
1937    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1938
1939    if let Some(ref param_value) = p_query_lock_token {
1940        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
1941    }
1942    if let Some(ref user_agent) = configuration.user_agent {
1943        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1944    }
1945    if let Some(ref apikey) = configuration.api_key {
1946        let key = apikey.key.clone();
1947        let value = match apikey.prefix {
1948            Some(ref prefix) => format!("{} {}", prefix, key),
1949            None => key,
1950        };
1951        req_builder = req_builder.header("Authorization", value);
1952    };
1953    if let Some(ref apikey) = configuration.api_key {
1954        let key = apikey.key.clone();
1955        let value = match apikey.prefix {
1956            Some(ref prefix) => format!("{} {}", prefix, key),
1957            None => key,
1958        };
1959        req_builder = req_builder.header("CSRFPreventionToken", value);
1960    };
1961
1962    let req = req_builder.build()?;
1963    let resp = configuration.client.execute(req).await?;
1964
1965    let status = resp.status();
1966    let content_type = resp
1967        .headers()
1968        .get("content-type")
1969        .and_then(|v| v.to_str().ok())
1970        .unwrap_or("application/octet-stream");
1971    let content_type = super::ContentType::from(content_type);
1972
1973    if !status.is_client_error() && !status.is_server_error() {
1974        let content = resp.text().await?;
1975        match content_type {
1976            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1977            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteIpamsResponse`"))),
1978            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteIpamsResponse`")))),
1979        }
1980    } else {
1981        let content = resp.text().await?;
1982        let entity: Option<ClusterSdnDeleteIpamsError> = serde_json::from_str(&content).ok();
1983        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1984    }
1985}
1986
1987/// Add a node
1988pub async fn cluster_sdn_delete_node(configuration: &configuration::Configuration, fabric_id: &str, node_id: &str) -> Result<models::ClusterSdnDeleteNodeResponse, Error<ClusterSdnDeleteNodeError>> {
1989    // add a prefix to parameters to efficiently prevent name collisions
1990    let p_path_fabric_id = fabric_id;
1991    let p_path_node_id = node_id;
1992
1993    let uri_str = format!("{}/cluster/sdn/fabrics/node/{fabric_id}/{node_id}", configuration.base_path, fabric_id=crate::apis::urlencode(p_path_fabric_id), node_id=crate::apis::urlencode(p_path_node_id));
1994    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1995
1996    if let Some(ref user_agent) = configuration.user_agent {
1997        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1998    }
1999    if let Some(ref apikey) = configuration.api_key {
2000        let key = apikey.key.clone();
2001        let value = match apikey.prefix {
2002            Some(ref prefix) => format!("{} {}", prefix, key),
2003            None => key,
2004        };
2005        req_builder = req_builder.header("Authorization", value);
2006    };
2007    if let Some(ref apikey) = configuration.api_key {
2008        let key = apikey.key.clone();
2009        let value = match apikey.prefix {
2010            Some(ref prefix) => format!("{} {}", prefix, key),
2011            None => key,
2012        };
2013        req_builder = req_builder.header("CSRFPreventionToken", value);
2014    };
2015
2016    let req = req_builder.build()?;
2017    let resp = configuration.client.execute(req).await?;
2018
2019    let status = resp.status();
2020    let content_type = resp
2021        .headers()
2022        .get("content-type")
2023        .and_then(|v| v.to_str().ok())
2024        .unwrap_or("application/octet-stream");
2025    let content_type = super::ContentType::from(content_type);
2026
2027    if !status.is_client_error() && !status.is_server_error() {
2028        let content = resp.text().await?;
2029        match content_type {
2030            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2031            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteNodeResponse`"))),
2032            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteNodeResponse`")))),
2033        }
2034    } else {
2035        let content = resp.text().await?;
2036        let entity: Option<ClusterSdnDeleteNodeError> = serde_json::from_str(&content).ok();
2037        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2038    }
2039}
2040
2041/// Delete Prefix List
2042pub async fn cluster_sdn_delete_prefix_list(configuration: &configuration::Configuration, id: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeletePrefixListResponse, Error<ClusterSdnDeletePrefixListError>> {
2043    // add a prefix to parameters to efficiently prevent name collisions
2044    let p_path_id = id;
2045    let p_query_lock_token = lock_token;
2046
2047    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
2048    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2049
2050    if let Some(ref param_value) = p_query_lock_token {
2051        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2052    }
2053    if let Some(ref user_agent) = configuration.user_agent {
2054        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2055    }
2056    if let Some(ref apikey) = configuration.api_key {
2057        let key = apikey.key.clone();
2058        let value = match apikey.prefix {
2059            Some(ref prefix) => format!("{} {}", prefix, key),
2060            None => key,
2061        };
2062        req_builder = req_builder.header("Authorization", value);
2063    };
2064    if let Some(ref apikey) = configuration.api_key {
2065        let key = apikey.key.clone();
2066        let value = match apikey.prefix {
2067            Some(ref prefix) => format!("{} {}", prefix, key),
2068            None => key,
2069        };
2070        req_builder = req_builder.header("CSRFPreventionToken", value);
2071    };
2072
2073    let req = req_builder.build()?;
2074    let resp = configuration.client.execute(req).await?;
2075
2076    let status = resp.status();
2077    let content_type = resp
2078        .headers()
2079        .get("content-type")
2080        .and_then(|v| v.to_str().ok())
2081        .unwrap_or("application/octet-stream");
2082    let content_type = super::ContentType::from(content_type);
2083
2084    if !status.is_client_error() && !status.is_server_error() {
2085        let content = resp.text().await?;
2086        match content_type {
2087            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2088            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeletePrefixListResponse`"))),
2089            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeletePrefixListResponse`")))),
2090        }
2091    } else {
2092        let content = resp.text().await?;
2093        let entity: Option<ClusterSdnDeletePrefixListError> = serde_json::from_str(&content).ok();
2094        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2095    }
2096}
2097
2098/// Delete Prefix List Entry
2099pub async fn cluster_sdn_delete_prefix_list_entry(configuration: &configuration::Configuration, id: &str, url_seq: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeletePrefixListEntryResponse, Error<ClusterSdnDeletePrefixListEntryError>> {
2100    // add a prefix to parameters to efficiently prevent name collisions
2101    let p_path_id = id;
2102    let p_path_url_seq = url_seq;
2103    let p_query_lock_token = lock_token;
2104
2105    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}/entries/{url_seq}", configuration.base_path, id=crate::apis::urlencode(p_path_id), url_seq=crate::apis::urlencode(p_path_url_seq));
2106    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2107
2108    if let Some(ref param_value) = p_query_lock_token {
2109        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2110    }
2111    if let Some(ref user_agent) = configuration.user_agent {
2112        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2113    }
2114    if let Some(ref apikey) = configuration.api_key {
2115        let key = apikey.key.clone();
2116        let value = match apikey.prefix {
2117            Some(ref prefix) => format!("{} {}", prefix, key),
2118            None => key,
2119        };
2120        req_builder = req_builder.header("Authorization", value);
2121    };
2122    if let Some(ref apikey) = configuration.api_key {
2123        let key = apikey.key.clone();
2124        let value = match apikey.prefix {
2125            Some(ref prefix) => format!("{} {}", prefix, key),
2126            None => key,
2127        };
2128        req_builder = req_builder.header("CSRFPreventionToken", value);
2129    };
2130
2131    let req = req_builder.build()?;
2132    let resp = configuration.client.execute(req).await?;
2133
2134    let status = resp.status();
2135    let content_type = resp
2136        .headers()
2137        .get("content-type")
2138        .and_then(|v| v.to_str().ok())
2139        .unwrap_or("application/octet-stream");
2140    let content_type = super::ContentType::from(content_type);
2141
2142    if !status.is_client_error() && !status.is_server_error() {
2143        let content = resp.text().await?;
2144        match content_type {
2145            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2146            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeletePrefixListEntryResponse`"))),
2147            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeletePrefixListEntryResponse`")))),
2148        }
2149    } else {
2150        let content = resp.text().await?;
2151        let entity: Option<ClusterSdnDeletePrefixListEntryError> = serde_json::from_str(&content).ok();
2152        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2153    }
2154}
2155
2156/// Delete Route Map Entry
2157pub async fn cluster_sdn_delete_route_map_entry(configuration: &configuration::Configuration, order: i32, route_map_id: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteRouteMapEntryResponse, Error<ClusterSdnDeleteRouteMapEntryError>> {
2158    // add a prefix to parameters to efficiently prevent name collisions
2159    let p_path_order = order;
2160    let p_path_route_map_id = route_map_id;
2161    let p_query_lock_token = lock_token;
2162
2163    let uri_str = format!("{}/cluster/sdn/route-maps/entries/{route_map_id}/entry/{order}", configuration.base_path, order=p_path_order, route_map_id=crate::apis::urlencode(p_path_route_map_id));
2164    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2165
2166    if let Some(ref param_value) = p_query_lock_token {
2167        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2168    }
2169    if let Some(ref user_agent) = configuration.user_agent {
2170        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2171    }
2172    if let Some(ref apikey) = configuration.api_key {
2173        let key = apikey.key.clone();
2174        let value = match apikey.prefix {
2175            Some(ref prefix) => format!("{} {}", prefix, key),
2176            None => key,
2177        };
2178        req_builder = req_builder.header("Authorization", value);
2179    };
2180    if let Some(ref apikey) = configuration.api_key {
2181        let key = apikey.key.clone();
2182        let value = match apikey.prefix {
2183            Some(ref prefix) => format!("{} {}", prefix, key),
2184            None => key,
2185        };
2186        req_builder = req_builder.header("CSRFPreventionToken", value);
2187    };
2188
2189    let req = req_builder.build()?;
2190    let resp = configuration.client.execute(req).await?;
2191
2192    let status = resp.status();
2193    let content_type = resp
2194        .headers()
2195        .get("content-type")
2196        .and_then(|v| v.to_str().ok())
2197        .unwrap_or("application/octet-stream");
2198    let content_type = super::ContentType::from(content_type);
2199
2200    if !status.is_client_error() && !status.is_server_error() {
2201        let content = resp.text().await?;
2202        match content_type {
2203            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2204            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteRouteMapEntryResponse`"))),
2205            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteRouteMapEntryResponse`")))),
2206        }
2207    } else {
2208        let content = resp.text().await?;
2209        let entity: Option<ClusterSdnDeleteRouteMapEntryError> = serde_json::from_str(&content).ok();
2210        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2211    }
2212}
2213
2214/// Delete rule.  Permissions: Needs SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
2215pub async fn cluster_sdn_delete_rule(configuration: &configuration::Configuration, pos: i64, vnet: &str, digest: Option<&str>) -> Result<models::ClusterSdnDeleteRuleResponse, Error<ClusterSdnDeleteRuleError>> {
2216    // add a prefix to parameters to efficiently prevent name collisions
2217    let p_path_pos = pos;
2218    let p_path_vnet = vnet;
2219    let p_query_digest = digest;
2220
2221    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/rules/{pos}", configuration.base_path, pos=p_path_pos, vnet=crate::apis::urlencode(p_path_vnet));
2222    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2223
2224    if let Some(ref param_value) = p_query_digest {
2225        req_builder = req_builder.query(&[("digest", &param_value.to_string())]);
2226    }
2227    if let Some(ref user_agent) = configuration.user_agent {
2228        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2229    }
2230    if let Some(ref apikey) = configuration.api_key {
2231        let key = apikey.key.clone();
2232        let value = match apikey.prefix {
2233            Some(ref prefix) => format!("{} {}", prefix, key),
2234            None => key,
2235        };
2236        req_builder = req_builder.header("Authorization", value);
2237    };
2238    if let Some(ref apikey) = configuration.api_key {
2239        let key = apikey.key.clone();
2240        let value = match apikey.prefix {
2241            Some(ref prefix) => format!("{} {}", prefix, key),
2242            None => key,
2243        };
2244        req_builder = req_builder.header("CSRFPreventionToken", value);
2245    };
2246
2247    let req = req_builder.build()?;
2248    let resp = configuration.client.execute(req).await?;
2249
2250    let status = resp.status();
2251    let content_type = resp
2252        .headers()
2253        .get("content-type")
2254        .and_then(|v| v.to_str().ok())
2255        .unwrap_or("application/octet-stream");
2256    let content_type = super::ContentType::from(content_type);
2257
2258    if !status.is_client_error() && !status.is_server_error() {
2259        let content = resp.text().await?;
2260        match content_type {
2261            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2262            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteRuleResponse`"))),
2263            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteRuleResponse`")))),
2264        }
2265    } else {
2266        let content = resp.text().await?;
2267        let entity: Option<ClusterSdnDeleteRuleError> = serde_json::from_str(&content).ok();
2268        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2269    }
2270}
2271
2272/// Delete sdn subnet object configuration.  Permissions: Require 'SDN.Allocate' permission on '/sdn/zones/<zone>/<vnet>'
2273pub async fn cluster_sdn_delete_subnets(configuration: &configuration::Configuration, subnet: &str, vnet: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteSubnetsResponse, Error<ClusterSdnDeleteSubnetsError>> {
2274    // add a prefix to parameters to efficiently prevent name collisions
2275    let p_path_subnet = subnet;
2276    let p_path_vnet = vnet;
2277    let p_query_lock_token = lock_token;
2278
2279    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/subnets/{subnet}", configuration.base_path, subnet=crate::apis::urlencode(p_path_subnet), vnet=crate::apis::urlencode(p_path_vnet));
2280    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2281
2282    if let Some(ref param_value) = p_query_lock_token {
2283        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2284    }
2285    if let Some(ref user_agent) = configuration.user_agent {
2286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2287    }
2288    if let Some(ref apikey) = configuration.api_key {
2289        let key = apikey.key.clone();
2290        let value = match apikey.prefix {
2291            Some(ref prefix) => format!("{} {}", prefix, key),
2292            None => key,
2293        };
2294        req_builder = req_builder.header("Authorization", value);
2295    };
2296    if let Some(ref apikey) = configuration.api_key {
2297        let key = apikey.key.clone();
2298        let value = match apikey.prefix {
2299            Some(ref prefix) => format!("{} {}", prefix, key),
2300            None => key,
2301        };
2302        req_builder = req_builder.header("CSRFPreventionToken", value);
2303    };
2304
2305    let req = req_builder.build()?;
2306    let resp = configuration.client.execute(req).await?;
2307
2308    let status = resp.status();
2309    let content_type = resp
2310        .headers()
2311        .get("content-type")
2312        .and_then(|v| v.to_str().ok())
2313        .unwrap_or("application/octet-stream");
2314    let content_type = super::ContentType::from(content_type);
2315
2316    if !status.is_client_error() && !status.is_server_error() {
2317        let content = resp.text().await?;
2318        match content_type {
2319            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2320            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteSubnetsResponse`"))),
2321            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteSubnetsResponse`")))),
2322        }
2323    } else {
2324        let content = resp.text().await?;
2325        let entity: Option<ClusterSdnDeleteSubnetsError> = serde_json::from_str(&content).ok();
2326        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2327    }
2328}
2329
2330/// Delete sdn vnet object configuration.  Permissions: Require 'SDN.Allocate' permission on '/sdn/zones/<zone>/<vnet>'
2331pub async fn cluster_sdn_delete_vnets(configuration: &configuration::Configuration, vnet: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteVnetsResponse, Error<ClusterSdnDeleteVnetsError>> {
2332    // add a prefix to parameters to efficiently prevent name collisions
2333    let p_path_vnet = vnet;
2334    let p_query_lock_token = lock_token;
2335
2336    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
2337    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2338
2339    if let Some(ref param_value) = p_query_lock_token {
2340        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2341    }
2342    if let Some(ref user_agent) = configuration.user_agent {
2343        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2344    }
2345    if let Some(ref apikey) = configuration.api_key {
2346        let key = apikey.key.clone();
2347        let value = match apikey.prefix {
2348            Some(ref prefix) => format!("{} {}", prefix, key),
2349            None => key,
2350        };
2351        req_builder = req_builder.header("Authorization", value);
2352    };
2353    if let Some(ref apikey) = configuration.api_key {
2354        let key = apikey.key.clone();
2355        let value = match apikey.prefix {
2356            Some(ref prefix) => format!("{} {}", prefix, key),
2357            None => key,
2358        };
2359        req_builder = req_builder.header("CSRFPreventionToken", value);
2360    };
2361
2362    let req = req_builder.build()?;
2363    let resp = configuration.client.execute(req).await?;
2364
2365    let status = resp.status();
2366    let content_type = resp
2367        .headers()
2368        .get("content-type")
2369        .and_then(|v| v.to_str().ok())
2370        .unwrap_or("application/octet-stream");
2371    let content_type = super::ContentType::from(content_type);
2372
2373    if !status.is_client_error() && !status.is_server_error() {
2374        let content = resp.text().await?;
2375        match content_type {
2376            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2377            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteVnetsResponse`"))),
2378            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteVnetsResponse`")))),
2379        }
2380    } else {
2381        let content = resp.text().await?;
2382        let entity: Option<ClusterSdnDeleteVnetsError> = serde_json::from_str(&content).ok();
2383        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2384    }
2385}
2386
2387/// Delete sdn zone object configuration.
2388pub async fn cluster_sdn_delete_zones(configuration: &configuration::Configuration, zone: &str, lock_token: Option<&str>) -> Result<models::ClusterSdnDeleteZonesResponse, Error<ClusterSdnDeleteZonesError>> {
2389    // add a prefix to parameters to efficiently prevent name collisions
2390    let p_path_zone = zone;
2391    let p_query_lock_token = lock_token;
2392
2393    let uri_str = format!("{}/cluster/sdn/zones/{zone}", configuration.base_path, zone=crate::apis::urlencode(p_path_zone));
2394    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2395
2396    if let Some(ref param_value) = p_query_lock_token {
2397        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
2398    }
2399    if let Some(ref user_agent) = configuration.user_agent {
2400        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2401    }
2402    if let Some(ref apikey) = configuration.api_key {
2403        let key = apikey.key.clone();
2404        let value = match apikey.prefix {
2405            Some(ref prefix) => format!("{} {}", prefix, key),
2406            None => key,
2407        };
2408        req_builder = req_builder.header("Authorization", value);
2409    };
2410    if let Some(ref apikey) = configuration.api_key {
2411        let key = apikey.key.clone();
2412        let value = match apikey.prefix {
2413            Some(ref prefix) => format!("{} {}", prefix, key),
2414            None => key,
2415        };
2416        req_builder = req_builder.header("CSRFPreventionToken", value);
2417    };
2418
2419    let req = req_builder.build()?;
2420    let resp = configuration.client.execute(req).await?;
2421
2422    let status = resp.status();
2423    let content_type = resp
2424        .headers()
2425        .get("content-type")
2426        .and_then(|v| v.to_str().ok())
2427        .unwrap_or("application/octet-stream");
2428    let content_type = super::ContentType::from(content_type);
2429
2430    if !status.is_client_error() && !status.is_server_error() {
2431        let content = resp.text().await?;
2432        match content_type {
2433            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2434            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDeleteZonesResponse`"))),
2435            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDeleteZonesResponse`")))),
2436        }
2437    } else {
2438        let content = resp.text().await?;
2439        let entity: Option<ClusterSdnDeleteZonesError> = serde_json::from_str(&content).ok();
2440        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2441    }
2442}
2443
2444/// Dry-run the SDN apply action and return the difference between the current configuration and the pending configuration
2445pub async fn cluster_sdn_dry_run(configuration: &configuration::Configuration, node: &str) -> Result<models::ClusterSdnDryRunResponse, Error<ClusterSdnDryRunError>> {
2446    // add a prefix to parameters to efficiently prevent name collisions
2447    let p_query_node = node;
2448
2449    let uri_str = format!("{}/cluster/sdn/dry-run", configuration.base_path);
2450    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2451
2452    req_builder = req_builder.query(&[("node", &p_query_node.to_string())]);
2453    if let Some(ref user_agent) = configuration.user_agent {
2454        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2455    }
2456    if let Some(ref apikey) = configuration.api_key {
2457        let key = apikey.key.clone();
2458        let value = match apikey.prefix {
2459            Some(ref prefix) => format!("{} {}", prefix, key),
2460            None => key,
2461        };
2462        req_builder = req_builder.header("Authorization", value);
2463    };
2464    if let Some(ref apikey) = configuration.api_key {
2465        let key = apikey.key.clone();
2466        let value = match apikey.prefix {
2467            Some(ref prefix) => format!("{} {}", prefix, key),
2468            None => key,
2469        };
2470        req_builder = req_builder.header("CSRFPreventionToken", value);
2471    };
2472
2473    let req = req_builder.build()?;
2474    let resp = configuration.client.execute(req).await?;
2475
2476    let status = resp.status();
2477    let content_type = resp
2478        .headers()
2479        .get("content-type")
2480        .and_then(|v| v.to_str().ok())
2481        .unwrap_or("application/octet-stream");
2482    let content_type = super::ContentType::from(content_type);
2483
2484    if !status.is_client_error() && !status.is_server_error() {
2485        let content = resp.text().await?;
2486        match content_type {
2487            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2488            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnDryRunResponse`"))),
2489            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnDryRunResponse`")))),
2490        }
2491    } else {
2492        let content = resp.text().await?;
2493        let entity: Option<ClusterSdnDryRunError> = serde_json::from_str(&content).ok();
2494        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2495    }
2496}
2497
2498/// SDN controllers index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/controllers/<controller>'
2499pub async fn cluster_sdn_get_controllers(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>, r#type: Option<models::PveClusterSdnTypeEnum>) -> Result<models::ClusterSdnGetControllersResponse, Error<ClusterSdnGetControllersError>> {
2500    // add a prefix to parameters to efficiently prevent name collisions
2501    let p_query_pending = pending;
2502    let p_query_running = running;
2503    let p_query_type = r#type;
2504
2505    let uri_str = format!("{}/cluster/sdn/controllers", configuration.base_path);
2506    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2507
2508    if let Some(ref param_value) = p_query_pending {
2509        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
2510    }
2511    if let Some(ref param_value) = p_query_running {
2512        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
2513    }
2514    if let Some(ref param_value) = p_query_type {
2515        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
2516    }
2517    if let Some(ref user_agent) = configuration.user_agent {
2518        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2519    }
2520    if let Some(ref apikey) = configuration.api_key {
2521        let key = apikey.key.clone();
2522        let value = match apikey.prefix {
2523            Some(ref prefix) => format!("{} {}", prefix, key),
2524            None => key,
2525        };
2526        req_builder = req_builder.header("Authorization", value);
2527    };
2528    if let Some(ref apikey) = configuration.api_key {
2529        let key = apikey.key.clone();
2530        let value = match apikey.prefix {
2531            Some(ref prefix) => format!("{} {}", prefix, key),
2532            None => key,
2533        };
2534        req_builder = req_builder.header("CSRFPreventionToken", value);
2535    };
2536
2537    let req = req_builder.build()?;
2538    let resp = configuration.client.execute(req).await?;
2539
2540    let status = resp.status();
2541    let content_type = resp
2542        .headers()
2543        .get("content-type")
2544        .and_then(|v| v.to_str().ok())
2545        .unwrap_or("application/octet-stream");
2546    let content_type = super::ContentType::from(content_type);
2547
2548    if !status.is_client_error() && !status.is_server_error() {
2549        let content = resp.text().await?;
2550        match content_type {
2551            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2552            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetControllersResponse`"))),
2553            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetControllersResponse`")))),
2554        }
2555    } else {
2556        let content = resp.text().await?;
2557        let entity: Option<ClusterSdnGetControllersError> = serde_json::from_str(&content).ok();
2558        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2559    }
2560}
2561
2562/// SDN dns index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/dns/<dns>'
2563pub async fn cluster_sdn_get_dns(configuration: &configuration::Configuration, r#type: Option<models::PveClusterSdnTypeTypeEnum>) -> Result<models::ClusterSdnGetDnsResponse, Error<ClusterSdnGetDnsError>> {
2564    // add a prefix to parameters to efficiently prevent name collisions
2565    let p_query_type = r#type;
2566
2567    let uri_str = format!("{}/cluster/sdn/dns", configuration.base_path);
2568    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2569
2570    if let Some(ref param_value) = p_query_type {
2571        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
2572    }
2573    if let Some(ref user_agent) = configuration.user_agent {
2574        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2575    }
2576    if let Some(ref apikey) = configuration.api_key {
2577        let key = apikey.key.clone();
2578        let value = match apikey.prefix {
2579            Some(ref prefix) => format!("{} {}", prefix, key),
2580            None => key,
2581        };
2582        req_builder = req_builder.header("Authorization", value);
2583    };
2584    if let Some(ref apikey) = configuration.api_key {
2585        let key = apikey.key.clone();
2586        let value = match apikey.prefix {
2587            Some(ref prefix) => format!("{} {}", prefix, key),
2588            None => key,
2589        };
2590        req_builder = req_builder.header("CSRFPreventionToken", value);
2591    };
2592
2593    let req = req_builder.build()?;
2594    let resp = configuration.client.execute(req).await?;
2595
2596    let status = resp.status();
2597    let content_type = resp
2598        .headers()
2599        .get("content-type")
2600        .and_then(|v| v.to_str().ok())
2601        .unwrap_or("application/octet-stream");
2602    let content_type = super::ContentType::from(content_type);
2603
2604    if !status.is_client_error() && !status.is_server_error() {
2605        let content = resp.text().await?;
2606        match content_type {
2607            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2608            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetDnsResponse`"))),
2609            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetDnsResponse`")))),
2610        }
2611    } else {
2612        let content = resp.text().await?;
2613        let entity: Option<ClusterSdnGetDnsError> = serde_json::from_str(&content).ok();
2614        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2615    }
2616}
2617
2618/// SDN Fabrics Index  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/fabrics/<fabric>'
2619pub async fn cluster_sdn_get_fabric(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnGetFabricResponse, Error<ClusterSdnGetFabricError>> {
2620    // add a prefix to parameters to efficiently prevent name collisions
2621    let p_query_pending = pending;
2622    let p_query_running = running;
2623
2624    let uri_str = format!("{}/cluster/sdn/fabrics/fabric", configuration.base_path);
2625    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2626
2627    if let Some(ref param_value) = p_query_pending {
2628        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
2629    }
2630    if let Some(ref param_value) = p_query_running {
2631        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
2632    }
2633    if let Some(ref user_agent) = configuration.user_agent {
2634        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2635    }
2636    if let Some(ref apikey) = configuration.api_key {
2637        let key = apikey.key.clone();
2638        let value = match apikey.prefix {
2639            Some(ref prefix) => format!("{} {}", prefix, key),
2640            None => key,
2641        };
2642        req_builder = req_builder.header("Authorization", value);
2643    };
2644    if let Some(ref apikey) = configuration.api_key {
2645        let key = apikey.key.clone();
2646        let value = match apikey.prefix {
2647            Some(ref prefix) => format!("{} {}", prefix, key),
2648            None => key,
2649        };
2650        req_builder = req_builder.header("CSRFPreventionToken", value);
2651    };
2652
2653    let req = req_builder.build()?;
2654    let resp = configuration.client.execute(req).await?;
2655
2656    let status = resp.status();
2657    let content_type = resp
2658        .headers()
2659        .get("content-type")
2660        .and_then(|v| v.to_str().ok())
2661        .unwrap_or("application/octet-stream");
2662    let content_type = super::ContentType::from(content_type);
2663
2664    if !status.is_client_error() && !status.is_server_error() {
2665        let content = resp.text().await?;
2666        match content_type {
2667            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2668            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetFabricResponse`"))),
2669            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetFabricResponse`")))),
2670        }
2671    } else {
2672        let content = resp.text().await?;
2673        let entity: Option<ClusterSdnGetFabricError> = serde_json::from_str(&content).ok();
2674        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2675    }
2676}
2677
2678/// Update a fabric
2679pub async fn cluster_sdn_get_fabric_get_fabric(configuration: &configuration::Configuration, id: &str) -> Result<models::ClusterSdnGetFabricGetFabricResponse, Error<ClusterSdnGetFabricGetFabricError>> {
2680    // add a prefix to parameters to efficiently prevent name collisions
2681    let p_path_id = id;
2682
2683    let uri_str = format!("{}/cluster/sdn/fabrics/fabric/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
2684    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2685
2686    if let Some(ref user_agent) = configuration.user_agent {
2687        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2688    }
2689    if let Some(ref apikey) = configuration.api_key {
2690        let key = apikey.key.clone();
2691        let value = match apikey.prefix {
2692            Some(ref prefix) => format!("{} {}", prefix, key),
2693            None => key,
2694        };
2695        req_builder = req_builder.header("Authorization", value);
2696    };
2697    if let Some(ref apikey) = configuration.api_key {
2698        let key = apikey.key.clone();
2699        let value = match apikey.prefix {
2700            Some(ref prefix) => format!("{} {}", prefix, key),
2701            None => key,
2702        };
2703        req_builder = req_builder.header("CSRFPreventionToken", value);
2704    };
2705
2706    let req = req_builder.build()?;
2707    let resp = configuration.client.execute(req).await?;
2708
2709    let status = resp.status();
2710    let content_type = resp
2711        .headers()
2712        .get("content-type")
2713        .and_then(|v| v.to_str().ok())
2714        .unwrap_or("application/octet-stream");
2715    let content_type = super::ContentType::from(content_type);
2716
2717    if !status.is_client_error() && !status.is_server_error() {
2718        let content = resp.text().await?;
2719        match content_type {
2720            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2721            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetFabricGetFabricResponse`"))),
2722            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetFabricGetFabricResponse`")))),
2723        }
2724    } else {
2725        let content = resp.text().await?;
2726        let entity: Option<ClusterSdnGetFabricGetFabricError> = serde_json::from_str(&content).ok();
2727        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2728    }
2729}
2730
2731/// SDN Fabrics Index
2732pub async fn cluster_sdn_get_fabrics(configuration: &configuration::Configuration, ) -> Result<models::ClusterSdnGetFabricsResponse, Error<ClusterSdnGetFabricsError>> {
2733
2734    let uri_str = format!("{}/cluster/sdn/fabrics", configuration.base_path);
2735    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2736
2737    if let Some(ref user_agent) = configuration.user_agent {
2738        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2739    }
2740    if let Some(ref apikey) = configuration.api_key {
2741        let key = apikey.key.clone();
2742        let value = match apikey.prefix {
2743            Some(ref prefix) => format!("{} {}", prefix, key),
2744            None => key,
2745        };
2746        req_builder = req_builder.header("Authorization", value);
2747    };
2748    if let Some(ref apikey) = configuration.api_key {
2749        let key = apikey.key.clone();
2750        let value = match apikey.prefix {
2751            Some(ref prefix) => format!("{} {}", prefix, key),
2752            None => key,
2753        };
2754        req_builder = req_builder.header("CSRFPreventionToken", value);
2755    };
2756
2757    let req = req_builder.build()?;
2758    let resp = configuration.client.execute(req).await?;
2759
2760    let status = resp.status();
2761    let content_type = resp
2762        .headers()
2763        .get("content-type")
2764        .and_then(|v| v.to_str().ok())
2765        .unwrap_or("application/octet-stream");
2766    let content_type = super::ContentType::from(content_type);
2767
2768    if !status.is_client_error() && !status.is_server_error() {
2769        let content = resp.text().await?;
2770        match content_type {
2771            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2772            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetFabricsResponse`"))),
2773            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetFabricsResponse`")))),
2774        }
2775    } else {
2776        let content = resp.text().await?;
2777        let entity: Option<ClusterSdnGetFabricsError> = serde_json::from_str(&content).ok();
2778        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2779    }
2780}
2781
2782/// Directory index.
2783pub async fn cluster_sdn_get_firewall(configuration: &configuration::Configuration, vnet: &str) -> Result<models::ClusterSdnGetFirewallResponse, Error<ClusterSdnGetFirewallError>> {
2784    // add a prefix to parameters to efficiently prevent name collisions
2785    let p_path_vnet = vnet;
2786
2787    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
2788    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2789
2790    if let Some(ref user_agent) = configuration.user_agent {
2791        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2792    }
2793    if let Some(ref apikey) = configuration.api_key {
2794        let key = apikey.key.clone();
2795        let value = match apikey.prefix {
2796            Some(ref prefix) => format!("{} {}", prefix, key),
2797            None => key,
2798        };
2799        req_builder = req_builder.header("Authorization", value);
2800    };
2801    if let Some(ref apikey) = configuration.api_key {
2802        let key = apikey.key.clone();
2803        let value = match apikey.prefix {
2804            Some(ref prefix) => format!("{} {}", prefix, key),
2805            None => key,
2806        };
2807        req_builder = req_builder.header("CSRFPreventionToken", value);
2808    };
2809
2810    let req = req_builder.build()?;
2811    let resp = configuration.client.execute(req).await?;
2812
2813    let status = resp.status();
2814    let content_type = resp
2815        .headers()
2816        .get("content-type")
2817        .and_then(|v| v.to_str().ok())
2818        .unwrap_or("application/octet-stream");
2819    let content_type = super::ContentType::from(content_type);
2820
2821    if !status.is_client_error() && !status.is_server_error() {
2822        let content = resp.text().await?;
2823        match content_type {
2824            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2825            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetFirewallResponse`"))),
2826            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetFirewallResponse`")))),
2827        }
2828    } else {
2829        let content = resp.text().await?;
2830        let entity: Option<ClusterSdnGetFirewallError> = serde_json::from_str(&content).ok();
2831        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2832    }
2833}
2834
2835/// SDN ipams index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/ipams/<ipam>'
2836pub async fn cluster_sdn_get_ipams(configuration: &configuration::Configuration, r#type: Option<models::PveClusterSdnTypeTypeEnum2>) -> Result<models::ClusterSdnGetIpamsResponse, Error<ClusterSdnGetIpamsError>> {
2837    // add a prefix to parameters to efficiently prevent name collisions
2838    let p_query_type = r#type;
2839
2840    let uri_str = format!("{}/cluster/sdn/ipams", configuration.base_path);
2841    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2842
2843    if let Some(ref param_value) = p_query_type {
2844        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
2845    }
2846    if let Some(ref user_agent) = configuration.user_agent {
2847        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2848    }
2849    if let Some(ref apikey) = configuration.api_key {
2850        let key = apikey.key.clone();
2851        let value = match apikey.prefix {
2852            Some(ref prefix) => format!("{} {}", prefix, key),
2853            None => key,
2854        };
2855        req_builder = req_builder.header("Authorization", value);
2856    };
2857    if let Some(ref apikey) = configuration.api_key {
2858        let key = apikey.key.clone();
2859        let value = match apikey.prefix {
2860            Some(ref prefix) => format!("{} {}", prefix, key),
2861            None => key,
2862        };
2863        req_builder = req_builder.header("CSRFPreventionToken", value);
2864    };
2865
2866    let req = req_builder.build()?;
2867    let resp = configuration.client.execute(req).await?;
2868
2869    let status = resp.status();
2870    let content_type = resp
2871        .headers()
2872        .get("content-type")
2873        .and_then(|v| v.to_str().ok())
2874        .unwrap_or("application/octet-stream");
2875    let content_type = super::ContentType::from(content_type);
2876
2877    if !status.is_client_error() && !status.is_server_error() {
2878        let content = resp.text().await?;
2879        match content_type {
2880            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2881            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetIpamsResponse`"))),
2882            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetIpamsResponse`")))),
2883        }
2884    } else {
2885        let content = resp.text().await?;
2886        let entity: Option<ClusterSdnGetIpamsError> = serde_json::from_str(&content).ok();
2887        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2888    }
2889}
2890
2891/// Get a node
2892pub async fn cluster_sdn_get_node(configuration: &configuration::Configuration, fabric_id: &str, node_id: &str) -> Result<models::ClusterSdnGetNodeResponse, Error<ClusterSdnGetNodeError>> {
2893    // add a prefix to parameters to efficiently prevent name collisions
2894    let p_path_fabric_id = fabric_id;
2895    let p_path_node_id = node_id;
2896
2897    let uri_str = format!("{}/cluster/sdn/fabrics/node/{fabric_id}/{node_id}", configuration.base_path, fabric_id=crate::apis::urlencode(p_path_fabric_id), node_id=crate::apis::urlencode(p_path_node_id));
2898    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2899
2900    if let Some(ref user_agent) = configuration.user_agent {
2901        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2902    }
2903    if let Some(ref apikey) = configuration.api_key {
2904        let key = apikey.key.clone();
2905        let value = match apikey.prefix {
2906            Some(ref prefix) => format!("{} {}", prefix, key),
2907            None => key,
2908        };
2909        req_builder = req_builder.header("Authorization", value);
2910    };
2911    if let Some(ref apikey) = configuration.api_key {
2912        let key = apikey.key.clone();
2913        let value = match apikey.prefix {
2914            Some(ref prefix) => format!("{} {}", prefix, key),
2915            None => key,
2916        };
2917        req_builder = req_builder.header("CSRFPreventionToken", value);
2918    };
2919
2920    let req = req_builder.build()?;
2921    let resp = configuration.client.execute(req).await?;
2922
2923    let status = resp.status();
2924    let content_type = resp
2925        .headers()
2926        .get("content-type")
2927        .and_then(|v| v.to_str().ok())
2928        .unwrap_or("application/octet-stream");
2929    let content_type = super::ContentType::from(content_type);
2930
2931    if !status.is_client_error() && !status.is_server_error() {
2932        let content = resp.text().await?;
2933        match content_type {
2934            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2935            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetNodeResponse`"))),
2936            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetNodeResponse`")))),
2937        }
2938    } else {
2939        let content = resp.text().await?;
2940        let entity: Option<ClusterSdnGetNodeError> = serde_json::from_str(&content).ok();
2941        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2942    }
2943}
2944
2945/// Get vnet firewall options.  Permissions: Needs SDN.Audit or SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
2946pub async fn cluster_sdn_get_options(configuration: &configuration::Configuration, vnet: &str) -> Result<models::ClusterSdnGetOptionsResponse, Error<ClusterSdnGetOptionsError>> {
2947    // add a prefix to parameters to efficiently prevent name collisions
2948    let p_path_vnet = vnet;
2949
2950    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/options", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
2951    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2952
2953    if let Some(ref user_agent) = configuration.user_agent {
2954        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2955    }
2956    if let Some(ref apikey) = configuration.api_key {
2957        let key = apikey.key.clone();
2958        let value = match apikey.prefix {
2959            Some(ref prefix) => format!("{} {}", prefix, key),
2960            None => key,
2961        };
2962        req_builder = req_builder.header("Authorization", value);
2963    };
2964    if let Some(ref apikey) = configuration.api_key {
2965        let key = apikey.key.clone();
2966        let value = match apikey.prefix {
2967            Some(ref prefix) => format!("{} {}", prefix, key),
2968            None => key,
2969        };
2970        req_builder = req_builder.header("CSRFPreventionToken", value);
2971    };
2972
2973    let req = req_builder.build()?;
2974    let resp = configuration.client.execute(req).await?;
2975
2976    let status = resp.status();
2977    let content_type = resp
2978        .headers()
2979        .get("content-type")
2980        .and_then(|v| v.to_str().ok())
2981        .unwrap_or("application/octet-stream");
2982    let content_type = super::ContentType::from(content_type);
2983
2984    if !status.is_client_error() && !status.is_server_error() {
2985        let content = resp.text().await?;
2986        match content_type {
2987            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2988            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetOptionsResponse`"))),
2989            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetOptionsResponse`")))),
2990        }
2991    } else {
2992        let content = resp.text().await?;
2993        let entity: Option<ClusterSdnGetOptionsError> = serde_json::from_str(&content).ok();
2994        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2995    }
2996}
2997
2998/// Get Prefix List
2999pub async fn cluster_sdn_get_prefix_list(configuration: &configuration::Configuration, id: &str) -> Result<models::ClusterSdnGetPrefixListResponse, Error<ClusterSdnGetPrefixListError>> {
3000    // add a prefix to parameters to efficiently prevent name collisions
3001    let p_path_id = id;
3002
3003    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
3004    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3005
3006    if let Some(ref user_agent) = configuration.user_agent {
3007        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3008    }
3009    if let Some(ref apikey) = configuration.api_key {
3010        let key = apikey.key.clone();
3011        let value = match apikey.prefix {
3012            Some(ref prefix) => format!("{} {}", prefix, key),
3013            None => key,
3014        };
3015        req_builder = req_builder.header("Authorization", value);
3016    };
3017    if let Some(ref apikey) = configuration.api_key {
3018        let key = apikey.key.clone();
3019        let value = match apikey.prefix {
3020            Some(ref prefix) => format!("{} {}", prefix, key),
3021            None => key,
3022        };
3023        req_builder = req_builder.header("CSRFPreventionToken", value);
3024    };
3025
3026    let req = req_builder.build()?;
3027    let resp = configuration.client.execute(req).await?;
3028
3029    let status = resp.status();
3030    let content_type = resp
3031        .headers()
3032        .get("content-type")
3033        .and_then(|v| v.to_str().ok())
3034        .unwrap_or("application/octet-stream");
3035    let content_type = super::ContentType::from(content_type);
3036
3037    if !status.is_client_error() && !status.is_server_error() {
3038        let content = resp.text().await?;
3039        match content_type {
3040            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3041            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetPrefixListResponse`"))),
3042            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetPrefixListResponse`")))),
3043        }
3044    } else {
3045        let content = resp.text().await?;
3046        let entity: Option<ClusterSdnGetPrefixListError> = serde_json::from_str(&content).ok();
3047        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3048    }
3049}
3050
3051/// List Prefix List Entries
3052pub async fn cluster_sdn_get_prefix_list_entries(configuration: &configuration::Configuration, id: &str) -> Result<models::ClusterSdnGetPrefixListEntriesResponse, Error<ClusterSdnGetPrefixListEntriesError>> {
3053    // add a prefix to parameters to efficiently prevent name collisions
3054    let p_path_id = id;
3055
3056    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}/entries", configuration.base_path, id=crate::apis::urlencode(p_path_id));
3057    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3058
3059    if let Some(ref user_agent) = configuration.user_agent {
3060        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3061    }
3062    if let Some(ref apikey) = configuration.api_key {
3063        let key = apikey.key.clone();
3064        let value = match apikey.prefix {
3065            Some(ref prefix) => format!("{} {}", prefix, key),
3066            None => key,
3067        };
3068        req_builder = req_builder.header("Authorization", value);
3069    };
3070    if let Some(ref apikey) = configuration.api_key {
3071        let key = apikey.key.clone();
3072        let value = match apikey.prefix {
3073            Some(ref prefix) => format!("{} {}", prefix, key),
3074            None => key,
3075        };
3076        req_builder = req_builder.header("CSRFPreventionToken", value);
3077    };
3078
3079    let req = req_builder.build()?;
3080    let resp = configuration.client.execute(req).await?;
3081
3082    let status = resp.status();
3083    let content_type = resp
3084        .headers()
3085        .get("content-type")
3086        .and_then(|v| v.to_str().ok())
3087        .unwrap_or("application/octet-stream");
3088    let content_type = super::ContentType::from(content_type);
3089
3090    if !status.is_client_error() && !status.is_server_error() {
3091        let content = resp.text().await?;
3092        match content_type {
3093            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3094            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetPrefixListEntriesResponse`"))),
3095            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetPrefixListEntriesResponse`")))),
3096        }
3097    } else {
3098        let content = resp.text().await?;
3099        let entity: Option<ClusterSdnGetPrefixListEntriesError> = serde_json::from_str(&content).ok();
3100        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3101    }
3102}
3103
3104/// Get Prefix List Entry
3105pub async fn cluster_sdn_get_prefix_list_entry(configuration: &configuration::Configuration, id: &str, url_seq: &str) -> Result<models::ClusterSdnGetPrefixListEntryResponse, Error<ClusterSdnGetPrefixListEntryError>> {
3106    // add a prefix to parameters to efficiently prevent name collisions
3107    let p_path_id = id;
3108    let p_path_url_seq = url_seq;
3109
3110    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}/entries/{url_seq}", configuration.base_path, id=crate::apis::urlencode(p_path_id), url_seq=crate::apis::urlencode(p_path_url_seq));
3111    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3112
3113    if let Some(ref user_agent) = configuration.user_agent {
3114        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3115    }
3116    if let Some(ref apikey) = configuration.api_key {
3117        let key = apikey.key.clone();
3118        let value = match apikey.prefix {
3119            Some(ref prefix) => format!("{} {}", prefix, key),
3120            None => key,
3121        };
3122        req_builder = req_builder.header("Authorization", value);
3123    };
3124    if let Some(ref apikey) = configuration.api_key {
3125        let key = apikey.key.clone();
3126        let value = match apikey.prefix {
3127            Some(ref prefix) => format!("{} {}", prefix, key),
3128            None => key,
3129        };
3130        req_builder = req_builder.header("CSRFPreventionToken", value);
3131    };
3132
3133    let req = req_builder.build()?;
3134    let resp = configuration.client.execute(req).await?;
3135
3136    let status = resp.status();
3137    let content_type = resp
3138        .headers()
3139        .get("content-type")
3140        .and_then(|v| v.to_str().ok())
3141        .unwrap_or("application/octet-stream");
3142    let content_type = super::ContentType::from(content_type);
3143
3144    if !status.is_client_error() && !status.is_server_error() {
3145        let content = resp.text().await?;
3146        match content_type {
3147            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3148            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetPrefixListEntryResponse`"))),
3149            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetPrefixListEntryResponse`")))),
3150        }
3151    } else {
3152        let content = resp.text().await?;
3153        let entity: Option<ClusterSdnGetPrefixListEntryError> = serde_json::from_str(&content).ok();
3154        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3155    }
3156}
3157
3158/// Get Route Map Entry
3159pub async fn cluster_sdn_get_route_map_entry(configuration: &configuration::Configuration, order: i32, route_map_id: &str) -> Result<models::ClusterSdnGetRouteMapEntryResponse, Error<ClusterSdnGetRouteMapEntryError>> {
3160    // add a prefix to parameters to efficiently prevent name collisions
3161    let p_path_order = order;
3162    let p_path_route_map_id = route_map_id;
3163
3164    let uri_str = format!("{}/cluster/sdn/route-maps/entries/{route_map_id}/entry/{order}", configuration.base_path, order=p_path_order, route_map_id=crate::apis::urlencode(p_path_route_map_id));
3165    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3166
3167    if let Some(ref user_agent) = configuration.user_agent {
3168        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3169    }
3170    if let Some(ref apikey) = configuration.api_key {
3171        let key = apikey.key.clone();
3172        let value = match apikey.prefix {
3173            Some(ref prefix) => format!("{} {}", prefix, key),
3174            None => key,
3175        };
3176        req_builder = req_builder.header("Authorization", value);
3177    };
3178    if let Some(ref apikey) = configuration.api_key {
3179        let key = apikey.key.clone();
3180        let value = match apikey.prefix {
3181            Some(ref prefix) => format!("{} {}", prefix, key),
3182            None => key,
3183        };
3184        req_builder = req_builder.header("CSRFPreventionToken", value);
3185    };
3186
3187    let req = req_builder.build()?;
3188    let resp = configuration.client.execute(req).await?;
3189
3190    let status = resp.status();
3191    let content_type = resp
3192        .headers()
3193        .get("content-type")
3194        .and_then(|v| v.to_str().ok())
3195        .unwrap_or("application/octet-stream");
3196    let content_type = super::ContentType::from(content_type);
3197
3198    if !status.is_client_error() && !status.is_server_error() {
3199        let content = resp.text().await?;
3200        match content_type {
3201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3202            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetRouteMapEntryResponse`"))),
3203            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetRouteMapEntryResponse`")))),
3204        }
3205    } else {
3206        let content = resp.text().await?;
3207        let entity: Option<ClusterSdnGetRouteMapEntryError> = serde_json::from_str(&content).ok();
3208        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3209    }
3210}
3211
3212/// Get single rule data.  Permissions: Needs SDN.Audit or SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
3213pub async fn cluster_sdn_get_rule(configuration: &configuration::Configuration, pos: i64, vnet: &str) -> Result<models::ClusterSdnGetRuleResponse, Error<ClusterSdnGetRuleError>> {
3214    // add a prefix to parameters to efficiently prevent name collisions
3215    let p_path_pos = pos;
3216    let p_path_vnet = vnet;
3217
3218    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/rules/{pos}", configuration.base_path, pos=p_path_pos, vnet=crate::apis::urlencode(p_path_vnet));
3219    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3220
3221    if let Some(ref user_agent) = configuration.user_agent {
3222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3223    }
3224    if let Some(ref apikey) = configuration.api_key {
3225        let key = apikey.key.clone();
3226        let value = match apikey.prefix {
3227            Some(ref prefix) => format!("{} {}", prefix, key),
3228            None => key,
3229        };
3230        req_builder = req_builder.header("Authorization", value);
3231    };
3232    if let Some(ref apikey) = configuration.api_key {
3233        let key = apikey.key.clone();
3234        let value = match apikey.prefix {
3235            Some(ref prefix) => format!("{} {}", prefix, key),
3236            None => key,
3237        };
3238        req_builder = req_builder.header("CSRFPreventionToken", value);
3239    };
3240
3241    let req = req_builder.build()?;
3242    let resp = configuration.client.execute(req).await?;
3243
3244    let status = resp.status();
3245    let content_type = resp
3246        .headers()
3247        .get("content-type")
3248        .and_then(|v| v.to_str().ok())
3249        .unwrap_or("application/octet-stream");
3250    let content_type = super::ContentType::from(content_type);
3251
3252    if !status.is_client_error() && !status.is_server_error() {
3253        let content = resp.text().await?;
3254        match content_type {
3255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3256            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetRuleResponse`"))),
3257            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetRuleResponse`")))),
3258        }
3259    } else {
3260        let content = resp.text().await?;
3261        let entity: Option<ClusterSdnGetRuleError> = serde_json::from_str(&content).ok();
3262        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3263    }
3264}
3265
3266/// List rules.  Permissions: Needs SDN.Audit or SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
3267pub async fn cluster_sdn_get_rules(configuration: &configuration::Configuration, vnet: &str) -> Result<models::ClusterSdnGetRulesResponse, Error<ClusterSdnGetRulesError>> {
3268    // add a prefix to parameters to efficiently prevent name collisions
3269    let p_path_vnet = vnet;
3270
3271    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/rules", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
3272    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3273
3274    if let Some(ref user_agent) = configuration.user_agent {
3275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3276    }
3277    if let Some(ref apikey) = configuration.api_key {
3278        let key = apikey.key.clone();
3279        let value = match apikey.prefix {
3280            Some(ref prefix) => format!("{} {}", prefix, key),
3281            None => key,
3282        };
3283        req_builder = req_builder.header("Authorization", value);
3284    };
3285    if let Some(ref apikey) = configuration.api_key {
3286        let key = apikey.key.clone();
3287        let value = match apikey.prefix {
3288            Some(ref prefix) => format!("{} {}", prefix, key),
3289            None => key,
3290        };
3291        req_builder = req_builder.header("CSRFPreventionToken", value);
3292    };
3293
3294    let req = req_builder.build()?;
3295    let resp = configuration.client.execute(req).await?;
3296
3297    let status = resp.status();
3298    let content_type = resp
3299        .headers()
3300        .get("content-type")
3301        .and_then(|v| v.to_str().ok())
3302        .unwrap_or("application/octet-stream");
3303    let content_type = super::ContentType::from(content_type);
3304
3305    if !status.is_client_error() && !status.is_server_error() {
3306        let content = resp.text().await?;
3307        match content_type {
3308            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3309            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetRulesResponse`"))),
3310            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetRulesResponse`")))),
3311        }
3312    } else {
3313        let content = resp.text().await?;
3314        let entity: Option<ClusterSdnGetRulesError> = serde_json::from_str(&content).ok();
3315        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3316    }
3317}
3318
3319/// Directory index.
3320pub async fn cluster_sdn_get_sdn(configuration: &configuration::Configuration, ) -> Result<models::ClusterSdnGetSdnResponse, Error<ClusterSdnGetSdnError>> {
3321
3322    let uri_str = format!("{}/cluster/sdn", configuration.base_path);
3323    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3324
3325    if let Some(ref user_agent) = configuration.user_agent {
3326        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3327    }
3328    if let Some(ref apikey) = configuration.api_key {
3329        let key = apikey.key.clone();
3330        let value = match apikey.prefix {
3331            Some(ref prefix) => format!("{} {}", prefix, key),
3332            None => key,
3333        };
3334        req_builder = req_builder.header("Authorization", value);
3335    };
3336    if let Some(ref apikey) = configuration.api_key {
3337        let key = apikey.key.clone();
3338        let value = match apikey.prefix {
3339            Some(ref prefix) => format!("{} {}", prefix, key),
3340            None => key,
3341        };
3342        req_builder = req_builder.header("CSRFPreventionToken", value);
3343    };
3344
3345    let req = req_builder.build()?;
3346    let resp = configuration.client.execute(req).await?;
3347
3348    let status = resp.status();
3349    let content_type = resp
3350        .headers()
3351        .get("content-type")
3352        .and_then(|v| v.to_str().ok())
3353        .unwrap_or("application/octet-stream");
3354    let content_type = super::ContentType::from(content_type);
3355
3356    if !status.is_client_error() && !status.is_server_error() {
3357        let content = resp.text().await?;
3358        match content_type {
3359            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3360            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetSdnResponse`"))),
3361            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetSdnResponse`")))),
3362        }
3363    } else {
3364        let content = resp.text().await?;
3365        let entity: Option<ClusterSdnGetSdnError> = serde_json::from_str(&content).ok();
3366        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3367    }
3368}
3369
3370/// SDN subnets index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>/<vnet>'
3371pub async fn cluster_sdn_get_subnets(configuration: &configuration::Configuration, vnet: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnGetSubnetsResponse, Error<ClusterSdnGetSubnetsError>> {
3372    // add a prefix to parameters to efficiently prevent name collisions
3373    let p_path_vnet = vnet;
3374    let p_query_pending = pending;
3375    let p_query_running = running;
3376
3377    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/subnets", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
3378    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3379
3380    if let Some(ref param_value) = p_query_pending {
3381        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3382    }
3383    if let Some(ref param_value) = p_query_running {
3384        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3385    }
3386    if let Some(ref user_agent) = configuration.user_agent {
3387        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3388    }
3389    if let Some(ref apikey) = configuration.api_key {
3390        let key = apikey.key.clone();
3391        let value = match apikey.prefix {
3392            Some(ref prefix) => format!("{} {}", prefix, key),
3393            None => key,
3394        };
3395        req_builder = req_builder.header("Authorization", value);
3396    };
3397    if let Some(ref apikey) = configuration.api_key {
3398        let key = apikey.key.clone();
3399        let value = match apikey.prefix {
3400            Some(ref prefix) => format!("{} {}", prefix, key),
3401            None => key,
3402        };
3403        req_builder = req_builder.header("CSRFPreventionToken", value);
3404    };
3405
3406    let req = req_builder.build()?;
3407    let resp = configuration.client.execute(req).await?;
3408
3409    let status = resp.status();
3410    let content_type = resp
3411        .headers()
3412        .get("content-type")
3413        .and_then(|v| v.to_str().ok())
3414        .unwrap_or("application/octet-stream");
3415    let content_type = super::ContentType::from(content_type);
3416
3417    if !status.is_client_error() && !status.is_server_error() {
3418        let content = resp.text().await?;
3419        match content_type {
3420            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3421            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetSubnetsResponse`"))),
3422            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetSubnetsResponse`")))),
3423        }
3424    } else {
3425        let content = resp.text().await?;
3426        let entity: Option<ClusterSdnGetSubnetsError> = serde_json::from_str(&content).ok();
3427        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3428    }
3429}
3430
3431/// SDN vnets index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>/<vnet>'
3432pub async fn cluster_sdn_get_vnets(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnGetVnetsResponse, Error<ClusterSdnGetVnetsError>> {
3433    // add a prefix to parameters to efficiently prevent name collisions
3434    let p_query_pending = pending;
3435    let p_query_running = running;
3436
3437    let uri_str = format!("{}/cluster/sdn/vnets", configuration.base_path);
3438    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3439
3440    if let Some(ref param_value) = p_query_pending {
3441        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3442    }
3443    if let Some(ref param_value) = p_query_running {
3444        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3445    }
3446    if let Some(ref user_agent) = configuration.user_agent {
3447        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3448    }
3449    if let Some(ref apikey) = configuration.api_key {
3450        let key = apikey.key.clone();
3451        let value = match apikey.prefix {
3452            Some(ref prefix) => format!("{} {}", prefix, key),
3453            None => key,
3454        };
3455        req_builder = req_builder.header("Authorization", value);
3456    };
3457    if let Some(ref apikey) = configuration.api_key {
3458        let key = apikey.key.clone();
3459        let value = match apikey.prefix {
3460            Some(ref prefix) => format!("{} {}", prefix, key),
3461            None => key,
3462        };
3463        req_builder = req_builder.header("CSRFPreventionToken", value);
3464    };
3465
3466    let req = req_builder.build()?;
3467    let resp = configuration.client.execute(req).await?;
3468
3469    let status = resp.status();
3470    let content_type = resp
3471        .headers()
3472        .get("content-type")
3473        .and_then(|v| v.to_str().ok())
3474        .unwrap_or("application/octet-stream");
3475    let content_type = super::ContentType::from(content_type);
3476
3477    if !status.is_client_error() && !status.is_server_error() {
3478        let content = resp.text().await?;
3479        match content_type {
3480            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3481            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetVnetsResponse`"))),
3482            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetVnetsResponse`")))),
3483        }
3484    } else {
3485        let content = resp.text().await?;
3486        let entity: Option<ClusterSdnGetVnetsError> = serde_json::from_str(&content).ok();
3487        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3488    }
3489}
3490
3491/// SDN zones index.  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>'
3492pub async fn cluster_sdn_get_zones(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>, r#type: Option<models::PveClusterSdnTypeTypeEnum4>) -> Result<models::ClusterSdnGetZonesResponse, Error<ClusterSdnGetZonesError>> {
3493    // add a prefix to parameters to efficiently prevent name collisions
3494    let p_query_pending = pending;
3495    let p_query_running = running;
3496    let p_query_type = r#type;
3497
3498    let uri_str = format!("{}/cluster/sdn/zones", configuration.base_path);
3499    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3500
3501    if let Some(ref param_value) = p_query_pending {
3502        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3503    }
3504    if let Some(ref param_value) = p_query_running {
3505        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3506    }
3507    if let Some(ref param_value) = p_query_type {
3508        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
3509    }
3510    if let Some(ref user_agent) = configuration.user_agent {
3511        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3512    }
3513    if let Some(ref apikey) = configuration.api_key {
3514        let key = apikey.key.clone();
3515        let value = match apikey.prefix {
3516            Some(ref prefix) => format!("{} {}", prefix, key),
3517            None => key,
3518        };
3519        req_builder = req_builder.header("Authorization", value);
3520    };
3521    if let Some(ref apikey) = configuration.api_key {
3522        let key = apikey.key.clone();
3523        let value = match apikey.prefix {
3524            Some(ref prefix) => format!("{} {}", prefix, key),
3525            None => key,
3526        };
3527        req_builder = req_builder.header("CSRFPreventionToken", value);
3528    };
3529
3530    let req = req_builder.build()?;
3531    let resp = configuration.client.execute(req).await?;
3532
3533    let status = resp.status();
3534    let content_type = resp
3535        .headers()
3536        .get("content-type")
3537        .and_then(|v| v.to_str().ok())
3538        .unwrap_or("application/octet-stream");
3539    let content_type = super::ContentType::from(content_type);
3540
3541    if !status.is_client_error() && !status.is_server_error() {
3542        let content = resp.text().await?;
3543        match content_type {
3544            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3545            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnGetZonesResponse`"))),
3546            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnGetZonesResponse`")))),
3547        }
3548    } else {
3549        let content = resp.text().await?;
3550        let entity: Option<ClusterSdnGetZonesError> = serde_json::from_str(&content).ok();
3551        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3552    }
3553}
3554
3555/// List PVE IPAM Entries  Permissions: Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>/<vnet>'
3556pub async fn cluster_sdn_ipamindex(configuration: &configuration::Configuration, ipam: &str) -> Result<models::ClusterSdnIpamindexResponse, Error<ClusterSdnIpamindexError>> {
3557    // add a prefix to parameters to efficiently prevent name collisions
3558    let p_path_ipam = ipam;
3559
3560    let uri_str = format!("{}/cluster/sdn/ipams/{ipam}/status", configuration.base_path, ipam=crate::apis::urlencode(p_path_ipam));
3561    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3562
3563    if let Some(ref user_agent) = configuration.user_agent {
3564        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3565    }
3566    if let Some(ref apikey) = configuration.api_key {
3567        let key = apikey.key.clone();
3568        let value = match apikey.prefix {
3569            Some(ref prefix) => format!("{} {}", prefix, key),
3570            None => key,
3571        };
3572        req_builder = req_builder.header("Authorization", value);
3573    };
3574    if let Some(ref apikey) = configuration.api_key {
3575        let key = apikey.key.clone();
3576        let value = match apikey.prefix {
3577            Some(ref prefix) => format!("{} {}", prefix, key),
3578            None => key,
3579        };
3580        req_builder = req_builder.header("CSRFPreventionToken", value);
3581    };
3582
3583    let req = req_builder.build()?;
3584    let resp = configuration.client.execute(req).await?;
3585
3586    let status = resp.status();
3587    let content_type = resp
3588        .headers()
3589        .get("content-type")
3590        .and_then(|v| v.to_str().ok())
3591        .unwrap_or("application/octet-stream");
3592    let content_type = super::ContentType::from(content_type);
3593
3594    if !status.is_client_error() && !status.is_server_error() {
3595        let content = resp.text().await?;
3596        match content_type {
3597            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3598            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnIpamindexResponse`"))),
3599            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnIpamindexResponse`")))),
3600        }
3601    } else {
3602        let content = resp.text().await?;
3603        let entity: Option<ClusterSdnIpamindexError> = serde_json::from_str(&content).ok();
3604        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3605    }
3606}
3607
3608/// Create IP Mapping in a VNet
3609pub async fn cluster_sdn_ipcreate(configuration: &configuration::Configuration, vnet: &str, cluster_sdn_ipcreate_request: models::ClusterSdnIpcreateRequest) -> Result<models::ClusterSdnIpcreateResponse, Error<ClusterSdnIpcreateError>> {
3610    // add a prefix to parameters to efficiently prevent name collisions
3611    let p_path_vnet = vnet;
3612    let p_body_cluster_sdn_ipcreate_request = cluster_sdn_ipcreate_request;
3613
3614    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/ips", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
3615    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3616
3617    if let Some(ref user_agent) = configuration.user_agent {
3618        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3619    }
3620    if let Some(ref apikey) = configuration.api_key {
3621        let key = apikey.key.clone();
3622        let value = match apikey.prefix {
3623            Some(ref prefix) => format!("{} {}", prefix, key),
3624            None => key,
3625        };
3626        req_builder = req_builder.header("Authorization", value);
3627    };
3628    if let Some(ref apikey) = configuration.api_key {
3629        let key = apikey.key.clone();
3630        let value = match apikey.prefix {
3631            Some(ref prefix) => format!("{} {}", prefix, key),
3632            None => key,
3633        };
3634        req_builder = req_builder.header("CSRFPreventionToken", value);
3635    };
3636    req_builder = req_builder.json(&p_body_cluster_sdn_ipcreate_request);
3637
3638    let req = req_builder.build()?;
3639    let resp = configuration.client.execute(req).await?;
3640
3641    let status = resp.status();
3642    let content_type = resp
3643        .headers()
3644        .get("content-type")
3645        .and_then(|v| v.to_str().ok())
3646        .unwrap_or("application/octet-stream");
3647    let content_type = super::ContentType::from(content_type);
3648
3649    if !status.is_client_error() && !status.is_server_error() {
3650        let content = resp.text().await?;
3651        match content_type {
3652            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3653            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnIpcreateResponse`"))),
3654            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnIpcreateResponse`")))),
3655        }
3656    } else {
3657        let content = resp.text().await?;
3658        let entity: Option<ClusterSdnIpcreateError> = serde_json::from_str(&content).ok();
3659        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3660    }
3661}
3662
3663/// Delete IP Mappings in a VNet
3664pub async fn cluster_sdn_ipdelete(configuration: &configuration::Configuration, ip: &str, vnet: &str, zone: &str, mac: Option<&str>) -> Result<models::ClusterSdnIpdeleteResponse, Error<ClusterSdnIpdeleteError>> {
3665    // add a prefix to parameters to efficiently prevent name collisions
3666    let p_query_ip = ip;
3667    let p_path_vnet = vnet;
3668    let p_query_zone = zone;
3669    let p_query_mac = mac;
3670
3671    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/ips", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
3672    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3673
3674    req_builder = req_builder.query(&[("ip", &p_query_ip.to_string())]);
3675    if let Some(ref param_value) = p_query_mac {
3676        req_builder = req_builder.query(&[("mac", &param_value.to_string())]);
3677    }
3678    req_builder = req_builder.query(&[("zone", &p_query_zone.to_string())]);
3679    if let Some(ref user_agent) = configuration.user_agent {
3680        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3681    }
3682    if let Some(ref apikey) = configuration.api_key {
3683        let key = apikey.key.clone();
3684        let value = match apikey.prefix {
3685            Some(ref prefix) => format!("{} {}", prefix, key),
3686            None => key,
3687        };
3688        req_builder = req_builder.header("Authorization", value);
3689    };
3690    if let Some(ref apikey) = configuration.api_key {
3691        let key = apikey.key.clone();
3692        let value = match apikey.prefix {
3693            Some(ref prefix) => format!("{} {}", prefix, key),
3694            None => key,
3695        };
3696        req_builder = req_builder.header("CSRFPreventionToken", value);
3697    };
3698
3699    let req = req_builder.build()?;
3700    let resp = configuration.client.execute(req).await?;
3701
3702    let status = resp.status();
3703    let content_type = resp
3704        .headers()
3705        .get("content-type")
3706        .and_then(|v| v.to_str().ok())
3707        .unwrap_or("application/octet-stream");
3708    let content_type = super::ContentType::from(content_type);
3709
3710    if !status.is_client_error() && !status.is_server_error() {
3711        let content = resp.text().await?;
3712        match content_type {
3713            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3714            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnIpdeleteResponse`"))),
3715            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnIpdeleteResponse`")))),
3716        }
3717    } else {
3718        let content = resp.text().await?;
3719        let entity: Option<ClusterSdnIpdeleteError> = serde_json::from_str(&content).ok();
3720        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3721    }
3722}
3723
3724/// Update IP Mapping in a VNet
3725pub async fn cluster_sdn_ipupdate(configuration: &configuration::Configuration, vnet: &str, cluster_sdn_ipupdate_request: models::ClusterSdnIpupdateRequest) -> Result<models::ClusterSdnIpupdateResponse, Error<ClusterSdnIpupdateError>> {
3726    // add a prefix to parameters to efficiently prevent name collisions
3727    let p_path_vnet = vnet;
3728    let p_body_cluster_sdn_ipupdate_request = cluster_sdn_ipupdate_request;
3729
3730    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/ips", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
3731    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3732
3733    if let Some(ref user_agent) = configuration.user_agent {
3734        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3735    }
3736    if let Some(ref apikey) = configuration.api_key {
3737        let key = apikey.key.clone();
3738        let value = match apikey.prefix {
3739            Some(ref prefix) => format!("{} {}", prefix, key),
3740            None => key,
3741        };
3742        req_builder = req_builder.header("Authorization", value);
3743    };
3744    if let Some(ref apikey) = configuration.api_key {
3745        let key = apikey.key.clone();
3746        let value = match apikey.prefix {
3747            Some(ref prefix) => format!("{} {}", prefix, key),
3748            None => key,
3749        };
3750        req_builder = req_builder.header("CSRFPreventionToken", value);
3751    };
3752    req_builder = req_builder.json(&p_body_cluster_sdn_ipupdate_request);
3753
3754    let req = req_builder.build()?;
3755    let resp = configuration.client.execute(req).await?;
3756
3757    let status = resp.status();
3758    let content_type = resp
3759        .headers()
3760        .get("content-type")
3761        .and_then(|v| v.to_str().ok())
3762        .unwrap_or("application/octet-stream");
3763    let content_type = super::ContentType::from(content_type);
3764
3765    if !status.is_client_error() && !status.is_server_error() {
3766        let content = resp.text().await?;
3767        match content_type {
3768            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3769            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnIpupdateResponse`"))),
3770            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnIpupdateResponse`")))),
3771        }
3772    } else {
3773        let content = resp.text().await?;
3774        let entity: Option<ClusterSdnIpupdateError> = serde_json::from_str(&content).ok();
3775        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3776    }
3777}
3778
3779/// SDN Fabrics Index  Permissions: Only list fabrics where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/fabrics/<fabric>', only list nodes where you have 'Sys.Audit' or 'Sys.Modify' on /nodes/<node_id>
3780pub async fn cluster_sdn_list_all(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnListAllResponse, Error<ClusterSdnListAllError>> {
3781    // add a prefix to parameters to efficiently prevent name collisions
3782    let p_query_pending = pending;
3783    let p_query_running = running;
3784
3785    let uri_str = format!("{}/cluster/sdn/fabrics/all", configuration.base_path);
3786    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3787
3788    if let Some(ref param_value) = p_query_pending {
3789        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3790    }
3791    if let Some(ref param_value) = p_query_running {
3792        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3793    }
3794    if let Some(ref user_agent) = configuration.user_agent {
3795        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3796    }
3797    if let Some(ref apikey) = configuration.api_key {
3798        let key = apikey.key.clone();
3799        let value = match apikey.prefix {
3800            Some(ref prefix) => format!("{} {}", prefix, key),
3801            None => key,
3802        };
3803        req_builder = req_builder.header("Authorization", value);
3804    };
3805    if let Some(ref apikey) = configuration.api_key {
3806        let key = apikey.key.clone();
3807        let value = match apikey.prefix {
3808            Some(ref prefix) => format!("{} {}", prefix, key),
3809            None => key,
3810        };
3811        req_builder = req_builder.header("CSRFPreventionToken", value);
3812    };
3813
3814    let req = req_builder.build()?;
3815    let resp = configuration.client.execute(req).await?;
3816
3817    let status = resp.status();
3818    let content_type = resp
3819        .headers()
3820        .get("content-type")
3821        .and_then(|v| v.to_str().ok())
3822        .unwrap_or("application/octet-stream");
3823    let content_type = super::ContentType::from(content_type);
3824
3825    if !status.is_client_error() && !status.is_server_error() {
3826        let content = resp.text().await?;
3827        match content_type {
3828            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3829            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListAllResponse`"))),
3830            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListAllResponse`")))),
3831        }
3832    } else {
3833        let content = resp.text().await?;
3834        let entity: Option<ClusterSdnListAllError> = serde_json::from_str(&content).ok();
3835        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3836    }
3837}
3838
3839/// SDN Fabrics Index  Permissions: Only list nodes where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/fabrics/<fabric>' and 'Sys.Audit' or 'Sys.Modify' on /nodes/<node_id>
3840pub async fn cluster_sdn_list_nodes(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnListNodesResponse, Error<ClusterSdnListNodesError>> {
3841    // add a prefix to parameters to efficiently prevent name collisions
3842    let p_query_pending = pending;
3843    let p_query_running = running;
3844
3845    let uri_str = format!("{}/cluster/sdn/fabrics/node", configuration.base_path);
3846    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3847
3848    if let Some(ref param_value) = p_query_pending {
3849        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3850    }
3851    if let Some(ref param_value) = p_query_running {
3852        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3853    }
3854    if let Some(ref user_agent) = configuration.user_agent {
3855        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3856    }
3857    if let Some(ref apikey) = configuration.api_key {
3858        let key = apikey.key.clone();
3859        let value = match apikey.prefix {
3860            Some(ref prefix) => format!("{} {}", prefix, key),
3861            None => key,
3862        };
3863        req_builder = req_builder.header("Authorization", value);
3864    };
3865    if let Some(ref apikey) = configuration.api_key {
3866        let key = apikey.key.clone();
3867        let value = match apikey.prefix {
3868            Some(ref prefix) => format!("{} {}", prefix, key),
3869            None => key,
3870        };
3871        req_builder = req_builder.header("CSRFPreventionToken", value);
3872    };
3873
3874    let req = req_builder.build()?;
3875    let resp = configuration.client.execute(req).await?;
3876
3877    let status = resp.status();
3878    let content_type = resp
3879        .headers()
3880        .get("content-type")
3881        .and_then(|v| v.to_str().ok())
3882        .unwrap_or("application/octet-stream");
3883    let content_type = super::ContentType::from(content_type);
3884
3885    if !status.is_client_error() && !status.is_server_error() {
3886        let content = resp.text().await?;
3887        match content_type {
3888            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3889            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListNodesResponse`"))),
3890            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListNodesResponse`")))),
3891        }
3892    } else {
3893        let content = resp.text().await?;
3894        let entity: Option<ClusterSdnListNodesError> = serde_json::from_str(&content).ok();
3895        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3896    }
3897}
3898
3899/// SDN Fabrics Index  Permissions: Only returns nodes where you have 'Sys.Audit' or 'Sys.Modify' permissions.
3900pub async fn cluster_sdn_list_nodes_fabric(configuration: &configuration::Configuration, fabric_id: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnListNodesFabricResponse, Error<ClusterSdnListNodesFabricError>> {
3901    // add a prefix to parameters to efficiently prevent name collisions
3902    let p_path_fabric_id = fabric_id;
3903    let p_query_pending = pending;
3904    let p_query_running = running;
3905
3906    let uri_str = format!("{}/cluster/sdn/fabrics/node/{fabric_id}", configuration.base_path, fabric_id=crate::apis::urlencode(p_path_fabric_id));
3907    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3908
3909    if let Some(ref param_value) = p_query_pending {
3910        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3911    }
3912    if let Some(ref param_value) = p_query_running {
3913        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3914    }
3915    if let Some(ref user_agent) = configuration.user_agent {
3916        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3917    }
3918    if let Some(ref apikey) = configuration.api_key {
3919        let key = apikey.key.clone();
3920        let value = match apikey.prefix {
3921            Some(ref prefix) => format!("{} {}", prefix, key),
3922            None => key,
3923        };
3924        req_builder = req_builder.header("Authorization", value);
3925    };
3926    if let Some(ref apikey) = configuration.api_key {
3927        let key = apikey.key.clone();
3928        let value = match apikey.prefix {
3929            Some(ref prefix) => format!("{} {}", prefix, key),
3930            None => key,
3931        };
3932        req_builder = req_builder.header("CSRFPreventionToken", value);
3933    };
3934
3935    let req = req_builder.build()?;
3936    let resp = configuration.client.execute(req).await?;
3937
3938    let status = resp.status();
3939    let content_type = resp
3940        .headers()
3941        .get("content-type")
3942        .and_then(|v| v.to_str().ok())
3943        .unwrap_or("application/octet-stream");
3944    let content_type = super::ContentType::from(content_type);
3945
3946    if !status.is_client_error() && !status.is_server_error() {
3947        let content = resp.text().await?;
3948        match content_type {
3949            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3950            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListNodesFabricResponse`"))),
3951            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListNodesFabricResponse`")))),
3952        }
3953    } else {
3954        let content = resp.text().await?;
3955        let entity: Option<ClusterSdnListNodesFabricError> = serde_json::from_str(&content).ok();
3956        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3957    }
3958}
3959
3960/// List Prefix Lists  Permissions: Only returns prefix list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions.
3961pub async fn cluster_sdn_list_prefix_lists(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>, verbose: Option<models::PveBoolean>) -> Result<models::ClusterSdnListPrefixListsResponse, Error<ClusterSdnListPrefixListsError>> {
3962    // add a prefix to parameters to efficiently prevent name collisions
3963    let p_query_pending = pending;
3964    let p_query_running = running;
3965    let p_query_verbose = verbose;
3966
3967    let uri_str = format!("{}/cluster/sdn/prefix-lists", configuration.base_path);
3968    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3969
3970    if let Some(ref param_value) = p_query_pending {
3971        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
3972    }
3973    if let Some(ref param_value) = p_query_running {
3974        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
3975    }
3976    if let Some(ref param_value) = p_query_verbose {
3977        req_builder = req_builder.query(&[("verbose", &param_value.to_string())]);
3978    }
3979    if let Some(ref user_agent) = configuration.user_agent {
3980        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3981    }
3982    if let Some(ref apikey) = configuration.api_key {
3983        let key = apikey.key.clone();
3984        let value = match apikey.prefix {
3985            Some(ref prefix) => format!("{} {}", prefix, key),
3986            None => key,
3987        };
3988        req_builder = req_builder.header("Authorization", value);
3989    };
3990    if let Some(ref apikey) = configuration.api_key {
3991        let key = apikey.key.clone();
3992        let value = match apikey.prefix {
3993            Some(ref prefix) => format!("{} {}", prefix, key),
3994            None => key,
3995        };
3996        req_builder = req_builder.header("CSRFPreventionToken", value);
3997    };
3998
3999    let req = req_builder.build()?;
4000    let resp = configuration.client.execute(req).await?;
4001
4002    let status = resp.status();
4003    let content_type = resp
4004        .headers()
4005        .get("content-type")
4006        .and_then(|v| v.to_str().ok())
4007        .unwrap_or("application/octet-stream");
4008    let content_type = super::ContentType::from(content_type);
4009
4010    if !status.is_client_error() && !status.is_server_error() {
4011        let content = resp.text().await?;
4012        match content_type {
4013            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4014            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListPrefixListsResponse`"))),
4015            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListPrefixListsResponse`")))),
4016        }
4017    } else {
4018        let content = resp.text().await?;
4019        let entity: Option<ClusterSdnListPrefixListsError> = serde_json::from_str(&content).ok();
4020        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4021    }
4022}
4023
4024/// Lists all route map entries.  Permissions: Only returns route map entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions.
4025pub async fn cluster_sdn_list_route_map_entries(configuration: &configuration::Configuration, pending: Option<models::PveBoolean>, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnListRouteMapEntriesResponse, Error<ClusterSdnListRouteMapEntriesError>> {
4026    // add a prefix to parameters to efficiently prevent name collisions
4027    let p_query_pending = pending;
4028    let p_query_running = running;
4029
4030    let uri_str = format!("{}/cluster/sdn/route-maps/entries", configuration.base_path);
4031    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4032
4033    if let Some(ref param_value) = p_query_pending {
4034        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4035    }
4036    if let Some(ref param_value) = p_query_running {
4037        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4038    }
4039    if let Some(ref user_agent) = configuration.user_agent {
4040        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4041    }
4042    if let Some(ref apikey) = configuration.api_key {
4043        let key = apikey.key.clone();
4044        let value = match apikey.prefix {
4045            Some(ref prefix) => format!("{} {}", prefix, key),
4046            None => key,
4047        };
4048        req_builder = req_builder.header("Authorization", value);
4049    };
4050    if let Some(ref apikey) = configuration.api_key {
4051        let key = apikey.key.clone();
4052        let value = match apikey.prefix {
4053            Some(ref prefix) => format!("{} {}", prefix, key),
4054            None => key,
4055        };
4056        req_builder = req_builder.header("CSRFPreventionToken", value);
4057    };
4058
4059    let req = req_builder.build()?;
4060    let resp = configuration.client.execute(req).await?;
4061
4062    let status = resp.status();
4063    let content_type = resp
4064        .headers()
4065        .get("content-type")
4066        .and_then(|v| v.to_str().ok())
4067        .unwrap_or("application/octet-stream");
4068    let content_type = super::ContentType::from(content_type);
4069
4070    if !status.is_client_error() && !status.is_server_error() {
4071        let content = resp.text().await?;
4072        match content_type {
4073            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4074            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListRouteMapEntriesResponse`"))),
4075            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListRouteMapEntriesResponse`")))),
4076        }
4077    } else {
4078        let content = resp.text().await?;
4079        let entity: Option<ClusterSdnListRouteMapEntriesError> = serde_json::from_str(&content).ok();
4080        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4081    }
4082}
4083
4084/// List all entries for a given Route Map
4085pub async fn cluster_sdn_list_route_map_entries_for_route_map(configuration: &configuration::Configuration, route_map_id: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnListRouteMapEntriesForRouteMapResponse, Error<ClusterSdnListRouteMapEntriesForRouteMapError>> {
4086    // add a prefix to parameters to efficiently prevent name collisions
4087    let p_path_route_map_id = route_map_id;
4088    let p_query_pending = pending;
4089    let p_query_running = running;
4090
4091    let uri_str = format!("{}/cluster/sdn/route-maps/entries/{route_map_id}", configuration.base_path, route_map_id=crate::apis::urlencode(p_path_route_map_id));
4092    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4093
4094    if let Some(ref param_value) = p_query_pending {
4095        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4096    }
4097    if let Some(ref param_value) = p_query_running {
4098        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4099    }
4100    if let Some(ref user_agent) = configuration.user_agent {
4101        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4102    }
4103    if let Some(ref apikey) = configuration.api_key {
4104        let key = apikey.key.clone();
4105        let value = match apikey.prefix {
4106            Some(ref prefix) => format!("{} {}", prefix, key),
4107            None => key,
4108        };
4109        req_builder = req_builder.header("Authorization", value);
4110    };
4111    if let Some(ref apikey) = configuration.api_key {
4112        let key = apikey.key.clone();
4113        let value = match apikey.prefix {
4114            Some(ref prefix) => format!("{} {}", prefix, key),
4115            None => key,
4116        };
4117        req_builder = req_builder.header("CSRFPreventionToken", value);
4118    };
4119
4120    let req = req_builder.build()?;
4121    let resp = configuration.client.execute(req).await?;
4122
4123    let status = resp.status();
4124    let content_type = resp
4125        .headers()
4126        .get("content-type")
4127        .and_then(|v| v.to_str().ok())
4128        .unwrap_or("application/octet-stream");
4129    let content_type = super::ContentType::from(content_type);
4130
4131    if !status.is_client_error() && !status.is_server_error() {
4132        let content = resp.text().await?;
4133        match content_type {
4134            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4135            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListRouteMapEntriesForRouteMapResponse`"))),
4136            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListRouteMapEntriesForRouteMapResponse`")))),
4137        }
4138    } else {
4139        let content = resp.text().await?;
4140        let entity: Option<ClusterSdnListRouteMapEntriesForRouteMapError> = serde_json::from_str(&content).ok();
4141        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4142    }
4143}
4144
4145/// List Route Maps  Permissions: Only returns route maps where you have 'SDN.Audit' or 'SDN.Allocate' permissions.
4146pub async fn cluster_sdn_list_route_maps(configuration: &configuration::Configuration, running: Option<models::PveBoolean>) -> Result<models::ClusterSdnListRouteMapsResponse, Error<ClusterSdnListRouteMapsError>> {
4147    // add a prefix to parameters to efficiently prevent name collisions
4148    let p_query_running = running;
4149
4150    let uri_str = format!("{}/cluster/sdn/route-maps", configuration.base_path);
4151    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4152
4153    if let Some(ref param_value) = p_query_running {
4154        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4155    }
4156    if let Some(ref user_agent) = configuration.user_agent {
4157        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4158    }
4159    if let Some(ref apikey) = configuration.api_key {
4160        let key = apikey.key.clone();
4161        let value = match apikey.prefix {
4162            Some(ref prefix) => format!("{} {}", prefix, key),
4163            None => key,
4164        };
4165        req_builder = req_builder.header("Authorization", value);
4166    };
4167    if let Some(ref apikey) = configuration.api_key {
4168        let key = apikey.key.clone();
4169        let value = match apikey.prefix {
4170            Some(ref prefix) => format!("{} {}", prefix, key),
4171            None => key,
4172        };
4173        req_builder = req_builder.header("CSRFPreventionToken", value);
4174    };
4175
4176    let req = req_builder.build()?;
4177    let resp = configuration.client.execute(req).await?;
4178
4179    let status = resp.status();
4180    let content_type = resp
4181        .headers()
4182        .get("content-type")
4183        .and_then(|v| v.to_str().ok())
4184        .unwrap_or("application/octet-stream");
4185    let content_type = super::ContentType::from(content_type);
4186
4187    if !status.is_client_error() && !status.is_server_error() {
4188        let content = resp.text().await?;
4189        match content_type {
4190            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4191            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnListRouteMapsResponse`"))),
4192            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnListRouteMapsResponse`")))),
4193        }
4194    } else {
4195        let content = resp.text().await?;
4196        let entity: Option<ClusterSdnListRouteMapsError> = serde_json::from_str(&content).ok();
4197        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4198    }
4199}
4200
4201/// Acquire global lock for SDN configuration
4202pub async fn cluster_sdn_lock(configuration: &configuration::Configuration, cluster_sdn_lock_request: Option<models::ClusterSdnLockRequest>) -> Result<models::ClusterSdnLockResponse, Error<ClusterSdnLockError>> {
4203    // add a prefix to parameters to efficiently prevent name collisions
4204    let p_body_cluster_sdn_lock_request = cluster_sdn_lock_request;
4205
4206    let uri_str = format!("{}/cluster/sdn/lock", configuration.base_path);
4207    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4208
4209    if let Some(ref user_agent) = configuration.user_agent {
4210        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4211    }
4212    if let Some(ref apikey) = configuration.api_key {
4213        let key = apikey.key.clone();
4214        let value = match apikey.prefix {
4215            Some(ref prefix) => format!("{} {}", prefix, key),
4216            None => key,
4217        };
4218        req_builder = req_builder.header("Authorization", value);
4219    };
4220    if let Some(ref apikey) = configuration.api_key {
4221        let key = apikey.key.clone();
4222        let value = match apikey.prefix {
4223            Some(ref prefix) => format!("{} {}", prefix, key),
4224            None => key,
4225        };
4226        req_builder = req_builder.header("CSRFPreventionToken", value);
4227    };
4228    req_builder = req_builder.json(&p_body_cluster_sdn_lock_request);
4229
4230    let req = req_builder.build()?;
4231    let resp = configuration.client.execute(req).await?;
4232
4233    let status = resp.status();
4234    let content_type = resp
4235        .headers()
4236        .get("content-type")
4237        .and_then(|v| v.to_str().ok())
4238        .unwrap_or("application/octet-stream");
4239    let content_type = super::ContentType::from(content_type);
4240
4241    if !status.is_client_error() && !status.is_server_error() {
4242        let content = resp.text().await?;
4243        match content_type {
4244            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4245            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnLockResponse`"))),
4246            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnLockResponse`")))),
4247        }
4248    } else {
4249        let content = resp.text().await?;
4250        let entity: Option<ClusterSdnLockError> = serde_json::from_str(&content).ok();
4251        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4252    }
4253}
4254
4255/// Read sdn controller configuration.
4256pub async fn cluster_sdn_read_get_controllers(configuration: &configuration::Configuration, controller: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnReadGetControllersResponse, Error<ClusterSdnReadGetControllersError>> {
4257    // add a prefix to parameters to efficiently prevent name collisions
4258    let p_path_controller = controller;
4259    let p_query_pending = pending;
4260    let p_query_running = running;
4261
4262    let uri_str = format!("{}/cluster/sdn/controllers/{controller}", configuration.base_path, controller=crate::apis::urlencode(p_path_controller));
4263    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4264
4265    if let Some(ref param_value) = p_query_pending {
4266        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4267    }
4268    if let Some(ref param_value) = p_query_running {
4269        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4270    }
4271    if let Some(ref user_agent) = configuration.user_agent {
4272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4273    }
4274    if let Some(ref apikey) = configuration.api_key {
4275        let key = apikey.key.clone();
4276        let value = match apikey.prefix {
4277            Some(ref prefix) => format!("{} {}", prefix, key),
4278            None => key,
4279        };
4280        req_builder = req_builder.header("Authorization", value);
4281    };
4282    if let Some(ref apikey) = configuration.api_key {
4283        let key = apikey.key.clone();
4284        let value = match apikey.prefix {
4285            Some(ref prefix) => format!("{} {}", prefix, key),
4286            None => key,
4287        };
4288        req_builder = req_builder.header("CSRFPreventionToken", value);
4289    };
4290
4291    let req = req_builder.build()?;
4292    let resp = configuration.client.execute(req).await?;
4293
4294    let status = resp.status();
4295    let content_type = resp
4296        .headers()
4297        .get("content-type")
4298        .and_then(|v| v.to_str().ok())
4299        .unwrap_or("application/octet-stream");
4300    let content_type = super::ContentType::from(content_type);
4301
4302    if !status.is_client_error() && !status.is_server_error() {
4303        let content = resp.text().await?;
4304        match content_type {
4305            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4306            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetControllersResponse`"))),
4307            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetControllersResponse`")))),
4308        }
4309    } else {
4310        let content = resp.text().await?;
4311        let entity: Option<ClusterSdnReadGetControllersError> = serde_json::from_str(&content).ok();
4312        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4313    }
4314}
4315
4316/// Read sdn dns configuration.
4317pub async fn cluster_sdn_read_get_dns(configuration: &configuration::Configuration, dns: &str) -> Result<models::ClusterSdnReadGetDnsResponse, Error<ClusterSdnReadGetDnsError>> {
4318    // add a prefix to parameters to efficiently prevent name collisions
4319    let p_path_dns = dns;
4320
4321    let uri_str = format!("{}/cluster/sdn/dns/{dns}", configuration.base_path, dns=crate::apis::urlencode(p_path_dns));
4322    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4323
4324    if let Some(ref user_agent) = configuration.user_agent {
4325        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4326    }
4327    if let Some(ref apikey) = configuration.api_key {
4328        let key = apikey.key.clone();
4329        let value = match apikey.prefix {
4330            Some(ref prefix) => format!("{} {}", prefix, key),
4331            None => key,
4332        };
4333        req_builder = req_builder.header("Authorization", value);
4334    };
4335    if let Some(ref apikey) = configuration.api_key {
4336        let key = apikey.key.clone();
4337        let value = match apikey.prefix {
4338            Some(ref prefix) => format!("{} {}", prefix, key),
4339            None => key,
4340        };
4341        req_builder = req_builder.header("CSRFPreventionToken", value);
4342    };
4343
4344    let req = req_builder.build()?;
4345    let resp = configuration.client.execute(req).await?;
4346
4347    let status = resp.status();
4348    let content_type = resp
4349        .headers()
4350        .get("content-type")
4351        .and_then(|v| v.to_str().ok())
4352        .unwrap_or("application/octet-stream");
4353    let content_type = super::ContentType::from(content_type);
4354
4355    if !status.is_client_error() && !status.is_server_error() {
4356        let content = resp.text().await?;
4357        match content_type {
4358            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4359            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetDnsResponse`"))),
4360            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetDnsResponse`")))),
4361        }
4362    } else {
4363        let content = resp.text().await?;
4364        let entity: Option<ClusterSdnReadGetDnsError> = serde_json::from_str(&content).ok();
4365        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4366    }
4367}
4368
4369/// Read sdn ipam configuration.
4370pub async fn cluster_sdn_read_get_ipams(configuration: &configuration::Configuration, ipam: &str) -> Result<models::ClusterSdnReadGetIpamsResponse, Error<ClusterSdnReadGetIpamsError>> {
4371    // add a prefix to parameters to efficiently prevent name collisions
4372    let p_path_ipam = ipam;
4373
4374    let uri_str = format!("{}/cluster/sdn/ipams/{ipam}", configuration.base_path, ipam=crate::apis::urlencode(p_path_ipam));
4375    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4376
4377    if let Some(ref user_agent) = configuration.user_agent {
4378        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4379    }
4380    if let Some(ref apikey) = configuration.api_key {
4381        let key = apikey.key.clone();
4382        let value = match apikey.prefix {
4383            Some(ref prefix) => format!("{} {}", prefix, key),
4384            None => key,
4385        };
4386        req_builder = req_builder.header("Authorization", value);
4387    };
4388    if let Some(ref apikey) = configuration.api_key {
4389        let key = apikey.key.clone();
4390        let value = match apikey.prefix {
4391            Some(ref prefix) => format!("{} {}", prefix, key),
4392            None => key,
4393        };
4394        req_builder = req_builder.header("CSRFPreventionToken", value);
4395    };
4396
4397    let req = req_builder.build()?;
4398    let resp = configuration.client.execute(req).await?;
4399
4400    let status = resp.status();
4401    let content_type = resp
4402        .headers()
4403        .get("content-type")
4404        .and_then(|v| v.to_str().ok())
4405        .unwrap_or("application/octet-stream");
4406    let content_type = super::ContentType::from(content_type);
4407
4408    if !status.is_client_error() && !status.is_server_error() {
4409        let content = resp.text().await?;
4410        match content_type {
4411            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4412            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetIpamsResponse`"))),
4413            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetIpamsResponse`")))),
4414        }
4415    } else {
4416        let content = resp.text().await?;
4417        let entity: Option<ClusterSdnReadGetIpamsError> = serde_json::from_str(&content).ok();
4418        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4419    }
4420}
4421
4422/// Read sdn subnet configuration.  Permissions: Require 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>/<vnet>'
4423pub async fn cluster_sdn_read_get_subnets(configuration: &configuration::Configuration, subnet: &str, vnet: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnReadGetSubnetsResponse, Error<ClusterSdnReadGetSubnetsError>> {
4424    // add a prefix to parameters to efficiently prevent name collisions
4425    let p_path_subnet = subnet;
4426    let p_path_vnet = vnet;
4427    let p_query_pending = pending;
4428    let p_query_running = running;
4429
4430    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/subnets/{subnet}", configuration.base_path, subnet=crate::apis::urlencode(p_path_subnet), vnet=crate::apis::urlencode(p_path_vnet));
4431    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4432
4433    if let Some(ref param_value) = p_query_pending {
4434        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4435    }
4436    if let Some(ref param_value) = p_query_running {
4437        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4438    }
4439    if let Some(ref user_agent) = configuration.user_agent {
4440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4441    }
4442    if let Some(ref apikey) = configuration.api_key {
4443        let key = apikey.key.clone();
4444        let value = match apikey.prefix {
4445            Some(ref prefix) => format!("{} {}", prefix, key),
4446            None => key,
4447        };
4448        req_builder = req_builder.header("Authorization", value);
4449    };
4450    if let Some(ref apikey) = configuration.api_key {
4451        let key = apikey.key.clone();
4452        let value = match apikey.prefix {
4453            Some(ref prefix) => format!("{} {}", prefix, key),
4454            None => key,
4455        };
4456        req_builder = req_builder.header("CSRFPreventionToken", value);
4457    };
4458
4459    let req = req_builder.build()?;
4460    let resp = configuration.client.execute(req).await?;
4461
4462    let status = resp.status();
4463    let content_type = resp
4464        .headers()
4465        .get("content-type")
4466        .and_then(|v| v.to_str().ok())
4467        .unwrap_or("application/octet-stream");
4468    let content_type = super::ContentType::from(content_type);
4469
4470    if !status.is_client_error() && !status.is_server_error() {
4471        let content = resp.text().await?;
4472        match content_type {
4473            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4474            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetSubnetsResponse`"))),
4475            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetSubnetsResponse`")))),
4476        }
4477    } else {
4478        let content = resp.text().await?;
4479        let entity: Option<ClusterSdnReadGetSubnetsError> = serde_json::from_str(&content).ok();
4480        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4481    }
4482}
4483
4484/// Read sdn vnet configuration.  Permissions: Require 'SDN.Audit' or 'SDN.Allocate' permissions on '/sdn/zones/<zone>/<vnet>'
4485pub async fn cluster_sdn_read_get_vnets(configuration: &configuration::Configuration, vnet: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnReadGetVnetsResponse, Error<ClusterSdnReadGetVnetsError>> {
4486    // add a prefix to parameters to efficiently prevent name collisions
4487    let p_path_vnet = vnet;
4488    let p_query_pending = pending;
4489    let p_query_running = running;
4490
4491    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
4492    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4493
4494    if let Some(ref param_value) = p_query_pending {
4495        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4496    }
4497    if let Some(ref param_value) = p_query_running {
4498        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4499    }
4500    if let Some(ref user_agent) = configuration.user_agent {
4501        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4502    }
4503    if let Some(ref apikey) = configuration.api_key {
4504        let key = apikey.key.clone();
4505        let value = match apikey.prefix {
4506            Some(ref prefix) => format!("{} {}", prefix, key),
4507            None => key,
4508        };
4509        req_builder = req_builder.header("Authorization", value);
4510    };
4511    if let Some(ref apikey) = configuration.api_key {
4512        let key = apikey.key.clone();
4513        let value = match apikey.prefix {
4514            Some(ref prefix) => format!("{} {}", prefix, key),
4515            None => key,
4516        };
4517        req_builder = req_builder.header("CSRFPreventionToken", value);
4518    };
4519
4520    let req = req_builder.build()?;
4521    let resp = configuration.client.execute(req).await?;
4522
4523    let status = resp.status();
4524    let content_type = resp
4525        .headers()
4526        .get("content-type")
4527        .and_then(|v| v.to_str().ok())
4528        .unwrap_or("application/octet-stream");
4529    let content_type = super::ContentType::from(content_type);
4530
4531    if !status.is_client_error() && !status.is_server_error() {
4532        let content = resp.text().await?;
4533        match content_type {
4534            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4535            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetVnetsResponse`"))),
4536            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetVnetsResponse`")))),
4537        }
4538    } else {
4539        let content = resp.text().await?;
4540        let entity: Option<ClusterSdnReadGetVnetsError> = serde_json::from_str(&content).ok();
4541        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4542    }
4543}
4544
4545/// Read sdn zone configuration.
4546pub async fn cluster_sdn_read_get_zones(configuration: &configuration::Configuration, zone: &str, pending: Option<&str>, running: Option<&str>) -> Result<models::ClusterSdnReadGetZonesResponse, Error<ClusterSdnReadGetZonesError>> {
4547    // add a prefix to parameters to efficiently prevent name collisions
4548    let p_path_zone = zone;
4549    let p_query_pending = pending;
4550    let p_query_running = running;
4551
4552    let uri_str = format!("{}/cluster/sdn/zones/{zone}", configuration.base_path, zone=crate::apis::urlencode(p_path_zone));
4553    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4554
4555    if let Some(ref param_value) = p_query_pending {
4556        req_builder = req_builder.query(&[("pending", &param_value.to_string())]);
4557    }
4558    if let Some(ref param_value) = p_query_running {
4559        req_builder = req_builder.query(&[("running", &param_value.to_string())]);
4560    }
4561    if let Some(ref user_agent) = configuration.user_agent {
4562        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4563    }
4564    if let Some(ref apikey) = configuration.api_key {
4565        let key = apikey.key.clone();
4566        let value = match apikey.prefix {
4567            Some(ref prefix) => format!("{} {}", prefix, key),
4568            None => key,
4569        };
4570        req_builder = req_builder.header("Authorization", value);
4571    };
4572    if let Some(ref apikey) = configuration.api_key {
4573        let key = apikey.key.clone();
4574        let value = match apikey.prefix {
4575            Some(ref prefix) => format!("{} {}", prefix, key),
4576            None => key,
4577        };
4578        req_builder = req_builder.header("CSRFPreventionToken", value);
4579    };
4580
4581    let req = req_builder.build()?;
4582    let resp = configuration.client.execute(req).await?;
4583
4584    let status = resp.status();
4585    let content_type = resp
4586        .headers()
4587        .get("content-type")
4588        .and_then(|v| v.to_str().ok())
4589        .unwrap_or("application/octet-stream");
4590    let content_type = super::ContentType::from(content_type);
4591
4592    if !status.is_client_error() && !status.is_server_error() {
4593        let content = resp.text().await?;
4594        match content_type {
4595            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4596            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReadGetZonesResponse`"))),
4597            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReadGetZonesResponse`")))),
4598        }
4599    } else {
4600        let content = resp.text().await?;
4601        let entity: Option<ClusterSdnReadGetZonesError> = serde_json::from_str(&content).ok();
4602        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4603    }
4604}
4605
4606/// Release global lock for SDN configuration
4607pub async fn cluster_sdn_release_lock(configuration: &configuration::Configuration, force: Option<models::PveBoolean>, lock_token: Option<&str>) -> Result<models::ClusterSdnReleaseLockResponse, Error<ClusterSdnReleaseLockError>> {
4608    // add a prefix to parameters to efficiently prevent name collisions
4609    let p_query_force = force;
4610    let p_query_lock_token = lock_token;
4611
4612    let uri_str = format!("{}/cluster/sdn/lock", configuration.base_path);
4613    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4614
4615    if let Some(ref param_value) = p_query_force {
4616        req_builder = req_builder.query(&[("force", &param_value.to_string())]);
4617    }
4618    if let Some(ref param_value) = p_query_lock_token {
4619        req_builder = req_builder.query(&[("lock-token", &param_value.to_string())]);
4620    }
4621    if let Some(ref user_agent) = configuration.user_agent {
4622        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4623    }
4624    if let Some(ref apikey) = configuration.api_key {
4625        let key = apikey.key.clone();
4626        let value = match apikey.prefix {
4627            Some(ref prefix) => format!("{} {}", prefix, key),
4628            None => key,
4629        };
4630        req_builder = req_builder.header("Authorization", value);
4631    };
4632    if let Some(ref apikey) = configuration.api_key {
4633        let key = apikey.key.clone();
4634        let value = match apikey.prefix {
4635            Some(ref prefix) => format!("{} {}", prefix, key),
4636            None => key,
4637        };
4638        req_builder = req_builder.header("CSRFPreventionToken", value);
4639    };
4640
4641    let req = req_builder.build()?;
4642    let resp = configuration.client.execute(req).await?;
4643
4644    let status = resp.status();
4645    let content_type = resp
4646        .headers()
4647        .get("content-type")
4648        .and_then(|v| v.to_str().ok())
4649        .unwrap_or("application/octet-stream");
4650    let content_type = super::ContentType::from(content_type);
4651
4652    if !status.is_client_error() && !status.is_server_error() {
4653        let content = resp.text().await?;
4654        match content_type {
4655            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4656            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReleaseLockResponse`"))),
4657            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReleaseLockResponse`")))),
4658        }
4659    } else {
4660        let content = resp.text().await?;
4661        let entity: Option<ClusterSdnReleaseLockError> = serde_json::from_str(&content).ok();
4662        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4663    }
4664}
4665
4666/// Apply sdn controller changes && reload.
4667pub async fn cluster_sdn_reload(configuration: &configuration::Configuration, cluster_sdn_reload_request: Option<models::ClusterSdnReloadRequest>) -> Result<models::ClusterSdnReloadResponse, Error<ClusterSdnReloadError>> {
4668    // add a prefix to parameters to efficiently prevent name collisions
4669    let p_body_cluster_sdn_reload_request = cluster_sdn_reload_request;
4670
4671    let uri_str = format!("{}/cluster/sdn", configuration.base_path);
4672    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4673
4674    if let Some(ref user_agent) = configuration.user_agent {
4675        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4676    }
4677    if let Some(ref apikey) = configuration.api_key {
4678        let key = apikey.key.clone();
4679        let value = match apikey.prefix {
4680            Some(ref prefix) => format!("{} {}", prefix, key),
4681            None => key,
4682        };
4683        req_builder = req_builder.header("Authorization", value);
4684    };
4685    if let Some(ref apikey) = configuration.api_key {
4686        let key = apikey.key.clone();
4687        let value = match apikey.prefix {
4688            Some(ref prefix) => format!("{} {}", prefix, key),
4689            None => key,
4690        };
4691        req_builder = req_builder.header("CSRFPreventionToken", value);
4692    };
4693    req_builder = req_builder.json(&p_body_cluster_sdn_reload_request);
4694
4695    let req = req_builder.build()?;
4696    let resp = configuration.client.execute(req).await?;
4697
4698    let status = resp.status();
4699    let content_type = resp
4700        .headers()
4701        .get("content-type")
4702        .and_then(|v| v.to_str().ok())
4703        .unwrap_or("application/octet-stream");
4704    let content_type = super::ContentType::from(content_type);
4705
4706    if !status.is_client_error() && !status.is_server_error() {
4707        let content = resp.text().await?;
4708        match content_type {
4709            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4710            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnReloadResponse`"))),
4711            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnReloadResponse`")))),
4712        }
4713    } else {
4714        let content = resp.text().await?;
4715        let entity: Option<ClusterSdnReloadError> = serde_json::from_str(&content).ok();
4716        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4717    }
4718}
4719
4720/// Rollback pending changes to SDN configuration
4721pub async fn cluster_sdn_rollback(configuration: &configuration::Configuration, cluster_sdn_rollback_request: Option<models::ClusterSdnRollbackRequest>) -> Result<models::ClusterSdnRollbackResponse, Error<ClusterSdnRollbackError>> {
4722    // add a prefix to parameters to efficiently prevent name collisions
4723    let p_body_cluster_sdn_rollback_request = cluster_sdn_rollback_request;
4724
4725    let uri_str = format!("{}/cluster/sdn/rollback", configuration.base_path);
4726    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4727
4728    if let Some(ref user_agent) = configuration.user_agent {
4729        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4730    }
4731    if let Some(ref apikey) = configuration.api_key {
4732        let key = apikey.key.clone();
4733        let value = match apikey.prefix {
4734            Some(ref prefix) => format!("{} {}", prefix, key),
4735            None => key,
4736        };
4737        req_builder = req_builder.header("Authorization", value);
4738    };
4739    if let Some(ref apikey) = configuration.api_key {
4740        let key = apikey.key.clone();
4741        let value = match apikey.prefix {
4742            Some(ref prefix) => format!("{} {}", prefix, key),
4743            None => key,
4744        };
4745        req_builder = req_builder.header("CSRFPreventionToken", value);
4746    };
4747    req_builder = req_builder.json(&p_body_cluster_sdn_rollback_request);
4748
4749    let req = req_builder.build()?;
4750    let resp = configuration.client.execute(req).await?;
4751
4752    let status = resp.status();
4753    let content_type = resp
4754        .headers()
4755        .get("content-type")
4756        .and_then(|v| v.to_str().ok())
4757        .unwrap_or("application/octet-stream");
4758    let content_type = super::ContentType::from(content_type);
4759
4760    if !status.is_client_error() && !status.is_server_error() {
4761        let content = resp.text().await?;
4762        match content_type {
4763            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4764            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnRollbackResponse`"))),
4765            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnRollbackResponse`")))),
4766        }
4767    } else {
4768        let content = resp.text().await?;
4769        let entity: Option<ClusterSdnRollbackError> = serde_json::from_str(&content).ok();
4770        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4771    }
4772}
4773
4774/// Set Firewall options.  Permissions: Needs SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
4775pub async fn cluster_sdn_set_options(configuration: &configuration::Configuration, vnet: &str, cluster_sdn_set_options_request: Option<models::ClusterSdnSetOptionsRequest>) -> Result<models::ClusterSdnSetOptionsResponse, Error<ClusterSdnSetOptionsError>> {
4776    // add a prefix to parameters to efficiently prevent name collisions
4777    let p_path_vnet = vnet;
4778    let p_body_cluster_sdn_set_options_request = cluster_sdn_set_options_request;
4779
4780    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/options", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
4781    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4782
4783    if let Some(ref user_agent) = configuration.user_agent {
4784        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4785    }
4786    if let Some(ref apikey) = configuration.api_key {
4787        let key = apikey.key.clone();
4788        let value = match apikey.prefix {
4789            Some(ref prefix) => format!("{} {}", prefix, key),
4790            None => key,
4791        };
4792        req_builder = req_builder.header("Authorization", value);
4793    };
4794    if let Some(ref apikey) = configuration.api_key {
4795        let key = apikey.key.clone();
4796        let value = match apikey.prefix {
4797            Some(ref prefix) => format!("{} {}", prefix, key),
4798            None => key,
4799        };
4800        req_builder = req_builder.header("CSRFPreventionToken", value);
4801    };
4802    req_builder = req_builder.json(&p_body_cluster_sdn_set_options_request);
4803
4804    let req = req_builder.build()?;
4805    let resp = configuration.client.execute(req).await?;
4806
4807    let status = resp.status();
4808    let content_type = resp
4809        .headers()
4810        .get("content-type")
4811        .and_then(|v| v.to_str().ok())
4812        .unwrap_or("application/octet-stream");
4813    let content_type = super::ContentType::from(content_type);
4814
4815    if !status.is_client_error() && !status.is_server_error() {
4816        let content = resp.text().await?;
4817        match content_type {
4818            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4819            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnSetOptionsResponse`"))),
4820            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnSetOptionsResponse`")))),
4821        }
4822    } else {
4823        let content = resp.text().await?;
4824        let entity: Option<ClusterSdnSetOptionsError> = serde_json::from_str(&content).ok();
4825        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4826    }
4827}
4828
4829/// Update sdn controller object configuration.
4830pub async fn cluster_sdn_update_controllers(configuration: &configuration::Configuration, controller: &str, cluster_sdn_update_controllers_request: Option<models::ClusterSdnUpdateControllersRequest>) -> Result<models::ClusterSdnUpdateControllersResponse, Error<ClusterSdnUpdateControllersError>> {
4831    // add a prefix to parameters to efficiently prevent name collisions
4832    let p_path_controller = controller;
4833    let p_body_cluster_sdn_update_controllers_request = cluster_sdn_update_controllers_request;
4834
4835    let uri_str = format!("{}/cluster/sdn/controllers/{controller}", configuration.base_path, controller=crate::apis::urlencode(p_path_controller));
4836    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4837
4838    if let Some(ref user_agent) = configuration.user_agent {
4839        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4840    }
4841    if let Some(ref apikey) = configuration.api_key {
4842        let key = apikey.key.clone();
4843        let value = match apikey.prefix {
4844            Some(ref prefix) => format!("{} {}", prefix, key),
4845            None => key,
4846        };
4847        req_builder = req_builder.header("Authorization", value);
4848    };
4849    if let Some(ref apikey) = configuration.api_key {
4850        let key = apikey.key.clone();
4851        let value = match apikey.prefix {
4852            Some(ref prefix) => format!("{} {}", prefix, key),
4853            None => key,
4854        };
4855        req_builder = req_builder.header("CSRFPreventionToken", value);
4856    };
4857    req_builder = req_builder.json(&p_body_cluster_sdn_update_controllers_request);
4858
4859    let req = req_builder.build()?;
4860    let resp = configuration.client.execute(req).await?;
4861
4862    let status = resp.status();
4863    let content_type = resp
4864        .headers()
4865        .get("content-type")
4866        .and_then(|v| v.to_str().ok())
4867        .unwrap_or("application/octet-stream");
4868    let content_type = super::ContentType::from(content_type);
4869
4870    if !status.is_client_error() && !status.is_server_error() {
4871        let content = resp.text().await?;
4872        match content_type {
4873            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4874            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateControllersResponse`"))),
4875            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateControllersResponse`")))),
4876        }
4877    } else {
4878        let content = resp.text().await?;
4879        let entity: Option<ClusterSdnUpdateControllersError> = serde_json::from_str(&content).ok();
4880        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4881    }
4882}
4883
4884/// Update sdn dns object configuration.
4885pub async fn cluster_sdn_update_dns(configuration: &configuration::Configuration, dns: &str, cluster_sdn_update_dns_request: Option<models::ClusterSdnUpdateDnsRequest>) -> Result<models::ClusterSdnUpdateDnsResponse, Error<ClusterSdnUpdateDnsError>> {
4886    // add a prefix to parameters to efficiently prevent name collisions
4887    let p_path_dns = dns;
4888    let p_body_cluster_sdn_update_dns_request = cluster_sdn_update_dns_request;
4889
4890    let uri_str = format!("{}/cluster/sdn/dns/{dns}", configuration.base_path, dns=crate::apis::urlencode(p_path_dns));
4891    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4892
4893    if let Some(ref user_agent) = configuration.user_agent {
4894        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4895    }
4896    if let Some(ref apikey) = configuration.api_key {
4897        let key = apikey.key.clone();
4898        let value = match apikey.prefix {
4899            Some(ref prefix) => format!("{} {}", prefix, key),
4900            None => key,
4901        };
4902        req_builder = req_builder.header("Authorization", value);
4903    };
4904    if let Some(ref apikey) = configuration.api_key {
4905        let key = apikey.key.clone();
4906        let value = match apikey.prefix {
4907            Some(ref prefix) => format!("{} {}", prefix, key),
4908            None => key,
4909        };
4910        req_builder = req_builder.header("CSRFPreventionToken", value);
4911    };
4912    req_builder = req_builder.json(&p_body_cluster_sdn_update_dns_request);
4913
4914    let req = req_builder.build()?;
4915    let resp = configuration.client.execute(req).await?;
4916
4917    let status = resp.status();
4918    let content_type = resp
4919        .headers()
4920        .get("content-type")
4921        .and_then(|v| v.to_str().ok())
4922        .unwrap_or("application/octet-stream");
4923    let content_type = super::ContentType::from(content_type);
4924
4925    if !status.is_client_error() && !status.is_server_error() {
4926        let content = resp.text().await?;
4927        match content_type {
4928            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4929            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateDnsResponse`"))),
4930            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateDnsResponse`")))),
4931        }
4932    } else {
4933        let content = resp.text().await?;
4934        let entity: Option<ClusterSdnUpdateDnsError> = serde_json::from_str(&content).ok();
4935        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4936    }
4937}
4938
4939/// Update a fabric
4940pub async fn cluster_sdn_update_fabric(configuration: &configuration::Configuration, id: &str, cluster_sdn_update_fabric_request: models::ClusterSdnUpdateFabricRequest) -> Result<models::ClusterSdnUpdateFabricResponse, Error<ClusterSdnUpdateFabricError>> {
4941    // add a prefix to parameters to efficiently prevent name collisions
4942    let p_path_id = id;
4943    let p_body_cluster_sdn_update_fabric_request = cluster_sdn_update_fabric_request;
4944
4945    let uri_str = format!("{}/cluster/sdn/fabrics/fabric/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
4946    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4947
4948    if let Some(ref user_agent) = configuration.user_agent {
4949        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4950    }
4951    if let Some(ref apikey) = configuration.api_key {
4952        let key = apikey.key.clone();
4953        let value = match apikey.prefix {
4954            Some(ref prefix) => format!("{} {}", prefix, key),
4955            None => key,
4956        };
4957        req_builder = req_builder.header("Authorization", value);
4958    };
4959    if let Some(ref apikey) = configuration.api_key {
4960        let key = apikey.key.clone();
4961        let value = match apikey.prefix {
4962            Some(ref prefix) => format!("{} {}", prefix, key),
4963            None => key,
4964        };
4965        req_builder = req_builder.header("CSRFPreventionToken", value);
4966    };
4967    req_builder = req_builder.json(&p_body_cluster_sdn_update_fabric_request);
4968
4969    let req = req_builder.build()?;
4970    let resp = configuration.client.execute(req).await?;
4971
4972    let status = resp.status();
4973    let content_type = resp
4974        .headers()
4975        .get("content-type")
4976        .and_then(|v| v.to_str().ok())
4977        .unwrap_or("application/octet-stream");
4978    let content_type = super::ContentType::from(content_type);
4979
4980    if !status.is_client_error() && !status.is_server_error() {
4981        let content = resp.text().await?;
4982        match content_type {
4983            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4984            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateFabricResponse`"))),
4985            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateFabricResponse`")))),
4986        }
4987    } else {
4988        let content = resp.text().await?;
4989        let entity: Option<ClusterSdnUpdateFabricError> = serde_json::from_str(&content).ok();
4990        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4991    }
4992}
4993
4994/// Update sdn ipam object configuration.
4995pub async fn cluster_sdn_update_ipams(configuration: &configuration::Configuration, ipam: &str, cluster_sdn_update_ipams_request: Option<models::ClusterSdnUpdateIpamsRequest>) -> Result<models::ClusterSdnUpdateIpamsResponse, Error<ClusterSdnUpdateIpamsError>> {
4996    // add a prefix to parameters to efficiently prevent name collisions
4997    let p_path_ipam = ipam;
4998    let p_body_cluster_sdn_update_ipams_request = cluster_sdn_update_ipams_request;
4999
5000    let uri_str = format!("{}/cluster/sdn/ipams/{ipam}", configuration.base_path, ipam=crate::apis::urlencode(p_path_ipam));
5001    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5002
5003    if let Some(ref user_agent) = configuration.user_agent {
5004        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5005    }
5006    if let Some(ref apikey) = configuration.api_key {
5007        let key = apikey.key.clone();
5008        let value = match apikey.prefix {
5009            Some(ref prefix) => format!("{} {}", prefix, key),
5010            None => key,
5011        };
5012        req_builder = req_builder.header("Authorization", value);
5013    };
5014    if let Some(ref apikey) = configuration.api_key {
5015        let key = apikey.key.clone();
5016        let value = match apikey.prefix {
5017            Some(ref prefix) => format!("{} {}", prefix, key),
5018            None => key,
5019        };
5020        req_builder = req_builder.header("CSRFPreventionToken", value);
5021    };
5022    req_builder = req_builder.json(&p_body_cluster_sdn_update_ipams_request);
5023
5024    let req = req_builder.build()?;
5025    let resp = configuration.client.execute(req).await?;
5026
5027    let status = resp.status();
5028    let content_type = resp
5029        .headers()
5030        .get("content-type")
5031        .and_then(|v| v.to_str().ok())
5032        .unwrap_or("application/octet-stream");
5033    let content_type = super::ContentType::from(content_type);
5034
5035    if !status.is_client_error() && !status.is_server_error() {
5036        let content = resp.text().await?;
5037        match content_type {
5038            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5039            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateIpamsResponse`"))),
5040            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateIpamsResponse`")))),
5041        }
5042    } else {
5043        let content = resp.text().await?;
5044        let entity: Option<ClusterSdnUpdateIpamsError> = serde_json::from_str(&content).ok();
5045        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5046    }
5047}
5048
5049/// Update a node
5050pub async fn cluster_sdn_update_node(configuration: &configuration::Configuration, fabric_id: &str, node_id: &str, cluster_sdn_update_node_request: models::ClusterSdnUpdateNodeRequest) -> Result<models::ClusterSdnUpdateNodeResponse, Error<ClusterSdnUpdateNodeError>> {
5051    // add a prefix to parameters to efficiently prevent name collisions
5052    let p_path_fabric_id = fabric_id;
5053    let p_path_node_id = node_id;
5054    let p_body_cluster_sdn_update_node_request = cluster_sdn_update_node_request;
5055
5056    let uri_str = format!("{}/cluster/sdn/fabrics/node/{fabric_id}/{node_id}", configuration.base_path, fabric_id=crate::apis::urlencode(p_path_fabric_id), node_id=crate::apis::urlencode(p_path_node_id));
5057    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5058
5059    if let Some(ref user_agent) = configuration.user_agent {
5060        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5061    }
5062    if let Some(ref apikey) = configuration.api_key {
5063        let key = apikey.key.clone();
5064        let value = match apikey.prefix {
5065            Some(ref prefix) => format!("{} {}", prefix, key),
5066            None => key,
5067        };
5068        req_builder = req_builder.header("Authorization", value);
5069    };
5070    if let Some(ref apikey) = configuration.api_key {
5071        let key = apikey.key.clone();
5072        let value = match apikey.prefix {
5073            Some(ref prefix) => format!("{} {}", prefix, key),
5074            None => key,
5075        };
5076        req_builder = req_builder.header("CSRFPreventionToken", value);
5077    };
5078    req_builder = req_builder.json(&p_body_cluster_sdn_update_node_request);
5079
5080    let req = req_builder.build()?;
5081    let resp = configuration.client.execute(req).await?;
5082
5083    let status = resp.status();
5084    let content_type = resp
5085        .headers()
5086        .get("content-type")
5087        .and_then(|v| v.to_str().ok())
5088        .unwrap_or("application/octet-stream");
5089    let content_type = super::ContentType::from(content_type);
5090
5091    if !status.is_client_error() && !status.is_server_error() {
5092        let content = resp.text().await?;
5093        match content_type {
5094            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5095            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateNodeResponse`"))),
5096            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateNodeResponse`")))),
5097        }
5098    } else {
5099        let content = resp.text().await?;
5100        let entity: Option<ClusterSdnUpdateNodeError> = serde_json::from_str(&content).ok();
5101        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5102    }
5103}
5104
5105/// Update Prefix List
5106pub async fn cluster_sdn_update_prefix_list(configuration: &configuration::Configuration, id: &str, cluster_sdn_update_prefix_list_request: Option<models::ClusterSdnUpdatePrefixListRequest>) -> Result<models::ClusterSdnUpdatePrefixListResponse, Error<ClusterSdnUpdatePrefixListError>> {
5107    // add a prefix to parameters to efficiently prevent name collisions
5108    let p_path_id = id;
5109    let p_body_cluster_sdn_update_prefix_list_request = cluster_sdn_update_prefix_list_request;
5110
5111    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}", configuration.base_path, id=crate::apis::urlencode(p_path_id));
5112    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5113
5114    if let Some(ref user_agent) = configuration.user_agent {
5115        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5116    }
5117    if let Some(ref apikey) = configuration.api_key {
5118        let key = apikey.key.clone();
5119        let value = match apikey.prefix {
5120            Some(ref prefix) => format!("{} {}", prefix, key),
5121            None => key,
5122        };
5123        req_builder = req_builder.header("Authorization", value);
5124    };
5125    if let Some(ref apikey) = configuration.api_key {
5126        let key = apikey.key.clone();
5127        let value = match apikey.prefix {
5128            Some(ref prefix) => format!("{} {}", prefix, key),
5129            None => key,
5130        };
5131        req_builder = req_builder.header("CSRFPreventionToken", value);
5132    };
5133    req_builder = req_builder.json(&p_body_cluster_sdn_update_prefix_list_request);
5134
5135    let req = req_builder.build()?;
5136    let resp = configuration.client.execute(req).await?;
5137
5138    let status = resp.status();
5139    let content_type = resp
5140        .headers()
5141        .get("content-type")
5142        .and_then(|v| v.to_str().ok())
5143        .unwrap_or("application/octet-stream");
5144    let content_type = super::ContentType::from(content_type);
5145
5146    if !status.is_client_error() && !status.is_server_error() {
5147        let content = resp.text().await?;
5148        match content_type {
5149            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5150            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdatePrefixListResponse`"))),
5151            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdatePrefixListResponse`")))),
5152        }
5153    } else {
5154        let content = resp.text().await?;
5155        let entity: Option<ClusterSdnUpdatePrefixListError> = serde_json::from_str(&content).ok();
5156        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5157    }
5158}
5159
5160/// Update Prefix List Entry
5161pub async fn cluster_sdn_update_prefix_list_entry(configuration: &configuration::Configuration, id: &str, url_seq: &str, cluster_sdn_update_prefix_list_entry_request: Option<models::ClusterSdnUpdatePrefixListEntryRequest>) -> Result<models::ClusterSdnUpdatePrefixListEntryResponse, Error<ClusterSdnUpdatePrefixListEntryError>> {
5162    // add a prefix to parameters to efficiently prevent name collisions
5163    let p_path_id = id;
5164    let p_path_url_seq = url_seq;
5165    let p_body_cluster_sdn_update_prefix_list_entry_request = cluster_sdn_update_prefix_list_entry_request;
5166
5167    let uri_str = format!("{}/cluster/sdn/prefix-lists/{id}/entries/{url_seq}", configuration.base_path, id=crate::apis::urlencode(p_path_id), url_seq=crate::apis::urlencode(p_path_url_seq));
5168    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5169
5170    if let Some(ref user_agent) = configuration.user_agent {
5171        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5172    }
5173    if let Some(ref apikey) = configuration.api_key {
5174        let key = apikey.key.clone();
5175        let value = match apikey.prefix {
5176            Some(ref prefix) => format!("{} {}", prefix, key),
5177            None => key,
5178        };
5179        req_builder = req_builder.header("Authorization", value);
5180    };
5181    if let Some(ref apikey) = configuration.api_key {
5182        let key = apikey.key.clone();
5183        let value = match apikey.prefix {
5184            Some(ref prefix) => format!("{} {}", prefix, key),
5185            None => key,
5186        };
5187        req_builder = req_builder.header("CSRFPreventionToken", value);
5188    };
5189    req_builder = req_builder.json(&p_body_cluster_sdn_update_prefix_list_entry_request);
5190
5191    let req = req_builder.build()?;
5192    let resp = configuration.client.execute(req).await?;
5193
5194    let status = resp.status();
5195    let content_type = resp
5196        .headers()
5197        .get("content-type")
5198        .and_then(|v| v.to_str().ok())
5199        .unwrap_or("application/octet-stream");
5200    let content_type = super::ContentType::from(content_type);
5201
5202    if !status.is_client_error() && !status.is_server_error() {
5203        let content = resp.text().await?;
5204        match content_type {
5205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5206            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdatePrefixListEntryResponse`"))),
5207            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdatePrefixListEntryResponse`")))),
5208        }
5209    } else {
5210        let content = resp.text().await?;
5211        let entity: Option<ClusterSdnUpdatePrefixListEntryError> = serde_json::from_str(&content).ok();
5212        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5213    }
5214}
5215
5216/// Update Route Map Entry
5217pub async fn cluster_sdn_update_route_map_entry(configuration: &configuration::Configuration, order: i32, route_map_id: &str, cluster_sdn_update_route_map_entry_request: Option<models::ClusterSdnUpdateRouteMapEntryRequest>) -> Result<models::ClusterSdnUpdateRouteMapEntryResponse, Error<ClusterSdnUpdateRouteMapEntryError>> {
5218    // add a prefix to parameters to efficiently prevent name collisions
5219    let p_path_order = order;
5220    let p_path_route_map_id = route_map_id;
5221    let p_body_cluster_sdn_update_route_map_entry_request = cluster_sdn_update_route_map_entry_request;
5222
5223    let uri_str = format!("{}/cluster/sdn/route-maps/entries/{route_map_id}/entry/{order}", configuration.base_path, order=p_path_order, route_map_id=crate::apis::urlencode(p_path_route_map_id));
5224    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5225
5226    if let Some(ref user_agent) = configuration.user_agent {
5227        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5228    }
5229    if let Some(ref apikey) = configuration.api_key {
5230        let key = apikey.key.clone();
5231        let value = match apikey.prefix {
5232            Some(ref prefix) => format!("{} {}", prefix, key),
5233            None => key,
5234        };
5235        req_builder = req_builder.header("Authorization", value);
5236    };
5237    if let Some(ref apikey) = configuration.api_key {
5238        let key = apikey.key.clone();
5239        let value = match apikey.prefix {
5240            Some(ref prefix) => format!("{} {}", prefix, key),
5241            None => key,
5242        };
5243        req_builder = req_builder.header("CSRFPreventionToken", value);
5244    };
5245    req_builder = req_builder.json(&p_body_cluster_sdn_update_route_map_entry_request);
5246
5247    let req = req_builder.build()?;
5248    let resp = configuration.client.execute(req).await?;
5249
5250    let status = resp.status();
5251    let content_type = resp
5252        .headers()
5253        .get("content-type")
5254        .and_then(|v| v.to_str().ok())
5255        .unwrap_or("application/octet-stream");
5256    let content_type = super::ContentType::from(content_type);
5257
5258    if !status.is_client_error() && !status.is_server_error() {
5259        let content = resp.text().await?;
5260        match content_type {
5261            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5262            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateRouteMapEntryResponse`"))),
5263            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateRouteMapEntryResponse`")))),
5264        }
5265    } else {
5266        let content = resp.text().await?;
5267        let entity: Option<ClusterSdnUpdateRouteMapEntryError> = serde_json::from_str(&content).ok();
5268        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5269    }
5270}
5271
5272/// Modify rule data.  Permissions: Needs SDN.Allocate permissions on '/sdn/zones/<zone>/<vnet>'
5273pub async fn cluster_sdn_update_rule(configuration: &configuration::Configuration, pos: i64, vnet: &str, cluster_firewall_update_rule_request: Option<models::ClusterFirewallUpdateRuleRequest>) -> Result<models::ClusterSdnUpdateRuleResponse, Error<ClusterSdnUpdateRuleError>> {
5274    // add a prefix to parameters to efficiently prevent name collisions
5275    let p_path_pos = pos;
5276    let p_path_vnet = vnet;
5277    let p_body_cluster_firewall_update_rule_request = cluster_firewall_update_rule_request;
5278
5279    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/firewall/rules/{pos}", configuration.base_path, pos=p_path_pos, vnet=crate::apis::urlencode(p_path_vnet));
5280    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5281
5282    if let Some(ref user_agent) = configuration.user_agent {
5283        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5284    }
5285    if let Some(ref apikey) = configuration.api_key {
5286        let key = apikey.key.clone();
5287        let value = match apikey.prefix {
5288            Some(ref prefix) => format!("{} {}", prefix, key),
5289            None => key,
5290        };
5291        req_builder = req_builder.header("Authorization", value);
5292    };
5293    if let Some(ref apikey) = configuration.api_key {
5294        let key = apikey.key.clone();
5295        let value = match apikey.prefix {
5296            Some(ref prefix) => format!("{} {}", prefix, key),
5297            None => key,
5298        };
5299        req_builder = req_builder.header("CSRFPreventionToken", value);
5300    };
5301    req_builder = req_builder.json(&p_body_cluster_firewall_update_rule_request);
5302
5303    let req = req_builder.build()?;
5304    let resp = configuration.client.execute(req).await?;
5305
5306    let status = resp.status();
5307    let content_type = resp
5308        .headers()
5309        .get("content-type")
5310        .and_then(|v| v.to_str().ok())
5311        .unwrap_or("application/octet-stream");
5312    let content_type = super::ContentType::from(content_type);
5313
5314    if !status.is_client_error() && !status.is_server_error() {
5315        let content = resp.text().await?;
5316        match content_type {
5317            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5318            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateRuleResponse`"))),
5319            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateRuleResponse`")))),
5320        }
5321    } else {
5322        let content = resp.text().await?;
5323        let entity: Option<ClusterSdnUpdateRuleError> = serde_json::from_str(&content).ok();
5324        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5325    }
5326}
5327
5328/// Update sdn subnet object configuration.  Permissions: Require 'SDN.Allocate' permission on '/sdn/zones/<zone>/<vnet>'
5329pub async fn cluster_sdn_update_subnets(configuration: &configuration::Configuration, subnet: &str, vnet: &str, cluster_sdn_update_subnets_request: Option<models::ClusterSdnUpdateSubnetsRequest>) -> Result<models::ClusterSdnUpdateSubnetsResponse, Error<ClusterSdnUpdateSubnetsError>> {
5330    // add a prefix to parameters to efficiently prevent name collisions
5331    let p_path_subnet = subnet;
5332    let p_path_vnet = vnet;
5333    let p_body_cluster_sdn_update_subnets_request = cluster_sdn_update_subnets_request;
5334
5335    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}/subnets/{subnet}", configuration.base_path, subnet=crate::apis::urlencode(p_path_subnet), vnet=crate::apis::urlencode(p_path_vnet));
5336    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5337
5338    if let Some(ref user_agent) = configuration.user_agent {
5339        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5340    }
5341    if let Some(ref apikey) = configuration.api_key {
5342        let key = apikey.key.clone();
5343        let value = match apikey.prefix {
5344            Some(ref prefix) => format!("{} {}", prefix, key),
5345            None => key,
5346        };
5347        req_builder = req_builder.header("Authorization", value);
5348    };
5349    if let Some(ref apikey) = configuration.api_key {
5350        let key = apikey.key.clone();
5351        let value = match apikey.prefix {
5352            Some(ref prefix) => format!("{} {}", prefix, key),
5353            None => key,
5354        };
5355        req_builder = req_builder.header("CSRFPreventionToken", value);
5356    };
5357    req_builder = req_builder.json(&p_body_cluster_sdn_update_subnets_request);
5358
5359    let req = req_builder.build()?;
5360    let resp = configuration.client.execute(req).await?;
5361
5362    let status = resp.status();
5363    let content_type = resp
5364        .headers()
5365        .get("content-type")
5366        .and_then(|v| v.to_str().ok())
5367        .unwrap_or("application/octet-stream");
5368    let content_type = super::ContentType::from(content_type);
5369
5370    if !status.is_client_error() && !status.is_server_error() {
5371        let content = resp.text().await?;
5372        match content_type {
5373            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5374            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateSubnetsResponse`"))),
5375            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateSubnetsResponse`")))),
5376        }
5377    } else {
5378        let content = resp.text().await?;
5379        let entity: Option<ClusterSdnUpdateSubnetsError> = serde_json::from_str(&content).ok();
5380        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5381    }
5382}
5383
5384/// Update sdn vnet object configuration.  Permissions: Require 'SDN.Allocate' permission on '/sdn/zones/<zone>/<vnet>'
5385pub async fn cluster_sdn_update_vnets(configuration: &configuration::Configuration, vnet: &str, cluster_sdn_update_vnets_request: Option<models::ClusterSdnUpdateVnetsRequest>) -> Result<models::ClusterSdnUpdateVnetsResponse, Error<ClusterSdnUpdateVnetsError>> {
5386    // add a prefix to parameters to efficiently prevent name collisions
5387    let p_path_vnet = vnet;
5388    let p_body_cluster_sdn_update_vnets_request = cluster_sdn_update_vnets_request;
5389
5390    let uri_str = format!("{}/cluster/sdn/vnets/{vnet}", configuration.base_path, vnet=crate::apis::urlencode(p_path_vnet));
5391    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5392
5393    if let Some(ref user_agent) = configuration.user_agent {
5394        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5395    }
5396    if let Some(ref apikey) = configuration.api_key {
5397        let key = apikey.key.clone();
5398        let value = match apikey.prefix {
5399            Some(ref prefix) => format!("{} {}", prefix, key),
5400            None => key,
5401        };
5402        req_builder = req_builder.header("Authorization", value);
5403    };
5404    if let Some(ref apikey) = configuration.api_key {
5405        let key = apikey.key.clone();
5406        let value = match apikey.prefix {
5407            Some(ref prefix) => format!("{} {}", prefix, key),
5408            None => key,
5409        };
5410        req_builder = req_builder.header("CSRFPreventionToken", value);
5411    };
5412    req_builder = req_builder.json(&p_body_cluster_sdn_update_vnets_request);
5413
5414    let req = req_builder.build()?;
5415    let resp = configuration.client.execute(req).await?;
5416
5417    let status = resp.status();
5418    let content_type = resp
5419        .headers()
5420        .get("content-type")
5421        .and_then(|v| v.to_str().ok())
5422        .unwrap_or("application/octet-stream");
5423    let content_type = super::ContentType::from(content_type);
5424
5425    if !status.is_client_error() && !status.is_server_error() {
5426        let content = resp.text().await?;
5427        match content_type {
5428            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5429            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateVnetsResponse`"))),
5430            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateVnetsResponse`")))),
5431        }
5432    } else {
5433        let content = resp.text().await?;
5434        let entity: Option<ClusterSdnUpdateVnetsError> = serde_json::from_str(&content).ok();
5435        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5436    }
5437}
5438
5439/// Update sdn zone object configuration.
5440pub async fn cluster_sdn_update_zones(configuration: &configuration::Configuration, zone: &str, cluster_sdn_update_zones_request: Option<models::ClusterSdnUpdateZonesRequest>) -> Result<models::ClusterSdnUpdateZonesResponse, Error<ClusterSdnUpdateZonesError>> {
5441    // add a prefix to parameters to efficiently prevent name collisions
5442    let p_path_zone = zone;
5443    let p_body_cluster_sdn_update_zones_request = cluster_sdn_update_zones_request;
5444
5445    let uri_str = format!("{}/cluster/sdn/zones/{zone}", configuration.base_path, zone=crate::apis::urlencode(p_path_zone));
5446    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5447
5448    if let Some(ref user_agent) = configuration.user_agent {
5449        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5450    }
5451    if let Some(ref apikey) = configuration.api_key {
5452        let key = apikey.key.clone();
5453        let value = match apikey.prefix {
5454            Some(ref prefix) => format!("{} {}", prefix, key),
5455            None => key,
5456        };
5457        req_builder = req_builder.header("Authorization", value);
5458    };
5459    if let Some(ref apikey) = configuration.api_key {
5460        let key = apikey.key.clone();
5461        let value = match apikey.prefix {
5462            Some(ref prefix) => format!("{} {}", prefix, key),
5463            None => key,
5464        };
5465        req_builder = req_builder.header("CSRFPreventionToken", value);
5466    };
5467    req_builder = req_builder.json(&p_body_cluster_sdn_update_zones_request);
5468
5469    let req = req_builder.build()?;
5470    let resp = configuration.client.execute(req).await?;
5471
5472    let status = resp.status();
5473    let content_type = resp
5474        .headers()
5475        .get("content-type")
5476        .and_then(|v| v.to_str().ok())
5477        .unwrap_or("application/octet-stream");
5478    let content_type = super::ContentType::from(content_type);
5479
5480    if !status.is_client_error() && !status.is_server_error() {
5481        let content = resp.text().await?;
5482        match content_type {
5483            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5484            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ClusterSdnUpdateZonesResponse`"))),
5485            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ClusterSdnUpdateZonesResponse`")))),
5486        }
5487    } else {
5488        let content = resp.text().await?;
5489        let entity: Option<ClusterSdnUpdateZonesError> = serde_json::from_str(&content).ok();
5490        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5491    }
5492}
5493