proxmox_api/generated/cluster/sdn/
dns.rs1pub mod dns;
2pub struct DnsClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> DnsClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/dns"),
14 }
15 }
16}
17impl<T> DnsClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "SDN dns index."]
22 pub fn get(&self, params: GetParams) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, ¶ms)
25 }
26}
27impl<T> DnsClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create a new sdn dns object."]
32 pub fn post(&self, params: PostParams) -> Result<(), T::Error> {
33 let path = self.path.to_string();
34 self.client.post(&path, ¶ms)
35 }
36}
37impl GetOutputItems {
38 pub fn new(dns: String, ty: String) -> Self {
39 Self {
40 dns,
41 ty,
42 additional_properties: Default::default(),
43 }
44 }
45}
46#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
47pub struct GetOutputItems {
48 pub dns: String,
49 #[serde(rename = "type")]
50 pub ty: String,
51 #[serde(
52 flatten,
53 default,
54 skip_serializing_if = "::std::collections::HashMap::is_empty"
55 )]
56 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
57}
58#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
59pub struct GetParams {
60 #[serde(rename = "type")]
61 #[serde(skip_serializing_if = "Option::is_none", default)]
62 #[doc = "Only list sdn dns of specific type"]
63 pub ty: Option<Type>,
64 #[serde(
65 flatten,
66 default,
67 skip_serializing_if = "::std::collections::HashMap::is_empty"
68 )]
69 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
70}
71impl PostParams {
72 pub fn new(dns: String, key: String, ty: Type, url: String) -> Self {
73 Self {
74 dns,
75 key,
76 ty,
77 url,
78 reversemaskv6: Default::default(),
79 reversev6mask: Default::default(),
80 ttl: Default::default(),
81 additional_properties: Default::default(),
82 }
83 }
84}
85#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
86pub struct PostParams {
87 #[doc = "The SDN dns object identifier."]
88 pub dns: String,
89 pub key: String,
90 #[serde(
91 serialize_with = "crate::types::serialize_int_optional",
92 deserialize_with = "crate::types::deserialize_int_optional"
93 )]
94 #[serde(skip_serializing_if = "Option::is_none", default)]
95 pub reversemaskv6: Option<u64>,
96 #[serde(
97 serialize_with = "crate::types::serialize_int_optional",
98 deserialize_with = "crate::types::deserialize_int_optional"
99 )]
100 #[serde(skip_serializing_if = "Option::is_none", default)]
101 pub reversev6mask: Option<u64>,
102 #[serde(
103 serialize_with = "crate::types::serialize_int_optional",
104 deserialize_with = "crate::types::deserialize_int_optional"
105 )]
106 #[serde(skip_serializing_if = "Option::is_none", default)]
107 pub ttl: Option<u64>,
108 #[serde(rename = "type")]
109 #[doc = "Plugin type."]
110 pub ty: Type,
111 pub url: String,
112 #[serde(
113 flatten,
114 default,
115 skip_serializing_if = "::std::collections::HashMap::is_empty"
116 )]
117 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
118}
119#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
120pub enum Type {
121 #[serde(rename = "powerdns")]
122 Powerdns,
123}
124impl<T> DnsClient<T>
125where
126 T: crate::client::Client,
127{
128 pub fn dns(&self, dns: &str) -> dns::DnsClient<T> {
129 dns::DnsClient::<T>::new(self.client.clone(), &self.path, dns)
130 }
131}