1use crate::{ClientError, KanidmClient};
2use kanidm_proto::scim_v1::{client::ScimListFeature, ScimEntryGetQuery};
3
4impl KanidmClient {
5 pub async fn idm_feature_list(
6 &self,
7 query: Option<ScimEntryGetQuery>,
8 ) -> Result<ScimListFeature, ClientError> {
9 self.perform_get_request_query("/scim/v1/Feature", query)
10 .await
11 }
12
13 pub async fn idm_feature_enable<P: AsRef<str> + std::fmt::Display>(
14 &self,
15 account_id: P,
16 ) -> Result<(), ClientError> {
17 self.perform_post_request(&format!("/scim/v1/Feature/{account_id}/_enable"), true)
18 .await
19 }
20
21 pub async fn idm_feature_disable<P: AsRef<str> + std::fmt::Display>(
22 &self,
23 account_id: P,
24 ) -> Result<(), ClientError> {
25 self.perform_post_request(&format!("/scim/v1/Feature/{account_id}/_enable"), false)
26 .await
27 }
28}