1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
use super::*;
impl<TS: KeycloakTokenSupplier> KeycloakAdmin<TS> {
// <h4>Client Initial Access</h4>
/// Parameters:
///
/// - `realm`: realm name (not id!)
///
/// Resource: `Client Initial Access`
///
/// `GET /admin/realms/{realm}/clients-initial-access`
///
/// Documentation: <https://www.keycloak.org/docs-api/26.6.0/rest-api/index.html#_get_adminrealmsrealmclients_initial_access>
pub async fn realm_clients_initial_access_get(
&self,
realm: &str,
) -> Result<TypeVec<ClientInitialAccessPresentation>, KeycloakError> {
let realm = p(realm);
let builder = self
.client
.get(format!(
"{}/admin/realms/{realm}/clients-initial-access",
self.url
))
.bearer_auth(self.token_supplier.get(&self.url).await?);
let response = builder.send().await?;
Ok(error_check(response).await?.json().await?)
}
/// Create a new initial access token.
///
/// Parameters:
///
/// - `realm`: realm name (not id!)
/// - `body`
///
/// Resource: `Client Initial Access`
///
/// `POST /admin/realms/{realm}/clients-initial-access`
///
/// Documentation: <https://www.keycloak.org/docs-api/26.6.0/rest-api/index.html#_post_adminrealmsrealmclients_initial_access>
pub async fn realm_clients_initial_access_post(
&self,
realm: &str,
body: ClientInitialAccessCreatePresentation,
) -> Result<ClientInitialAccessCreatePresentation, KeycloakError> {
let realm = p(realm);
let builder = self
.client
.post(format!(
"{}/admin/realms/{realm}/clients-initial-access",
self.url
))
.json(&body)
.bearer_auth(self.token_supplier.get(&self.url).await?);
let response = builder.send().await?;
Ok(error_check(response).await?.json().await?)
}
/// Parameters:
///
/// - `realm`: realm name (not id!)
/// - `id`
///
/// Returns response for future processing.
///
/// Resource: `Client Initial Access`
///
/// `DELETE /admin/realms/{realm}/clients-initial-access/{id}`
///
/// Documentation: <https://www.keycloak.org/docs-api/26.6.0/rest-api/index.html#_delete_adminrealmsrealmclients_initial_accessid>
pub async fn realm_clients_initial_access_with_id_delete(
&self,
realm: &str,
id: &str,
) -> Result<DefaultResponse, KeycloakError> {
let realm = p(realm);
let id = p(id);
let builder = self
.client
.delete(format!(
"{}/admin/realms/{realm}/clients-initial-access/{id}",
self.url
))
.bearer_auth(self.token_supplier.get(&self.url).await?);
let response = builder.send().await?;
error_check(response).await.map(From::from)
}
}
// not all paths processed
// left 263