proxmox_api/generated/access/
groups.rs1pub mod groupid;
2pub struct GroupsClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> GroupsClient<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, "/groups"),
14 }
15 }
16}
17impl<T> GroupsClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Group index."]
22 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
23 let path = self.path.to_string();
24 self.client.get(&path, &())
25 }
26}
27impl<T> GroupsClient<T>
28where
29 T: crate::client::Client,
30{
31 #[doc = "Create new group."]
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(groupid: String) -> Self {
39 Self {
40 groupid,
41 comment: Default::default(),
42 users: Default::default(),
43 additional_properties: Default::default(),
44 }
45 }
46}
47#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
48pub struct GetOutputItems {
49 #[serde(skip_serializing_if = "Option::is_none", default)]
50 pub comment: Option<String>,
51 pub groupid: String,
52 #[serde(skip_serializing_if = "Option::is_none", default)]
53 #[doc = "list of users which form this group"]
54 pub users: Option<String>,
55 #[serde(
56 flatten,
57 default,
58 skip_serializing_if = "::std::collections::HashMap::is_empty"
59 )]
60 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
61}
62impl PostParams {
63 pub fn new(groupid: String) -> Self {
64 Self {
65 groupid,
66 comment: Default::default(),
67 additional_properties: Default::default(),
68 }
69 }
70}
71#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
72pub struct PostParams {
73 #[serde(skip_serializing_if = "Option::is_none", default)]
74 pub comment: Option<String>,
75 pub groupid: String,
76 #[serde(
77 flatten,
78 default,
79 skip_serializing_if = "::std::collections::HashMap::is_empty"
80 )]
81 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
82}
83impl<T> GroupsClient<T>
84where
85 T: crate::client::Client,
86{
87 pub fn groupid(&self, groupid: &str) -> groupid::GroupidClient<T> {
88 groupid::GroupidClient::<T>::new(self.client.clone(), &self.path, groupid)
89 }
90}