proxmox_api/generated/cluster/notifications/endpoints/gotify/
name.rs

1pub struct NameClient<T> {
2    client: T,
3    path: String,
4}
5impl<T> NameClient<T>
6where
7    T: crate::client::Client,
8{
9    pub fn new(client: T, parent_path: &str, name: &str) -> Self {
10        Self {
11            client,
12            path: format!("{}/{}", parent_path, name),
13        }
14    }
15}
16impl<T> NameClient<T>
17where
18    T: crate::client::Client,
19{
20    #[doc = "Remove gotify endpoint"]
21    pub fn delete(&self) -> Result<(), T::Error> {
22        let path = self.path.to_string();
23        self.client.delete(&path, &())
24    }
25}
26impl<T> NameClient<T>
27where
28    T: crate::client::Client,
29{
30    #[doc = "Return a specific gotify endpoint"]
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> NameClient<T>
37where
38    T: crate::client::Client,
39{
40    #[doc = "Update existing gotify endpoint"]
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 GetOutput {
47    pub fn new(name: String, server: String) -> Self {
48        Self {
49            name,
50            server,
51            comment: Default::default(),
52            digest: Default::default(),
53            disable: Default::default(),
54            additional_properties: Default::default(),
55        }
56    }
57}
58#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
59pub struct GetOutput {
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    #[doc = "Comment"]
62    pub comment: Option<String>,
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
65    pub digest: Option<String>,
66    #[serde(
67        serialize_with = "crate::types::serialize_bool_optional",
68        deserialize_with = "crate::types::deserialize_bool_optional"
69    )]
70    #[serde(skip_serializing_if = "Option::is_none", default)]
71    #[doc = "Disable this target"]
72    pub disable: Option<bool>,
73    #[doc = "The name of the endpoint."]
74    pub name: String,
75    #[doc = "Server URL"]
76    pub server: String,
77    #[serde(
78        flatten,
79        default,
80        skip_serializing_if = "::std::collections::HashMap::is_empty"
81    )]
82    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
83}
84#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, Default)]
85pub struct PutParams {
86    #[serde(skip_serializing_if = "Option::is_none", default)]
87    #[doc = "Comment"]
88    pub comment: Option<String>,
89    #[serde(skip_serializing_if = "::std::vec::Vec::is_empty", default)]
90    #[doc = "A list of settings you want to delete."]
91    pub delete: Vec<String>,
92    #[serde(skip_serializing_if = "Option::is_none", default)]
93    #[doc = "Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications."]
94    pub digest: Option<String>,
95    #[serde(
96        serialize_with = "crate::types::serialize_bool_optional",
97        deserialize_with = "crate::types::deserialize_bool_optional"
98    )]
99    #[serde(skip_serializing_if = "Option::is_none", default)]
100    #[doc = "Disable this target"]
101    pub disable: Option<bool>,
102    #[serde(skip_serializing_if = "Option::is_none", default)]
103    #[doc = "Server URL"]
104    pub server: Option<String>,
105    #[serde(skip_serializing_if = "Option::is_none", default)]
106    #[doc = "Secret token"]
107    pub token: Option<String>,
108    #[serde(
109        flatten,
110        default,
111        skip_serializing_if = "::std::collections::HashMap::is_empty"
112    )]
113    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
114}