pve/nodes/node/
version.rs1#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2pub struct GetResponseItem {
3 #[doc = "The current installed Proxmox VE Release"]
4 pub release: String,
5 #[doc = "The short git commit hash ID from which this version was build"]
6 pub repoid: String,
7 #[doc = "The current installed pve-manager package version"]
8 pub version: String,
9}
10
11#[derive(Debug, Clone)]
12pub struct VersionClient<T> {
13 client: T,
14 path: String,
15}
16
17impl<T> VersionClient<T>
18where
19 T: Clone,
20{
21 pub fn new(client: T, parent_path: &str) -> Self {
22 Self {
23 client,
24 path: format!("{}/{}", parent_path, "version"),
25 }
26 }
27}
28impl<T> VersionClient<T>
29where
30 T: crate::client::HttpClient,
31{
32 #[doc = "API version details"]
33 pub fn get(&self) -> Result<GetResponseItem, T::Error> {
34 self.client.get(&self.path, &())
35 }
36}
37#[derive(Debug, Clone)]
38pub struct AsyncVersionClient<T> {
39 client: T,
40 path: String,
41}
42
43impl<T> AsyncVersionClient<T>
44where
45 T: Clone,
46{
47 pub fn new(client: T, parent_path: &str) -> Self {
48 Self {
49 client,
50 path: format!("{}/{}", parent_path, "version"),
51 }
52 }
53}
54impl<T> AsyncVersionClient<T>
55where
56 T: crate::client::AsyncHttpClient,
57{
58 #[doc = "API version details"]
59 pub async fn get(&self) -> Result<GetResponseItem, T::Error> {
60 self.client.get(&self.path, &()).await
61 }
62}