proxmox_api/generated/cluster/sdn/dns/
dns.rs

1pub struct DnsClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> DnsClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str, dns: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}/{}", parent_path, dns),
13        }
14    }
15}
16impl<T> DnsClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Delete sdn dns object configuration."]
21    pub fn delete(&self) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &())
24    }
25}
26impl<T> DnsClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Read sdn dns configuration."]
31    pub fn get(&self) -> Result<GetOutput, T::Error> {
32        let path = self.path.to_string();
33        self.client.get(&path, &())
34    }
35}
36impl<T> DnsClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update sdn dns object configuration."]
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}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
47pub struct GetOutput {
48    #[serde(
49        flatten,
50        default,
51        skip_serializing_if = "::std::collections::HashMap::is_empty"
52    )]
53    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
54}
55#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
56pub struct PutParams {
57    #[serde(skip_serializing_if = "Option::is_none", default)]
58    #[doc = "A list of settings you want to delete."]
59    pub delete: Option<String>,
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
62    pub digest: Option<String>,
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    pub key: Option<String>,
65    #[serde(
66        serialize_with = "crate::types::serialize_int_optional",
67        deserialize_with = "crate::types::deserialize_int_optional"
68    )]
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    pub reversemaskv6: Option<u64>,
71    #[serde(
72        serialize_with = "crate::types::serialize_int_optional",
73        deserialize_with = "crate::types::deserialize_int_optional"
74    )]
75    #[serde(skip_serializing_if = "Option::is_none", default)]
76    pub ttl: Option<u64>,
77    #[serde(skip_serializing_if = "Option::is_none", default)]
78    pub url: Option<String>,
79    #[serde(
80        flatten,
81        default,
82        skip_serializing_if = "::std::collections::HashMap::is_empty"
83    )]
84    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
85}