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
use crate::Client;
use crate::ClientResult;
pub struct SingleSignOnTeammates {
pub client: Client,
}
impl SingleSignOnTeammates {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
SingleSignOnTeammates { client }
}
/**
* Create SSO Teammate.
*
* This function performs a `POST` to the `/sso/teammates` endpoint.
*
* **This endpoint allows you to create an SSO Teammate.**
*
* The email provided for this user will also function as the Teammate’s username.
*/
pub async fn post_sso_teammate(
&self,
body: &crate::types::SsoTeammateRequestAllOf,
) -> ClientResult<crate::Response<crate::types::SsoTeammateResponseAllOf>> {
let url = self.client.url("/sso/teammates", None);
self.client
.post(
&url,
crate::Message {
body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
content_type: Some("application/json".to_string()),
},
)
.await
}
/**
* Edit an SSO Teammate.
*
* This function performs a `PATCH` to the `/sso/teammates/{username}` endpoint.
*
* **This endpoint allows you to modify an existing SSO Teammate.**
*
* To turn a teammate into an admin, the request body should contain the `is_admin` field set to `true`. Otherwise, set `is_admin` to false and pass in all the scopes that a teammate should have.
*
* Only the parent user and Teammates with admin permissions can update another Teammate’s permissions. Admin users can only update permissions.
*/
pub async fn patch_sso_teammates_username(
&self,
username: &str,
body: &crate::types::PatchSsoTeammatesUsernameRequest,
) -> ClientResult<crate::Response<crate::types::SsoTeammatesPatchResponseAllOf>> {
let url = self.client.url(
&format!(
"/sso/teammates/{}",
crate::progenitor_support::encode_path(username),
),
None,
);
self.client
.patch(
&url,
crate::Message {
body: Some(reqwest::Body::from(serde_json::to_vec(body)?)),
content_type: Some("application/json".to_string()),
},
)
.await
}
}