proxmox_api/generated/cluster/sdn/vnets/vnet/
ips.rs

1pub struct IpsClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> IpsClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}{}", parent_path, "/ips"),
13        }
14    }
15}
16impl<T> IpsClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Delete IP Mappings in a VNet"]
21    pub fn delete(&self, params: DeleteParams) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &params)
24    }
25}
26impl<T> IpsClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Create IP Mapping in a VNet"]
31    pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
32        let path = self.path.to_string();
33        self.client.post(&path, &params)
34    }
35}
36impl<T> IpsClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update IP Mapping in a VNet"]
41    pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
42        let path = self.path.to_string();
43        self.client.put(&path, &params)
44    }
45}
46impl DeleteParams {
47    pub fn new(ip: ::std::net::IpAddr, zone: String) -> Self {
48        Self {
49            ip,
50            zone,
51            mac: Default::default(),
52            additional_properties: Default::default(),
53        }
54    }
55}
56#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
57pub struct DeleteParams {
58    #[doc = "The IP address to delete"]
59    pub ip: ::std::net::IpAddr,
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    #[doc = "Unicast MAC address."]
62    #[doc = "A common MAC address with the I/G (Individual/Group) bit not set."]
63    pub mac: Option<crate::types::MacAddr<false>>,
64    #[doc = "The SDN zone object identifier."]
65    pub zone: String,
66    #[serde(
67        flatten,
68        default,
69        skip_serializing_if = "::std::collections::HashMap::is_empty"
70    )]
71    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
72}
73impl PostParams {
74    pub fn new(ip: ::std::net::IpAddr, zone: String) -> Self {
75        Self {
76            ip,
77            zone,
78            mac: Default::default(),
79            additional_properties: Default::default(),
80        }
81    }
82}
83#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
84pub struct PostParams {
85    #[doc = "The IP address to associate with the given MAC address"]
86    pub ip: ::std::net::IpAddr,
87    #[serde(skip_serializing_if = "Option::is_none", default)]
88    #[doc = "Unicast MAC address."]
89    #[doc = "A common MAC address with the I/G (Individual/Group) bit not set."]
90    pub mac: Option<crate::types::MacAddr<false>>,
91    #[doc = "The SDN zone object identifier."]
92    pub zone: String,
93    #[serde(
94        flatten,
95        default,
96        skip_serializing_if = "::std::collections::HashMap::is_empty"
97    )]
98    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
99}
100impl PutParams {
101    pub fn new(ip: ::std::net::IpAddr, zone: String) -> Self {
102        Self {
103            ip,
104            zone,
105            mac: Default::default(),
106            vmid: Default::default(),
107            additional_properties: Default::default(),
108        }
109    }
110}
111#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
112pub struct PutParams {
113    #[doc = "The IP address to associate with the given MAC address"]
114    pub ip: ::std::net::IpAddr,
115    #[serde(skip_serializing_if = "Option::is_none", default)]
116    #[doc = "Unicast MAC address."]
117    #[doc = "A common MAC address with the I/G (Individual/Group) bit not set."]
118    pub mac: Option<crate::types::MacAddr<false>>,
119    #[serde(skip_serializing_if = "Option::is_none", default)]
120    #[doc = "The (unique) ID of the VM."]
121    pub vmid: Option<crate::types::VmId>,
122    #[doc = "The SDN zone object identifier."]
123    pub zone: String,
124    #[serde(
125        flatten,
126        default,
127        skip_serializing_if = "::std::collections::HashMap::is_empty"
128    )]
129    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
130}