proxmox_api/generated/access/
acl.rs1pub struct AclClient<T> {
2 client: T,
3 path: String,
4}
5impl<T> AclClient<T>
6where
7 T: crate::client::Client,
8{
9 pub fn new(client: T, parent_path: &str) -> Self {
10 Self {
11 client,
12 path: format!("{}{}", parent_path, "/acl"),
13 }
14 }
15}
16impl<T> AclClient<T>
17where
18 T: crate::client::Client,
19{
20 #[doc = "Get Access Control List (ACLs)."]
21 pub fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
22 let path = self.path.to_string();
23 self.client.get(&path, &())
24 }
25}
26impl<T> AclClient<T>
27where
28 T: crate::client::Client,
29{
30 #[doc = "Update Access Control List (add or remove permissions)."]
31 pub fn put(&self, params: PutParams) -> Result<(), T::Error> {
32 let path = self.path.to_string();
33 self.client.put(&path, ¶ms)
34 }
35}
36impl GetOutputItems {
37 pub fn new(path: String, roleid: String, ty: Type, ugid: String) -> Self {
38 Self {
39 path,
40 roleid,
41 ty,
42 ugid,
43 propagate: Default::default(),
44 }
45 }
46}
47#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
48pub struct GetOutputItems {
49 #[doc = "Access control path"]
50 pub path: String,
51 #[serde(
52 serialize_with = "crate::types::serialize_bool_optional",
53 deserialize_with = "crate::types::deserialize_bool_optional"
54 )]
55 #[serde(skip_serializing_if = "Option::is_none", default)]
56 #[doc = "Allow to propagate (inherit) permissions."]
57 pub propagate: Option<bool>,
58 pub roleid: String,
59 #[serde(rename = "type")]
60 pub ty: Type,
61 pub ugid: String,
62}
63impl PutParams {
64 pub fn new(path: String, roles: String) -> Self {
65 Self {
66 path,
67 roles,
68 delete: Default::default(),
69 groups: Default::default(),
70 propagate: Default::default(),
71 tokens: Default::default(),
72 users: Default::default(),
73 additional_properties: Default::default(),
74 }
75 }
76}
77#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
78pub struct PutParams {
79 #[serde(
80 serialize_with = "crate::types::serialize_bool_optional",
81 deserialize_with = "crate::types::deserialize_bool_optional"
82 )]
83 #[serde(skip_serializing_if = "Option::is_none", default)]
84 #[doc = "Remove permissions (instead of adding it)."]
85 pub delete: Option<bool>,
86 #[serde(skip_serializing_if = "Option::is_none", default)]
87 #[doc = "List of groups."]
88 pub groups: Option<String>,
89 #[doc = "Access control path"]
90 pub path: String,
91 #[serde(
92 serialize_with = "crate::types::serialize_bool_optional",
93 deserialize_with = "crate::types::deserialize_bool_optional"
94 )]
95 #[serde(skip_serializing_if = "Option::is_none", default)]
96 #[doc = "Allow to propagate (inherit) permissions."]
97 pub propagate: Option<bool>,
98 #[doc = "List of roles."]
99 pub roles: String,
100 #[serde(skip_serializing_if = "Option::is_none", default)]
101 #[doc = "List of API tokens."]
102 pub tokens: Option<String>,
103 #[serde(skip_serializing_if = "Option::is_none", default)]
104 #[doc = "List of users."]
105 pub users: Option<String>,
106 #[serde(
107 flatten,
108 default,
109 skip_serializing_if = "::std::collections::HashMap::is_empty"
110 )]
111 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
112}
113#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
114pub enum Type {
115 #[serde(rename = "group")]
116 Group,
117 #[serde(rename = "token")]
118 Token,
119 #[serde(rename = "user")]
120 User,
121}