bitwarden_api_api/apis/
organization_users_api.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use reqwest;
12use serde::{de::Error as _, Deserialize, Serialize};
13
14use super::{configuration, ContentType, Error};
15use crate::{apis::ResponseContent, models};
16
17/// struct for typed errors of method [`organizations_org_id_users_account_recovery_details_post`]
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum OrganizationsOrgIdUsersAccountRecoveryDetailsPostError {
21    UnknownValue(serde_json::Value),
22}
23
24/// struct for typed errors of method [`organizations_org_id_users_confirm_post`]
25#[derive(Debug, Clone, Serialize, Deserialize)]
26#[serde(untagged)]
27pub enum OrganizationsOrgIdUsersConfirmPostError {
28    UnknownValue(serde_json::Value),
29}
30
31/// struct for typed errors of method [`organizations_org_id_users_delete`]
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(untagged)]
34pub enum OrganizationsOrgIdUsersDeleteError {
35    UnknownValue(serde_json::Value),
36}
37
38/// struct for typed errors of method [`organizations_org_id_users_delete_account_delete`]
39#[derive(Debug, Clone, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum OrganizationsOrgIdUsersDeleteAccountDeleteError {
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`organizations_org_id_users_delete_account_post`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum OrganizationsOrgIdUsersDeleteAccountPostError {
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`organizations_org_id_users_enable_secrets_manager_patch`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum OrganizationsOrgIdUsersEnableSecretsManagerPatchError {
56    UnknownValue(serde_json::Value),
57}
58
59/// struct for typed errors of method [`organizations_org_id_users_enable_secrets_manager_put`]
60#[derive(Debug, Clone, Serialize, Deserialize)]
61#[serde(untagged)]
62pub enum OrganizationsOrgIdUsersEnableSecretsManagerPutError {
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`organizations_org_id_users_get`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum OrganizationsOrgIdUsersGetError {
70    UnknownValue(serde_json::Value),
71}
72
73/// struct for typed errors of method [`organizations_org_id_users_id_confirm_post`]
74#[derive(Debug, Clone, Serialize, Deserialize)]
75#[serde(untagged)]
76pub enum OrganizationsOrgIdUsersIdConfirmPostError {
77    UnknownValue(serde_json::Value),
78}
79
80/// struct for typed errors of method [`organizations_org_id_users_id_delete`]
81#[derive(Debug, Clone, Serialize, Deserialize)]
82#[serde(untagged)]
83pub enum OrganizationsOrgIdUsersIdDeleteError {
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`organizations_org_id_users_id_delete_account_delete`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum OrganizationsOrgIdUsersIdDeleteAccountDeleteError {
91    UnknownValue(serde_json::Value),
92}
93
94/// struct for typed errors of method [`organizations_org_id_users_id_delete_account_post`]
95#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(untagged)]
97pub enum OrganizationsOrgIdUsersIdDeleteAccountPostError {
98    UnknownValue(serde_json::Value),
99}
100
101/// struct for typed errors of method [`organizations_org_id_users_id_get`]
102#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(untagged)]
104pub enum OrganizationsOrgIdUsersIdGetError {
105    UnknownValue(serde_json::Value),
106}
107
108/// struct for typed errors of method [`organizations_org_id_users_id_groups_get`]
109#[derive(Debug, Clone, Serialize, Deserialize)]
110#[serde(untagged)]
111pub enum OrganizationsOrgIdUsersIdGroupsGetError {
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`organizations_org_id_users_id_post`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum OrganizationsOrgIdUsersIdPostError {
119    UnknownValue(serde_json::Value),
120}
121
122/// struct for typed errors of method [`organizations_org_id_users_id_put`]
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum OrganizationsOrgIdUsersIdPutError {
126    UnknownValue(serde_json::Value),
127}
128
129/// struct for typed errors of method [`organizations_org_id_users_id_reinvite_post`]
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(untagged)]
132pub enum OrganizationsOrgIdUsersIdReinvitePostError {
133    UnknownValue(serde_json::Value),
134}
135
136/// struct for typed errors of method [`organizations_org_id_users_id_remove_post`]
137#[derive(Debug, Clone, Serialize, Deserialize)]
138#[serde(untagged)]
139pub enum OrganizationsOrgIdUsersIdRemovePostError {
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`organizations_org_id_users_id_reset_password_details_get`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum OrganizationsOrgIdUsersIdResetPasswordDetailsGetError {
147    UnknownValue(serde_json::Value),
148}
149
150/// struct for typed errors of method [`organizations_org_id_users_id_reset_password_put`]
151#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum OrganizationsOrgIdUsersIdResetPasswordPutError {
154    UnknownValue(serde_json::Value),
155}
156
157/// struct for typed errors of method [`organizations_org_id_users_id_restore_patch`]
158#[derive(Debug, Clone, Serialize, Deserialize)]
159#[serde(untagged)]
160pub enum OrganizationsOrgIdUsersIdRestorePatchError {
161    UnknownValue(serde_json::Value),
162}
163
164/// struct for typed errors of method [`organizations_org_id_users_id_restore_put`]
165#[derive(Debug, Clone, Serialize, Deserialize)]
166#[serde(untagged)]
167pub enum OrganizationsOrgIdUsersIdRestorePutError {
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`organizations_org_id_users_id_revoke_patch`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum OrganizationsOrgIdUsersIdRevokePatchError {
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`organizations_org_id_users_id_revoke_put`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum OrganizationsOrgIdUsersIdRevokePutError {
182    UnknownValue(serde_json::Value),
183}
184
185/// struct for typed errors of method [`organizations_org_id_users_invite_post`]
186#[derive(Debug, Clone, Serialize, Deserialize)]
187#[serde(untagged)]
188pub enum OrganizationsOrgIdUsersInvitePostError {
189    UnknownValue(serde_json::Value),
190}
191
192/// struct for typed errors of method [`organizations_org_id_users_mini_details_get`]
193#[derive(Debug, Clone, Serialize, Deserialize)]
194#[serde(untagged)]
195pub enum OrganizationsOrgIdUsersMiniDetailsGetError {
196    UnknownValue(serde_json::Value),
197}
198
199/// struct for typed errors of method
200/// [`organizations_org_id_users_organization_user_id_accept_init_post`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum OrganizationsOrgIdUsersOrganizationUserIdAcceptInitPostError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method
208/// [`organizations_org_id_users_organization_user_id_accept_post`]
209#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum OrganizationsOrgIdUsersOrganizationUserIdAcceptPostError {
212    UnknownValue(serde_json::Value),
213}
214
215/// struct for typed errors of method [`organizations_org_id_users_public_keys_post`]
216#[derive(Debug, Clone, Serialize, Deserialize)]
217#[serde(untagged)]
218pub enum OrganizationsOrgIdUsersPublicKeysPostError {
219    UnknownValue(serde_json::Value),
220}
221
222/// struct for typed errors of method [`organizations_org_id_users_reinvite_post`]
223#[derive(Debug, Clone, Serialize, Deserialize)]
224#[serde(untagged)]
225pub enum OrganizationsOrgIdUsersReinvitePostError {
226    UnknownValue(serde_json::Value),
227}
228
229/// struct for typed errors of method [`organizations_org_id_users_remove_post`]
230#[derive(Debug, Clone, Serialize, Deserialize)]
231#[serde(untagged)]
232pub enum OrganizationsOrgIdUsersRemovePostError {
233    UnknownValue(serde_json::Value),
234}
235
236/// struct for typed errors of method [`organizations_org_id_users_restore_patch`]
237#[derive(Debug, Clone, Serialize, Deserialize)]
238#[serde(untagged)]
239pub enum OrganizationsOrgIdUsersRestorePatchError {
240    UnknownValue(serde_json::Value),
241}
242
243/// struct for typed errors of method [`organizations_org_id_users_restore_put`]
244#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum OrganizationsOrgIdUsersRestorePutError {
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`organizations_org_id_users_revoke_patch`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum OrganizationsOrgIdUsersRevokePatchError {
254    UnknownValue(serde_json::Value),
255}
256
257/// struct for typed errors of method [`organizations_org_id_users_revoke_put`]
258#[derive(Debug, Clone, Serialize, Deserialize)]
259#[serde(untagged)]
260pub enum OrganizationsOrgIdUsersRevokePutError {
261    UnknownValue(serde_json::Value),
262}
263
264/// struct for typed errors of method
265/// [`organizations_org_id_users_user_id_reset_password_enrollment_put`]
266#[derive(Debug, Clone, Serialize, Deserialize)]
267#[serde(untagged)]
268pub enum OrganizationsOrgIdUsersUserIdResetPasswordEnrollmentPutError {
269    UnknownValue(serde_json::Value),
270}
271
272pub async fn organizations_org_id_users_account_recovery_details_post(
273    configuration: &configuration::Configuration,
274    org_id: uuid::Uuid,
275    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
276) -> Result<
277    models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel,
278    Error<OrganizationsOrgIdUsersAccountRecoveryDetailsPostError>,
279> {
280    // add a prefix to parameters to efficiently prevent name collisions
281    let p_org_id = org_id;
282    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
283
284    let uri_str = format!(
285        "{}/organizations/{orgId}/users/account-recovery-details",
286        configuration.base_path,
287        orgId = crate::apis::urlencode(p_org_id.to_string())
288    );
289    let mut req_builder = configuration
290        .client
291        .request(reqwest::Method::POST, &uri_str);
292
293    if let Some(ref user_agent) = configuration.user_agent {
294        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
295    }
296    if let Some(ref token) = configuration.oauth_access_token {
297        req_builder = req_builder.bearer_auth(token.to_owned());
298    };
299    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
300
301    let req = req_builder.build()?;
302    let resp = configuration.client.execute(req).await?;
303
304    let status = resp.status();
305    let content_type = resp
306        .headers()
307        .get("content-type")
308        .and_then(|v| v.to_str().ok())
309        .unwrap_or("application/octet-stream");
310    let content_type = super::ContentType::from(content_type);
311
312    if !status.is_client_error() && !status.is_server_error() {
313        let content = resp.text().await?;
314        match content_type {
315            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
316            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`"))),
317            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModelListResponseModel`")))),
318        }
319    } else {
320        let content = resp.text().await?;
321        let entity: Option<OrganizationsOrgIdUsersAccountRecoveryDetailsPostError> =
322            serde_json::from_str(&content).ok();
323        Err(Error::ResponseError(ResponseContent {
324            status,
325            content,
326            entity,
327        }))
328    }
329}
330
331pub async fn organizations_org_id_users_confirm_post(
332    configuration: &configuration::Configuration,
333    org_id: &str,
334    organization_user_bulk_confirm_request_model: Option<
335        models::OrganizationUserBulkConfirmRequestModel,
336    >,
337) -> Result<
338    models::OrganizationUserBulkResponseModelListResponseModel,
339    Error<OrganizationsOrgIdUsersConfirmPostError>,
340> {
341    // add a prefix to parameters to efficiently prevent name collisions
342    let p_org_id = org_id;
343    let p_organization_user_bulk_confirm_request_model =
344        organization_user_bulk_confirm_request_model;
345
346    let uri_str = format!(
347        "{}/organizations/{orgId}/users/confirm",
348        configuration.base_path,
349        orgId = crate::apis::urlencode(p_org_id)
350    );
351    let mut req_builder = configuration
352        .client
353        .request(reqwest::Method::POST, &uri_str);
354
355    if let Some(ref user_agent) = configuration.user_agent {
356        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
357    }
358    if let Some(ref token) = configuration.oauth_access_token {
359        req_builder = req_builder.bearer_auth(token.to_owned());
360    };
361    req_builder = req_builder.json(&p_organization_user_bulk_confirm_request_model);
362
363    let req = req_builder.build()?;
364    let resp = configuration.client.execute(req).await?;
365
366    let status = resp.status();
367    let content_type = resp
368        .headers()
369        .get("content-type")
370        .and_then(|v| v.to_str().ok())
371        .unwrap_or("application/octet-stream");
372    let content_type = super::ContentType::from(content_type);
373
374    if !status.is_client_error() && !status.is_server_error() {
375        let content = resp.text().await?;
376        match content_type {
377            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
378            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
379            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
380        }
381    } else {
382        let content = resp.text().await?;
383        let entity: Option<OrganizationsOrgIdUsersConfirmPostError> =
384            serde_json::from_str(&content).ok();
385        Err(Error::ResponseError(ResponseContent {
386            status,
387            content,
388            entity,
389        }))
390    }
391}
392
393pub async fn organizations_org_id_users_delete(
394    configuration: &configuration::Configuration,
395    org_id: uuid::Uuid,
396    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
397) -> Result<
398    models::OrganizationUserBulkResponseModelListResponseModel,
399    Error<OrganizationsOrgIdUsersDeleteError>,
400> {
401    // add a prefix to parameters to efficiently prevent name collisions
402    let p_org_id = org_id;
403    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
404
405    let uri_str = format!(
406        "{}/organizations/{orgId}/users",
407        configuration.base_path,
408        orgId = crate::apis::urlencode(p_org_id.to_string())
409    );
410    let mut req_builder = configuration
411        .client
412        .request(reqwest::Method::DELETE, &uri_str);
413
414    if let Some(ref user_agent) = configuration.user_agent {
415        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
416    }
417    if let Some(ref token) = configuration.oauth_access_token {
418        req_builder = req_builder.bearer_auth(token.to_owned());
419    };
420    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
421
422    let req = req_builder.build()?;
423    let resp = configuration.client.execute(req).await?;
424
425    let status = resp.status();
426    let content_type = resp
427        .headers()
428        .get("content-type")
429        .and_then(|v| v.to_str().ok())
430        .unwrap_or("application/octet-stream");
431    let content_type = super::ContentType::from(content_type);
432
433    if !status.is_client_error() && !status.is_server_error() {
434        let content = resp.text().await?;
435        match content_type {
436            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
437            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
438            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
439        }
440    } else {
441        let content = resp.text().await?;
442        let entity: Option<OrganizationsOrgIdUsersDeleteError> =
443            serde_json::from_str(&content).ok();
444        Err(Error::ResponseError(ResponseContent {
445            status,
446            content,
447            entity,
448        }))
449    }
450}
451
452pub async fn organizations_org_id_users_delete_account_delete(
453    configuration: &configuration::Configuration,
454    org_id: uuid::Uuid,
455    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
456) -> Result<
457    models::OrganizationUserBulkResponseModelListResponseModel,
458    Error<OrganizationsOrgIdUsersDeleteAccountDeleteError>,
459> {
460    // add a prefix to parameters to efficiently prevent name collisions
461    let p_org_id = org_id;
462    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
463
464    let uri_str = format!(
465        "{}/organizations/{orgId}/users/delete-account",
466        configuration.base_path,
467        orgId = crate::apis::urlencode(p_org_id.to_string())
468    );
469    let mut req_builder = configuration
470        .client
471        .request(reqwest::Method::DELETE, &uri_str);
472
473    if let Some(ref user_agent) = configuration.user_agent {
474        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
475    }
476    if let Some(ref token) = configuration.oauth_access_token {
477        req_builder = req_builder.bearer_auth(token.to_owned());
478    };
479    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
480
481    let req = req_builder.build()?;
482    let resp = configuration.client.execute(req).await?;
483
484    let status = resp.status();
485    let content_type = resp
486        .headers()
487        .get("content-type")
488        .and_then(|v| v.to_str().ok())
489        .unwrap_or("application/octet-stream");
490    let content_type = super::ContentType::from(content_type);
491
492    if !status.is_client_error() && !status.is_server_error() {
493        let content = resp.text().await?;
494        match content_type {
495            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
496            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
497            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
498        }
499    } else {
500        let content = resp.text().await?;
501        let entity: Option<OrganizationsOrgIdUsersDeleteAccountDeleteError> =
502            serde_json::from_str(&content).ok();
503        Err(Error::ResponseError(ResponseContent {
504            status,
505            content,
506            entity,
507        }))
508    }
509}
510
511pub async fn organizations_org_id_users_delete_account_post(
512    configuration: &configuration::Configuration,
513    org_id: uuid::Uuid,
514    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
515) -> Result<
516    models::OrganizationUserBulkResponseModelListResponseModel,
517    Error<OrganizationsOrgIdUsersDeleteAccountPostError>,
518> {
519    // add a prefix to parameters to efficiently prevent name collisions
520    let p_org_id = org_id;
521    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
522
523    let uri_str = format!(
524        "{}/organizations/{orgId}/users/delete-account",
525        configuration.base_path,
526        orgId = crate::apis::urlencode(p_org_id.to_string())
527    );
528    let mut req_builder = configuration
529        .client
530        .request(reqwest::Method::POST, &uri_str);
531
532    if let Some(ref user_agent) = configuration.user_agent {
533        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
534    }
535    if let Some(ref token) = configuration.oauth_access_token {
536        req_builder = req_builder.bearer_auth(token.to_owned());
537    };
538    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
539
540    let req = req_builder.build()?;
541    let resp = configuration.client.execute(req).await?;
542
543    let status = resp.status();
544    let content_type = resp
545        .headers()
546        .get("content-type")
547        .and_then(|v| v.to_str().ok())
548        .unwrap_or("application/octet-stream");
549    let content_type = super::ContentType::from(content_type);
550
551    if !status.is_client_error() && !status.is_server_error() {
552        let content = resp.text().await?;
553        match content_type {
554            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
555            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
556            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
557        }
558    } else {
559        let content = resp.text().await?;
560        let entity: Option<OrganizationsOrgIdUsersDeleteAccountPostError> =
561            serde_json::from_str(&content).ok();
562        Err(Error::ResponseError(ResponseContent {
563            status,
564            content,
565            entity,
566        }))
567    }
568}
569
570pub async fn organizations_org_id_users_enable_secrets_manager_patch(
571    configuration: &configuration::Configuration,
572    org_id: uuid::Uuid,
573    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
574) -> Result<(), Error<OrganizationsOrgIdUsersEnableSecretsManagerPatchError>> {
575    // add a prefix to parameters to efficiently prevent name collisions
576    let p_org_id = org_id;
577    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
578
579    let uri_str = format!(
580        "{}/organizations/{orgId}/users/enable-secrets-manager",
581        configuration.base_path,
582        orgId = crate::apis::urlencode(p_org_id.to_string())
583    );
584    let mut req_builder = configuration
585        .client
586        .request(reqwest::Method::PATCH, &uri_str);
587
588    if let Some(ref user_agent) = configuration.user_agent {
589        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
590    }
591    if let Some(ref token) = configuration.oauth_access_token {
592        req_builder = req_builder.bearer_auth(token.to_owned());
593    };
594    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
595
596    let req = req_builder.build()?;
597    let resp = configuration.client.execute(req).await?;
598
599    let status = resp.status();
600
601    if !status.is_client_error() && !status.is_server_error() {
602        Ok(())
603    } else {
604        let content = resp.text().await?;
605        let entity: Option<OrganizationsOrgIdUsersEnableSecretsManagerPatchError> =
606            serde_json::from_str(&content).ok();
607        Err(Error::ResponseError(ResponseContent {
608            status,
609            content,
610            entity,
611        }))
612    }
613}
614
615pub async fn organizations_org_id_users_enable_secrets_manager_put(
616    configuration: &configuration::Configuration,
617    org_id: uuid::Uuid,
618    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
619) -> Result<(), Error<OrganizationsOrgIdUsersEnableSecretsManagerPutError>> {
620    // add a prefix to parameters to efficiently prevent name collisions
621    let p_org_id = org_id;
622    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
623
624    let uri_str = format!(
625        "{}/organizations/{orgId}/users/enable-secrets-manager",
626        configuration.base_path,
627        orgId = crate::apis::urlencode(p_org_id.to_string())
628    );
629    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
630
631    if let Some(ref user_agent) = configuration.user_agent {
632        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
633    }
634    if let Some(ref token) = configuration.oauth_access_token {
635        req_builder = req_builder.bearer_auth(token.to_owned());
636    };
637    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
638
639    let req = req_builder.build()?;
640    let resp = configuration.client.execute(req).await?;
641
642    let status = resp.status();
643
644    if !status.is_client_error() && !status.is_server_error() {
645        Ok(())
646    } else {
647        let content = resp.text().await?;
648        let entity: Option<OrganizationsOrgIdUsersEnableSecretsManagerPutError> =
649            serde_json::from_str(&content).ok();
650        Err(Error::ResponseError(ResponseContent {
651            status,
652            content,
653            entity,
654        }))
655    }
656}
657
658pub async fn organizations_org_id_users_get(
659    configuration: &configuration::Configuration,
660    org_id: uuid::Uuid,
661    include_groups: Option<bool>,
662    include_collections: Option<bool>,
663) -> Result<
664    models::OrganizationUserUserDetailsResponseModelListResponseModel,
665    Error<OrganizationsOrgIdUsersGetError>,
666> {
667    // add a prefix to parameters to efficiently prevent name collisions
668    let p_org_id = org_id;
669    let p_include_groups = include_groups;
670    let p_include_collections = include_collections;
671
672    let uri_str = format!(
673        "{}/organizations/{orgId}/users",
674        configuration.base_path,
675        orgId = crate::apis::urlencode(p_org_id.to_string())
676    );
677    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
678
679    if let Some(ref param_value) = p_include_groups {
680        req_builder = req_builder.query(&[("includeGroups", &param_value.to_string())]);
681    }
682    if let Some(ref param_value) = p_include_collections {
683        req_builder = req_builder.query(&[("includeCollections", &param_value.to_string())]);
684    }
685    if let Some(ref user_agent) = configuration.user_agent {
686        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
687    }
688    if let Some(ref token) = configuration.oauth_access_token {
689        req_builder = req_builder.bearer_auth(token.to_owned());
690    };
691
692    let req = req_builder.build()?;
693    let resp = configuration.client.execute(req).await?;
694
695    let status = resp.status();
696    let content_type = resp
697        .headers()
698        .get("content-type")
699        .and_then(|v| v.to_str().ok())
700        .unwrap_or("application/octet-stream");
701    let content_type = super::ContentType::from(content_type);
702
703    if !status.is_client_error() && !status.is_server_error() {
704        let content = resp.text().await?;
705        match content_type {
706            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
707            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`"))),
708            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserDetailsResponseModelListResponseModel`")))),
709        }
710    } else {
711        let content = resp.text().await?;
712        let entity: Option<OrganizationsOrgIdUsersGetError> = serde_json::from_str(&content).ok();
713        Err(Error::ResponseError(ResponseContent {
714            status,
715            content,
716            entity,
717        }))
718    }
719}
720
721pub async fn organizations_org_id_users_id_confirm_post(
722    configuration: &configuration::Configuration,
723    org_id: &str,
724    id: &str,
725    organization_user_confirm_request_model: Option<models::OrganizationUserConfirmRequestModel>,
726) -> Result<(), Error<OrganizationsOrgIdUsersIdConfirmPostError>> {
727    // add a prefix to parameters to efficiently prevent name collisions
728    let p_org_id = org_id;
729    let p_id = id;
730    let p_organization_user_confirm_request_model = organization_user_confirm_request_model;
731
732    let uri_str = format!(
733        "{}/organizations/{orgId}/users/{id}/confirm",
734        configuration.base_path,
735        orgId = crate::apis::urlencode(p_org_id),
736        id = crate::apis::urlencode(p_id)
737    );
738    let mut req_builder = configuration
739        .client
740        .request(reqwest::Method::POST, &uri_str);
741
742    if let Some(ref user_agent) = configuration.user_agent {
743        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
744    }
745    if let Some(ref token) = configuration.oauth_access_token {
746        req_builder = req_builder.bearer_auth(token.to_owned());
747    };
748    req_builder = req_builder.json(&p_organization_user_confirm_request_model);
749
750    let req = req_builder.build()?;
751    let resp = configuration.client.execute(req).await?;
752
753    let status = resp.status();
754
755    if !status.is_client_error() && !status.is_server_error() {
756        Ok(())
757    } else {
758        let content = resp.text().await?;
759        let entity: Option<OrganizationsOrgIdUsersIdConfirmPostError> =
760            serde_json::from_str(&content).ok();
761        Err(Error::ResponseError(ResponseContent {
762            status,
763            content,
764            entity,
765        }))
766    }
767}
768
769pub async fn organizations_org_id_users_id_delete(
770    configuration: &configuration::Configuration,
771    org_id: uuid::Uuid,
772    id: uuid::Uuid,
773) -> Result<(), Error<OrganizationsOrgIdUsersIdDeleteError>> {
774    // add a prefix to parameters to efficiently prevent name collisions
775    let p_org_id = org_id;
776    let p_id = id;
777
778    let uri_str = format!(
779        "{}/organizations/{orgId}/users/{id}",
780        configuration.base_path,
781        orgId = crate::apis::urlencode(p_org_id.to_string()),
782        id = crate::apis::urlencode(p_id.to_string())
783    );
784    let mut req_builder = configuration
785        .client
786        .request(reqwest::Method::DELETE, &uri_str);
787
788    if let Some(ref user_agent) = configuration.user_agent {
789        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
790    }
791    if let Some(ref token) = configuration.oauth_access_token {
792        req_builder = req_builder.bearer_auth(token.to_owned());
793    };
794
795    let req = req_builder.build()?;
796    let resp = configuration.client.execute(req).await?;
797
798    let status = resp.status();
799
800    if !status.is_client_error() && !status.is_server_error() {
801        Ok(())
802    } else {
803        let content = resp.text().await?;
804        let entity: Option<OrganizationsOrgIdUsersIdDeleteError> =
805            serde_json::from_str(&content).ok();
806        Err(Error::ResponseError(ResponseContent {
807            status,
808            content,
809            entity,
810        }))
811    }
812}
813
814pub async fn organizations_org_id_users_id_delete_account_delete(
815    configuration: &configuration::Configuration,
816    org_id: uuid::Uuid,
817    id: uuid::Uuid,
818) -> Result<(), Error<OrganizationsOrgIdUsersIdDeleteAccountDeleteError>> {
819    // add a prefix to parameters to efficiently prevent name collisions
820    let p_org_id = org_id;
821    let p_id = id;
822
823    let uri_str = format!(
824        "{}/organizations/{orgId}/users/{id}/delete-account",
825        configuration.base_path,
826        orgId = crate::apis::urlencode(p_org_id.to_string()),
827        id = crate::apis::urlencode(p_id.to_string())
828    );
829    let mut req_builder = configuration
830        .client
831        .request(reqwest::Method::DELETE, &uri_str);
832
833    if let Some(ref user_agent) = configuration.user_agent {
834        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
835    }
836    if let Some(ref token) = configuration.oauth_access_token {
837        req_builder = req_builder.bearer_auth(token.to_owned());
838    };
839
840    let req = req_builder.build()?;
841    let resp = configuration.client.execute(req).await?;
842
843    let status = resp.status();
844
845    if !status.is_client_error() && !status.is_server_error() {
846        Ok(())
847    } else {
848        let content = resp.text().await?;
849        let entity: Option<OrganizationsOrgIdUsersIdDeleteAccountDeleteError> =
850            serde_json::from_str(&content).ok();
851        Err(Error::ResponseError(ResponseContent {
852            status,
853            content,
854            entity,
855        }))
856    }
857}
858
859pub async fn organizations_org_id_users_id_delete_account_post(
860    configuration: &configuration::Configuration,
861    org_id: uuid::Uuid,
862    id: uuid::Uuid,
863) -> Result<(), Error<OrganizationsOrgIdUsersIdDeleteAccountPostError>> {
864    // add a prefix to parameters to efficiently prevent name collisions
865    let p_org_id = org_id;
866    let p_id = id;
867
868    let uri_str = format!(
869        "{}/organizations/{orgId}/users/{id}/delete-account",
870        configuration.base_path,
871        orgId = crate::apis::urlencode(p_org_id.to_string()),
872        id = crate::apis::urlencode(p_id.to_string())
873    );
874    let mut req_builder = configuration
875        .client
876        .request(reqwest::Method::POST, &uri_str);
877
878    if let Some(ref user_agent) = configuration.user_agent {
879        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
880    }
881    if let Some(ref token) = configuration.oauth_access_token {
882        req_builder = req_builder.bearer_auth(token.to_owned());
883    };
884
885    let req = req_builder.build()?;
886    let resp = configuration.client.execute(req).await?;
887
888    let status = resp.status();
889
890    if !status.is_client_error() && !status.is_server_error() {
891        Ok(())
892    } else {
893        let content = resp.text().await?;
894        let entity: Option<OrganizationsOrgIdUsersIdDeleteAccountPostError> =
895            serde_json::from_str(&content).ok();
896        Err(Error::ResponseError(ResponseContent {
897            status,
898            content,
899            entity,
900        }))
901    }
902}
903
904pub async fn organizations_org_id_users_id_get(
905    configuration: &configuration::Configuration,
906    id: uuid::Uuid,
907    org_id: &str,
908    include_groups: Option<bool>,
909) -> Result<models::OrganizationUserDetailsResponseModel, Error<OrganizationsOrgIdUsersIdGetError>>
910{
911    // add a prefix to parameters to efficiently prevent name collisions
912    let p_id = id;
913    let p_org_id = org_id;
914    let p_include_groups = include_groups;
915
916    let uri_str = format!(
917        "{}/organizations/{orgId}/users/{id}",
918        configuration.base_path,
919        id = crate::apis::urlencode(p_id.to_string()),
920        orgId = crate::apis::urlencode(p_org_id)
921    );
922    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
923
924    if let Some(ref param_value) = p_include_groups {
925        req_builder = req_builder.query(&[("includeGroups", &param_value.to_string())]);
926    }
927    if let Some(ref user_agent) = configuration.user_agent {
928        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
929    }
930    if let Some(ref token) = configuration.oauth_access_token {
931        req_builder = req_builder.bearer_auth(token.to_owned());
932    };
933
934    let req = req_builder.build()?;
935    let resp = configuration.client.execute(req).await?;
936
937    let status = resp.status();
938    let content_type = resp
939        .headers()
940        .get("content-type")
941        .and_then(|v| v.to_str().ok())
942        .unwrap_or("application/octet-stream");
943    let content_type = super::ContentType::from(content_type);
944
945    if !status.is_client_error() && !status.is_server_error() {
946        let content = resp.text().await?;
947        match content_type {
948            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
949            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`"))),
950            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserDetailsResponseModel`")))),
951        }
952    } else {
953        let content = resp.text().await?;
954        let entity: Option<OrganizationsOrgIdUsersIdGetError> = serde_json::from_str(&content).ok();
955        Err(Error::ResponseError(ResponseContent {
956            status,
957            content,
958            entity,
959        }))
960    }
961}
962
963pub async fn organizations_org_id_users_id_groups_get(
964    configuration: &configuration::Configuration,
965    org_id: &str,
966    id: &str,
967) -> Result<Vec<String>, Error<OrganizationsOrgIdUsersIdGroupsGetError>> {
968    // add a prefix to parameters to efficiently prevent name collisions
969    let p_org_id = org_id;
970    let p_id = id;
971
972    let uri_str = format!(
973        "{}/organizations/{orgId}/users/{id}/groups",
974        configuration.base_path,
975        orgId = crate::apis::urlencode(p_org_id),
976        id = crate::apis::urlencode(p_id)
977    );
978    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
979
980    if let Some(ref user_agent) = configuration.user_agent {
981        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
982    }
983    if let Some(ref token) = configuration.oauth_access_token {
984        req_builder = req_builder.bearer_auth(token.to_owned());
985    };
986
987    let req = req_builder.build()?;
988    let resp = configuration.client.execute(req).await?;
989
990    let status = resp.status();
991    let content_type = resp
992        .headers()
993        .get("content-type")
994        .and_then(|v| v.to_str().ok())
995        .unwrap_or("application/octet-stream");
996    let content_type = super::ContentType::from(content_type);
997
998    if !status.is_client_error() && !status.is_server_error() {
999        let content = resp.text().await?;
1000        match content_type {
1001            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1002            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;String&gt;`"))),
1003            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;String&gt;`")))),
1004        }
1005    } else {
1006        let content = resp.text().await?;
1007        let entity: Option<OrganizationsOrgIdUsersIdGroupsGetError> =
1008            serde_json::from_str(&content).ok();
1009        Err(Error::ResponseError(ResponseContent {
1010            status,
1011            content,
1012            entity,
1013        }))
1014    }
1015}
1016
1017pub async fn organizations_org_id_users_id_post(
1018    configuration: &configuration::Configuration,
1019    org_id: uuid::Uuid,
1020    id: uuid::Uuid,
1021    organization_user_update_request_model: Option<models::OrganizationUserUpdateRequestModel>,
1022) -> Result<(), Error<OrganizationsOrgIdUsersIdPostError>> {
1023    // add a prefix to parameters to efficiently prevent name collisions
1024    let p_org_id = org_id;
1025    let p_id = id;
1026    let p_organization_user_update_request_model = organization_user_update_request_model;
1027
1028    let uri_str = format!(
1029        "{}/organizations/{orgId}/users/{id}",
1030        configuration.base_path,
1031        orgId = crate::apis::urlencode(p_org_id.to_string()),
1032        id = crate::apis::urlencode(p_id.to_string())
1033    );
1034    let mut req_builder = configuration
1035        .client
1036        .request(reqwest::Method::POST, &uri_str);
1037
1038    if let Some(ref user_agent) = configuration.user_agent {
1039        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1040    }
1041    if let Some(ref token) = configuration.oauth_access_token {
1042        req_builder = req_builder.bearer_auth(token.to_owned());
1043    };
1044    req_builder = req_builder.json(&p_organization_user_update_request_model);
1045
1046    let req = req_builder.build()?;
1047    let resp = configuration.client.execute(req).await?;
1048
1049    let status = resp.status();
1050
1051    if !status.is_client_error() && !status.is_server_error() {
1052        Ok(())
1053    } else {
1054        let content = resp.text().await?;
1055        let entity: Option<OrganizationsOrgIdUsersIdPostError> =
1056            serde_json::from_str(&content).ok();
1057        Err(Error::ResponseError(ResponseContent {
1058            status,
1059            content,
1060            entity,
1061        }))
1062    }
1063}
1064
1065pub async fn organizations_org_id_users_id_put(
1066    configuration: &configuration::Configuration,
1067    org_id: uuid::Uuid,
1068    id: uuid::Uuid,
1069    organization_user_update_request_model: Option<models::OrganizationUserUpdateRequestModel>,
1070) -> Result<(), Error<OrganizationsOrgIdUsersIdPutError>> {
1071    // add a prefix to parameters to efficiently prevent name collisions
1072    let p_org_id = org_id;
1073    let p_id = id;
1074    let p_organization_user_update_request_model = organization_user_update_request_model;
1075
1076    let uri_str = format!(
1077        "{}/organizations/{orgId}/users/{id}",
1078        configuration.base_path,
1079        orgId = crate::apis::urlencode(p_org_id.to_string()),
1080        id = crate::apis::urlencode(p_id.to_string())
1081    );
1082    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1083
1084    if let Some(ref user_agent) = configuration.user_agent {
1085        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1086    }
1087    if let Some(ref token) = configuration.oauth_access_token {
1088        req_builder = req_builder.bearer_auth(token.to_owned());
1089    };
1090    req_builder = req_builder.json(&p_organization_user_update_request_model);
1091
1092    let req = req_builder.build()?;
1093    let resp = configuration.client.execute(req).await?;
1094
1095    let status = resp.status();
1096
1097    if !status.is_client_error() && !status.is_server_error() {
1098        Ok(())
1099    } else {
1100        let content = resp.text().await?;
1101        let entity: Option<OrganizationsOrgIdUsersIdPutError> = serde_json::from_str(&content).ok();
1102        Err(Error::ResponseError(ResponseContent {
1103            status,
1104            content,
1105            entity,
1106        }))
1107    }
1108}
1109
1110pub async fn organizations_org_id_users_id_reinvite_post(
1111    configuration: &configuration::Configuration,
1112    org_id: &str,
1113    id: &str,
1114) -> Result<(), Error<OrganizationsOrgIdUsersIdReinvitePostError>> {
1115    // add a prefix to parameters to efficiently prevent name collisions
1116    let p_org_id = org_id;
1117    let p_id = id;
1118
1119    let uri_str = format!(
1120        "{}/organizations/{orgId}/users/{id}/reinvite",
1121        configuration.base_path,
1122        orgId = crate::apis::urlencode(p_org_id),
1123        id = crate::apis::urlencode(p_id)
1124    );
1125    let mut req_builder = configuration
1126        .client
1127        .request(reqwest::Method::POST, &uri_str);
1128
1129    if let Some(ref user_agent) = configuration.user_agent {
1130        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1131    }
1132    if let Some(ref token) = configuration.oauth_access_token {
1133        req_builder = req_builder.bearer_auth(token.to_owned());
1134    };
1135
1136    let req = req_builder.build()?;
1137    let resp = configuration.client.execute(req).await?;
1138
1139    let status = resp.status();
1140
1141    if !status.is_client_error() && !status.is_server_error() {
1142        Ok(())
1143    } else {
1144        let content = resp.text().await?;
1145        let entity: Option<OrganizationsOrgIdUsersIdReinvitePostError> =
1146            serde_json::from_str(&content).ok();
1147        Err(Error::ResponseError(ResponseContent {
1148            status,
1149            content,
1150            entity,
1151        }))
1152    }
1153}
1154
1155pub async fn organizations_org_id_users_id_remove_post(
1156    configuration: &configuration::Configuration,
1157    org_id: uuid::Uuid,
1158    id: uuid::Uuid,
1159) -> Result<(), Error<OrganizationsOrgIdUsersIdRemovePostError>> {
1160    // add a prefix to parameters to efficiently prevent name collisions
1161    let p_org_id = org_id;
1162    let p_id = id;
1163
1164    let uri_str = format!(
1165        "{}/organizations/{orgId}/users/{id}/remove",
1166        configuration.base_path,
1167        orgId = crate::apis::urlencode(p_org_id.to_string()),
1168        id = crate::apis::urlencode(p_id.to_string())
1169    );
1170    let mut req_builder = configuration
1171        .client
1172        .request(reqwest::Method::POST, &uri_str);
1173
1174    if let Some(ref user_agent) = configuration.user_agent {
1175        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1176    }
1177    if let Some(ref token) = configuration.oauth_access_token {
1178        req_builder = req_builder.bearer_auth(token.to_owned());
1179    };
1180
1181    let req = req_builder.build()?;
1182    let resp = configuration.client.execute(req).await?;
1183
1184    let status = resp.status();
1185
1186    if !status.is_client_error() && !status.is_server_error() {
1187        Ok(())
1188    } else {
1189        let content = resp.text().await?;
1190        let entity: Option<OrganizationsOrgIdUsersIdRemovePostError> =
1191            serde_json::from_str(&content).ok();
1192        Err(Error::ResponseError(ResponseContent {
1193            status,
1194            content,
1195            entity,
1196        }))
1197    }
1198}
1199
1200pub async fn organizations_org_id_users_id_reset_password_details_get(
1201    configuration: &configuration::Configuration,
1202    org_id: &str,
1203    id: &str,
1204) -> Result<
1205    models::OrganizationUserResetPasswordDetailsResponseModel,
1206    Error<OrganizationsOrgIdUsersIdResetPasswordDetailsGetError>,
1207> {
1208    // add a prefix to parameters to efficiently prevent name collisions
1209    let p_org_id = org_id;
1210    let p_id = id;
1211
1212    let uri_str = format!(
1213        "{}/organizations/{orgId}/users/{id}/reset-password-details",
1214        configuration.base_path,
1215        orgId = crate::apis::urlencode(p_org_id),
1216        id = crate::apis::urlencode(p_id)
1217    );
1218    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1219
1220    if let Some(ref user_agent) = configuration.user_agent {
1221        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1222    }
1223    if let Some(ref token) = configuration.oauth_access_token {
1224        req_builder = req_builder.bearer_auth(token.to_owned());
1225    };
1226
1227    let req = req_builder.build()?;
1228    let resp = configuration.client.execute(req).await?;
1229
1230    let status = resp.status();
1231    let content_type = resp
1232        .headers()
1233        .get("content-type")
1234        .and_then(|v| v.to_str().ok())
1235        .unwrap_or("application/octet-stream");
1236    let content_type = super::ContentType::from(content_type);
1237
1238    if !status.is_client_error() && !status.is_server_error() {
1239        let content = resp.text().await?;
1240        match content_type {
1241            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1242            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`"))),
1243            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserResetPasswordDetailsResponseModel`")))),
1244        }
1245    } else {
1246        let content = resp.text().await?;
1247        let entity: Option<OrganizationsOrgIdUsersIdResetPasswordDetailsGetError> =
1248            serde_json::from_str(&content).ok();
1249        Err(Error::ResponseError(ResponseContent {
1250            status,
1251            content,
1252            entity,
1253        }))
1254    }
1255}
1256
1257pub async fn organizations_org_id_users_id_reset_password_put(
1258    configuration: &configuration::Configuration,
1259    org_id: &str,
1260    id: &str,
1261    organization_user_reset_password_request_model: Option<
1262        models::OrganizationUserResetPasswordRequestModel,
1263    >,
1264) -> Result<(), Error<OrganizationsOrgIdUsersIdResetPasswordPutError>> {
1265    // add a prefix to parameters to efficiently prevent name collisions
1266    let p_org_id = org_id;
1267    let p_id = id;
1268    let p_organization_user_reset_password_request_model =
1269        organization_user_reset_password_request_model;
1270
1271    let uri_str = format!(
1272        "{}/organizations/{orgId}/users/{id}/reset-password",
1273        configuration.base_path,
1274        orgId = crate::apis::urlencode(p_org_id),
1275        id = crate::apis::urlencode(p_id)
1276    );
1277    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1278
1279    if let Some(ref user_agent) = configuration.user_agent {
1280        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1281    }
1282    if let Some(ref token) = configuration.oauth_access_token {
1283        req_builder = req_builder.bearer_auth(token.to_owned());
1284    };
1285    req_builder = req_builder.json(&p_organization_user_reset_password_request_model);
1286
1287    let req = req_builder.build()?;
1288    let resp = configuration.client.execute(req).await?;
1289
1290    let status = resp.status();
1291
1292    if !status.is_client_error() && !status.is_server_error() {
1293        Ok(())
1294    } else {
1295        let content = resp.text().await?;
1296        let entity: Option<OrganizationsOrgIdUsersIdResetPasswordPutError> =
1297            serde_json::from_str(&content).ok();
1298        Err(Error::ResponseError(ResponseContent {
1299            status,
1300            content,
1301            entity,
1302        }))
1303    }
1304}
1305
1306pub async fn organizations_org_id_users_id_restore_patch(
1307    configuration: &configuration::Configuration,
1308    org_id: uuid::Uuid,
1309    id: uuid::Uuid,
1310) -> Result<(), Error<OrganizationsOrgIdUsersIdRestorePatchError>> {
1311    // add a prefix to parameters to efficiently prevent name collisions
1312    let p_org_id = org_id;
1313    let p_id = id;
1314
1315    let uri_str = format!(
1316        "{}/organizations/{orgId}/users/{id}/restore",
1317        configuration.base_path,
1318        orgId = crate::apis::urlencode(p_org_id.to_string()),
1319        id = crate::apis::urlencode(p_id.to_string())
1320    );
1321    let mut req_builder = configuration
1322        .client
1323        .request(reqwest::Method::PATCH, &uri_str);
1324
1325    if let Some(ref user_agent) = configuration.user_agent {
1326        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1327    }
1328    if let Some(ref token) = configuration.oauth_access_token {
1329        req_builder = req_builder.bearer_auth(token.to_owned());
1330    };
1331
1332    let req = req_builder.build()?;
1333    let resp = configuration.client.execute(req).await?;
1334
1335    let status = resp.status();
1336
1337    if !status.is_client_error() && !status.is_server_error() {
1338        Ok(())
1339    } else {
1340        let content = resp.text().await?;
1341        let entity: Option<OrganizationsOrgIdUsersIdRestorePatchError> =
1342            serde_json::from_str(&content).ok();
1343        Err(Error::ResponseError(ResponseContent {
1344            status,
1345            content,
1346            entity,
1347        }))
1348    }
1349}
1350
1351pub async fn organizations_org_id_users_id_restore_put(
1352    configuration: &configuration::Configuration,
1353    org_id: uuid::Uuid,
1354    id: uuid::Uuid,
1355) -> Result<(), Error<OrganizationsOrgIdUsersIdRestorePutError>> {
1356    // add a prefix to parameters to efficiently prevent name collisions
1357    let p_org_id = org_id;
1358    let p_id = id;
1359
1360    let uri_str = format!(
1361        "{}/organizations/{orgId}/users/{id}/restore",
1362        configuration.base_path,
1363        orgId = crate::apis::urlencode(p_org_id.to_string()),
1364        id = crate::apis::urlencode(p_id.to_string())
1365    );
1366    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1367
1368    if let Some(ref user_agent) = configuration.user_agent {
1369        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1370    }
1371    if let Some(ref token) = configuration.oauth_access_token {
1372        req_builder = req_builder.bearer_auth(token.to_owned());
1373    };
1374
1375    let req = req_builder.build()?;
1376    let resp = configuration.client.execute(req).await?;
1377
1378    let status = resp.status();
1379
1380    if !status.is_client_error() && !status.is_server_error() {
1381        Ok(())
1382    } else {
1383        let content = resp.text().await?;
1384        let entity: Option<OrganizationsOrgIdUsersIdRestorePutError> =
1385            serde_json::from_str(&content).ok();
1386        Err(Error::ResponseError(ResponseContent {
1387            status,
1388            content,
1389            entity,
1390        }))
1391    }
1392}
1393
1394pub async fn organizations_org_id_users_id_revoke_patch(
1395    configuration: &configuration::Configuration,
1396    org_id: uuid::Uuid,
1397    id: uuid::Uuid,
1398) -> Result<(), Error<OrganizationsOrgIdUsersIdRevokePatchError>> {
1399    // add a prefix to parameters to efficiently prevent name collisions
1400    let p_org_id = org_id;
1401    let p_id = id;
1402
1403    let uri_str = format!(
1404        "{}/organizations/{orgId}/users/{id}/revoke",
1405        configuration.base_path,
1406        orgId = crate::apis::urlencode(p_org_id.to_string()),
1407        id = crate::apis::urlencode(p_id.to_string())
1408    );
1409    let mut req_builder = configuration
1410        .client
1411        .request(reqwest::Method::PATCH, &uri_str);
1412
1413    if let Some(ref user_agent) = configuration.user_agent {
1414        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1415    }
1416    if let Some(ref token) = configuration.oauth_access_token {
1417        req_builder = req_builder.bearer_auth(token.to_owned());
1418    };
1419
1420    let req = req_builder.build()?;
1421    let resp = configuration.client.execute(req).await?;
1422
1423    let status = resp.status();
1424
1425    if !status.is_client_error() && !status.is_server_error() {
1426        Ok(())
1427    } else {
1428        let content = resp.text().await?;
1429        let entity: Option<OrganizationsOrgIdUsersIdRevokePatchError> =
1430            serde_json::from_str(&content).ok();
1431        Err(Error::ResponseError(ResponseContent {
1432            status,
1433            content,
1434            entity,
1435        }))
1436    }
1437}
1438
1439pub async fn organizations_org_id_users_id_revoke_put(
1440    configuration: &configuration::Configuration,
1441    org_id: uuid::Uuid,
1442    id: uuid::Uuid,
1443) -> Result<(), Error<OrganizationsOrgIdUsersIdRevokePutError>> {
1444    // add a prefix to parameters to efficiently prevent name collisions
1445    let p_org_id = org_id;
1446    let p_id = id;
1447
1448    let uri_str = format!(
1449        "{}/organizations/{orgId}/users/{id}/revoke",
1450        configuration.base_path,
1451        orgId = crate::apis::urlencode(p_org_id.to_string()),
1452        id = crate::apis::urlencode(p_id.to_string())
1453    );
1454    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1455
1456    if let Some(ref user_agent) = configuration.user_agent {
1457        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1458    }
1459    if let Some(ref token) = configuration.oauth_access_token {
1460        req_builder = req_builder.bearer_auth(token.to_owned());
1461    };
1462
1463    let req = req_builder.build()?;
1464    let resp = configuration.client.execute(req).await?;
1465
1466    let status = resp.status();
1467
1468    if !status.is_client_error() && !status.is_server_error() {
1469        Ok(())
1470    } else {
1471        let content = resp.text().await?;
1472        let entity: Option<OrganizationsOrgIdUsersIdRevokePutError> =
1473            serde_json::from_str(&content).ok();
1474        Err(Error::ResponseError(ResponseContent {
1475            status,
1476            content,
1477            entity,
1478        }))
1479    }
1480}
1481
1482pub async fn organizations_org_id_users_invite_post(
1483    configuration: &configuration::Configuration,
1484    org_id: uuid::Uuid,
1485    organization_user_invite_request_model: Option<models::OrganizationUserInviteRequestModel>,
1486) -> Result<(), Error<OrganizationsOrgIdUsersInvitePostError>> {
1487    // add a prefix to parameters to efficiently prevent name collisions
1488    let p_org_id = org_id;
1489    let p_organization_user_invite_request_model = organization_user_invite_request_model;
1490
1491    let uri_str = format!(
1492        "{}/organizations/{orgId}/users/invite",
1493        configuration.base_path,
1494        orgId = crate::apis::urlencode(p_org_id.to_string())
1495    );
1496    let mut req_builder = configuration
1497        .client
1498        .request(reqwest::Method::POST, &uri_str);
1499
1500    if let Some(ref user_agent) = configuration.user_agent {
1501        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1502    }
1503    if let Some(ref token) = configuration.oauth_access_token {
1504        req_builder = req_builder.bearer_auth(token.to_owned());
1505    };
1506    req_builder = req_builder.json(&p_organization_user_invite_request_model);
1507
1508    let req = req_builder.build()?;
1509    let resp = configuration.client.execute(req).await?;
1510
1511    let status = resp.status();
1512
1513    if !status.is_client_error() && !status.is_server_error() {
1514        Ok(())
1515    } else {
1516        let content = resp.text().await?;
1517        let entity: Option<OrganizationsOrgIdUsersInvitePostError> =
1518            serde_json::from_str(&content).ok();
1519        Err(Error::ResponseError(ResponseContent {
1520            status,
1521            content,
1522            entity,
1523        }))
1524    }
1525}
1526
1527pub async fn organizations_org_id_users_mini_details_get(
1528    configuration: &configuration::Configuration,
1529    org_id: uuid::Uuid,
1530) -> Result<
1531    models::OrganizationUserUserMiniDetailsResponseModelListResponseModel,
1532    Error<OrganizationsOrgIdUsersMiniDetailsGetError>,
1533> {
1534    // add a prefix to parameters to efficiently prevent name collisions
1535    let p_org_id = org_id;
1536
1537    let uri_str = format!(
1538        "{}/organizations/{orgId}/users/mini-details",
1539        configuration.base_path,
1540        orgId = crate::apis::urlencode(p_org_id.to_string())
1541    );
1542    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1543
1544    if let Some(ref user_agent) = configuration.user_agent {
1545        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1546    }
1547    if let Some(ref token) = configuration.oauth_access_token {
1548        req_builder = req_builder.bearer_auth(token.to_owned());
1549    };
1550
1551    let req = req_builder.build()?;
1552    let resp = configuration.client.execute(req).await?;
1553
1554    let status = resp.status();
1555    let content_type = resp
1556        .headers()
1557        .get("content-type")
1558        .and_then(|v| v.to_str().ok())
1559        .unwrap_or("application/octet-stream");
1560    let content_type = super::ContentType::from(content_type);
1561
1562    if !status.is_client_error() && !status.is_server_error() {
1563        let content = resp.text().await?;
1564        match content_type {
1565            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1566            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`"))),
1567            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserUserMiniDetailsResponseModelListResponseModel`")))),
1568        }
1569    } else {
1570        let content = resp.text().await?;
1571        let entity: Option<OrganizationsOrgIdUsersMiniDetailsGetError> =
1572            serde_json::from_str(&content).ok();
1573        Err(Error::ResponseError(ResponseContent {
1574            status,
1575            content,
1576            entity,
1577        }))
1578    }
1579}
1580
1581pub async fn organizations_org_id_users_organization_user_id_accept_init_post(
1582    configuration: &configuration::Configuration,
1583    org_id: uuid::Uuid,
1584    organization_user_id: uuid::Uuid,
1585    organization_user_accept_init_request_model: Option<
1586        models::OrganizationUserAcceptInitRequestModel,
1587    >,
1588) -> Result<(), Error<OrganizationsOrgIdUsersOrganizationUserIdAcceptInitPostError>> {
1589    // add a prefix to parameters to efficiently prevent name collisions
1590    let p_org_id = org_id;
1591    let p_organization_user_id = organization_user_id;
1592    let p_organization_user_accept_init_request_model = organization_user_accept_init_request_model;
1593
1594    let uri_str = format!(
1595        "{}/organizations/{orgId}/users/{organizationUserId}/accept-init",
1596        configuration.base_path,
1597        orgId = crate::apis::urlencode(p_org_id.to_string()),
1598        organizationUserId = crate::apis::urlencode(p_organization_user_id.to_string())
1599    );
1600    let mut req_builder = configuration
1601        .client
1602        .request(reqwest::Method::POST, &uri_str);
1603
1604    if let Some(ref user_agent) = configuration.user_agent {
1605        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1606    }
1607    if let Some(ref token) = configuration.oauth_access_token {
1608        req_builder = req_builder.bearer_auth(token.to_owned());
1609    };
1610    req_builder = req_builder.json(&p_organization_user_accept_init_request_model);
1611
1612    let req = req_builder.build()?;
1613    let resp = configuration.client.execute(req).await?;
1614
1615    let status = resp.status();
1616
1617    if !status.is_client_error() && !status.is_server_error() {
1618        Ok(())
1619    } else {
1620        let content = resp.text().await?;
1621        let entity: Option<OrganizationsOrgIdUsersOrganizationUserIdAcceptInitPostError> =
1622            serde_json::from_str(&content).ok();
1623        Err(Error::ResponseError(ResponseContent {
1624            status,
1625            content,
1626            entity,
1627        }))
1628    }
1629}
1630
1631pub async fn organizations_org_id_users_organization_user_id_accept_post(
1632    configuration: &configuration::Configuration,
1633    org_id: uuid::Uuid,
1634    organization_user_id: uuid::Uuid,
1635    organization_user_accept_request_model: Option<models::OrganizationUserAcceptRequestModel>,
1636) -> Result<(), Error<OrganizationsOrgIdUsersOrganizationUserIdAcceptPostError>> {
1637    // add a prefix to parameters to efficiently prevent name collisions
1638    let p_org_id = org_id;
1639    let p_organization_user_id = organization_user_id;
1640    let p_organization_user_accept_request_model = organization_user_accept_request_model;
1641
1642    let uri_str = format!(
1643        "{}/organizations/{orgId}/users/{organizationUserId}/accept",
1644        configuration.base_path,
1645        orgId = crate::apis::urlencode(p_org_id.to_string()),
1646        organizationUserId = crate::apis::urlencode(p_organization_user_id.to_string())
1647    );
1648    let mut req_builder = configuration
1649        .client
1650        .request(reqwest::Method::POST, &uri_str);
1651
1652    if let Some(ref user_agent) = configuration.user_agent {
1653        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1654    }
1655    if let Some(ref token) = configuration.oauth_access_token {
1656        req_builder = req_builder.bearer_auth(token.to_owned());
1657    };
1658    req_builder = req_builder.json(&p_organization_user_accept_request_model);
1659
1660    let req = req_builder.build()?;
1661    let resp = configuration.client.execute(req).await?;
1662
1663    let status = resp.status();
1664
1665    if !status.is_client_error() && !status.is_server_error() {
1666        Ok(())
1667    } else {
1668        let content = resp.text().await?;
1669        let entity: Option<OrganizationsOrgIdUsersOrganizationUserIdAcceptPostError> =
1670            serde_json::from_str(&content).ok();
1671        Err(Error::ResponseError(ResponseContent {
1672            status,
1673            content,
1674            entity,
1675        }))
1676    }
1677}
1678
1679pub async fn organizations_org_id_users_public_keys_post(
1680    configuration: &configuration::Configuration,
1681    org_id: &str,
1682    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1683) -> Result<
1684    models::OrganizationUserPublicKeyResponseModelListResponseModel,
1685    Error<OrganizationsOrgIdUsersPublicKeysPostError>,
1686> {
1687    // add a prefix to parameters to efficiently prevent name collisions
1688    let p_org_id = org_id;
1689    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1690
1691    let uri_str = format!(
1692        "{}/organizations/{orgId}/users/public-keys",
1693        configuration.base_path,
1694        orgId = crate::apis::urlencode(p_org_id)
1695    );
1696    let mut req_builder = configuration
1697        .client
1698        .request(reqwest::Method::POST, &uri_str);
1699
1700    if let Some(ref user_agent) = configuration.user_agent {
1701        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1702    }
1703    if let Some(ref token) = configuration.oauth_access_token {
1704        req_builder = req_builder.bearer_auth(token.to_owned());
1705    };
1706    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
1707
1708    let req = req_builder.build()?;
1709    let resp = configuration.client.execute(req).await?;
1710
1711    let status = resp.status();
1712    let content_type = resp
1713        .headers()
1714        .get("content-type")
1715        .and_then(|v| v.to_str().ok())
1716        .unwrap_or("application/octet-stream");
1717    let content_type = super::ContentType::from(content_type);
1718
1719    if !status.is_client_error() && !status.is_server_error() {
1720        let content = resp.text().await?;
1721        match content_type {
1722            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1723            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`"))),
1724            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserPublicKeyResponseModelListResponseModel`")))),
1725        }
1726    } else {
1727        let content = resp.text().await?;
1728        let entity: Option<OrganizationsOrgIdUsersPublicKeysPostError> =
1729            serde_json::from_str(&content).ok();
1730        Err(Error::ResponseError(ResponseContent {
1731            status,
1732            content,
1733            entity,
1734        }))
1735    }
1736}
1737
1738pub async fn organizations_org_id_users_reinvite_post(
1739    configuration: &configuration::Configuration,
1740    org_id: &str,
1741    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1742) -> Result<
1743    models::OrganizationUserBulkResponseModelListResponseModel,
1744    Error<OrganizationsOrgIdUsersReinvitePostError>,
1745> {
1746    // add a prefix to parameters to efficiently prevent name collisions
1747    let p_org_id = org_id;
1748    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1749
1750    let uri_str = format!(
1751        "{}/organizations/{orgId}/users/reinvite",
1752        configuration.base_path,
1753        orgId = crate::apis::urlencode(p_org_id)
1754    );
1755    let mut req_builder = configuration
1756        .client
1757        .request(reqwest::Method::POST, &uri_str);
1758
1759    if let Some(ref user_agent) = configuration.user_agent {
1760        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1761    }
1762    if let Some(ref token) = configuration.oauth_access_token {
1763        req_builder = req_builder.bearer_auth(token.to_owned());
1764    };
1765    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
1766
1767    let req = req_builder.build()?;
1768    let resp = configuration.client.execute(req).await?;
1769
1770    let status = resp.status();
1771    let content_type = resp
1772        .headers()
1773        .get("content-type")
1774        .and_then(|v| v.to_str().ok())
1775        .unwrap_or("application/octet-stream");
1776    let content_type = super::ContentType::from(content_type);
1777
1778    if !status.is_client_error() && !status.is_server_error() {
1779        let content = resp.text().await?;
1780        match content_type {
1781            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1782            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
1783            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
1784        }
1785    } else {
1786        let content = resp.text().await?;
1787        let entity: Option<OrganizationsOrgIdUsersReinvitePostError> =
1788            serde_json::from_str(&content).ok();
1789        Err(Error::ResponseError(ResponseContent {
1790            status,
1791            content,
1792            entity,
1793        }))
1794    }
1795}
1796
1797pub async fn organizations_org_id_users_remove_post(
1798    configuration: &configuration::Configuration,
1799    org_id: uuid::Uuid,
1800    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1801) -> Result<
1802    models::OrganizationUserBulkResponseModelListResponseModel,
1803    Error<OrganizationsOrgIdUsersRemovePostError>,
1804> {
1805    // add a prefix to parameters to efficiently prevent name collisions
1806    let p_org_id = org_id;
1807    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1808
1809    let uri_str = format!(
1810        "{}/organizations/{orgId}/users/remove",
1811        configuration.base_path,
1812        orgId = crate::apis::urlencode(p_org_id.to_string())
1813    );
1814    let mut req_builder = configuration
1815        .client
1816        .request(reqwest::Method::POST, &uri_str);
1817
1818    if let Some(ref user_agent) = configuration.user_agent {
1819        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1820    }
1821    if let Some(ref token) = configuration.oauth_access_token {
1822        req_builder = req_builder.bearer_auth(token.to_owned());
1823    };
1824    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
1825
1826    let req = req_builder.build()?;
1827    let resp = configuration.client.execute(req).await?;
1828
1829    let status = resp.status();
1830    let content_type = resp
1831        .headers()
1832        .get("content-type")
1833        .and_then(|v| v.to_str().ok())
1834        .unwrap_or("application/octet-stream");
1835    let content_type = super::ContentType::from(content_type);
1836
1837    if !status.is_client_error() && !status.is_server_error() {
1838        let content = resp.text().await?;
1839        match content_type {
1840            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1841            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
1842            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
1843        }
1844    } else {
1845        let content = resp.text().await?;
1846        let entity: Option<OrganizationsOrgIdUsersRemovePostError> =
1847            serde_json::from_str(&content).ok();
1848        Err(Error::ResponseError(ResponseContent {
1849            status,
1850            content,
1851            entity,
1852        }))
1853    }
1854}
1855
1856pub async fn organizations_org_id_users_restore_patch(
1857    configuration: &configuration::Configuration,
1858    org_id: uuid::Uuid,
1859    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1860) -> Result<
1861    models::OrganizationUserBulkResponseModelListResponseModel,
1862    Error<OrganizationsOrgIdUsersRestorePatchError>,
1863> {
1864    // add a prefix to parameters to efficiently prevent name collisions
1865    let p_org_id = org_id;
1866    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1867
1868    let uri_str = format!(
1869        "{}/organizations/{orgId}/users/restore",
1870        configuration.base_path,
1871        orgId = crate::apis::urlencode(p_org_id.to_string())
1872    );
1873    let mut req_builder = configuration
1874        .client
1875        .request(reqwest::Method::PATCH, &uri_str);
1876
1877    if let Some(ref user_agent) = configuration.user_agent {
1878        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1879    }
1880    if let Some(ref token) = configuration.oauth_access_token {
1881        req_builder = req_builder.bearer_auth(token.to_owned());
1882    };
1883    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
1884
1885    let req = req_builder.build()?;
1886    let resp = configuration.client.execute(req).await?;
1887
1888    let status = resp.status();
1889    let content_type = resp
1890        .headers()
1891        .get("content-type")
1892        .and_then(|v| v.to_str().ok())
1893        .unwrap_or("application/octet-stream");
1894    let content_type = super::ContentType::from(content_type);
1895
1896    if !status.is_client_error() && !status.is_server_error() {
1897        let content = resp.text().await?;
1898        match content_type {
1899            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1900            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
1901            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
1902        }
1903    } else {
1904        let content = resp.text().await?;
1905        let entity: Option<OrganizationsOrgIdUsersRestorePatchError> =
1906            serde_json::from_str(&content).ok();
1907        Err(Error::ResponseError(ResponseContent {
1908            status,
1909            content,
1910            entity,
1911        }))
1912    }
1913}
1914
1915pub async fn organizations_org_id_users_restore_put(
1916    configuration: &configuration::Configuration,
1917    org_id: uuid::Uuid,
1918    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1919) -> Result<
1920    models::OrganizationUserBulkResponseModelListResponseModel,
1921    Error<OrganizationsOrgIdUsersRestorePutError>,
1922> {
1923    // add a prefix to parameters to efficiently prevent name collisions
1924    let p_org_id = org_id;
1925    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1926
1927    let uri_str = format!(
1928        "{}/organizations/{orgId}/users/restore",
1929        configuration.base_path,
1930        orgId = crate::apis::urlencode(p_org_id.to_string())
1931    );
1932    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1933
1934    if let Some(ref user_agent) = configuration.user_agent {
1935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1936    }
1937    if let Some(ref token) = configuration.oauth_access_token {
1938        req_builder = req_builder.bearer_auth(token.to_owned());
1939    };
1940    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
1941
1942    let req = req_builder.build()?;
1943    let resp = configuration.client.execute(req).await?;
1944
1945    let status = resp.status();
1946    let content_type = resp
1947        .headers()
1948        .get("content-type")
1949        .and_then(|v| v.to_str().ok())
1950        .unwrap_or("application/octet-stream");
1951    let content_type = super::ContentType::from(content_type);
1952
1953    if !status.is_client_error() && !status.is_server_error() {
1954        let content = resp.text().await?;
1955        match content_type {
1956            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1957            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
1958            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
1959        }
1960    } else {
1961        let content = resp.text().await?;
1962        let entity: Option<OrganizationsOrgIdUsersRestorePutError> =
1963            serde_json::from_str(&content).ok();
1964        Err(Error::ResponseError(ResponseContent {
1965            status,
1966            content,
1967            entity,
1968        }))
1969    }
1970}
1971
1972pub async fn organizations_org_id_users_revoke_patch(
1973    configuration: &configuration::Configuration,
1974    org_id: uuid::Uuid,
1975    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
1976) -> Result<
1977    models::OrganizationUserBulkResponseModelListResponseModel,
1978    Error<OrganizationsOrgIdUsersRevokePatchError>,
1979> {
1980    // add a prefix to parameters to efficiently prevent name collisions
1981    let p_org_id = org_id;
1982    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
1983
1984    let uri_str = format!(
1985        "{}/organizations/{orgId}/users/revoke",
1986        configuration.base_path,
1987        orgId = crate::apis::urlencode(p_org_id.to_string())
1988    );
1989    let mut req_builder = configuration
1990        .client
1991        .request(reqwest::Method::PATCH, &uri_str);
1992
1993    if let Some(ref user_agent) = configuration.user_agent {
1994        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1995    }
1996    if let Some(ref token) = configuration.oauth_access_token {
1997        req_builder = req_builder.bearer_auth(token.to_owned());
1998    };
1999    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
2000
2001    let req = req_builder.build()?;
2002    let resp = configuration.client.execute(req).await?;
2003
2004    let status = resp.status();
2005    let content_type = resp
2006        .headers()
2007        .get("content-type")
2008        .and_then(|v| v.to_str().ok())
2009        .unwrap_or("application/octet-stream");
2010    let content_type = super::ContentType::from(content_type);
2011
2012    if !status.is_client_error() && !status.is_server_error() {
2013        let content = resp.text().await?;
2014        match content_type {
2015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2016            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
2017            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
2018        }
2019    } else {
2020        let content = resp.text().await?;
2021        let entity: Option<OrganizationsOrgIdUsersRevokePatchError> =
2022            serde_json::from_str(&content).ok();
2023        Err(Error::ResponseError(ResponseContent {
2024            status,
2025            content,
2026            entity,
2027        }))
2028    }
2029}
2030
2031pub async fn organizations_org_id_users_revoke_put(
2032    configuration: &configuration::Configuration,
2033    org_id: uuid::Uuid,
2034    organization_user_bulk_request_model: Option<models::OrganizationUserBulkRequestModel>,
2035) -> Result<
2036    models::OrganizationUserBulkResponseModelListResponseModel,
2037    Error<OrganizationsOrgIdUsersRevokePutError>,
2038> {
2039    // add a prefix to parameters to efficiently prevent name collisions
2040    let p_org_id = org_id;
2041    let p_organization_user_bulk_request_model = organization_user_bulk_request_model;
2042
2043    let uri_str = format!(
2044        "{}/organizations/{orgId}/users/revoke",
2045        configuration.base_path,
2046        orgId = crate::apis::urlencode(p_org_id.to_string())
2047    );
2048    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2049
2050    if let Some(ref user_agent) = configuration.user_agent {
2051        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2052    }
2053    if let Some(ref token) = configuration.oauth_access_token {
2054        req_builder = req_builder.bearer_auth(token.to_owned());
2055    };
2056    req_builder = req_builder.json(&p_organization_user_bulk_request_model);
2057
2058    let req = req_builder.build()?;
2059    let resp = configuration.client.execute(req).await?;
2060
2061    let status = resp.status();
2062    let content_type = resp
2063        .headers()
2064        .get("content-type")
2065        .and_then(|v| v.to_str().ok())
2066        .unwrap_or("application/octet-stream");
2067    let content_type = super::ContentType::from(content_type);
2068
2069    if !status.is_client_error() && !status.is_server_error() {
2070        let content = resp.text().await?;
2071        match content_type {
2072            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2073            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`"))),
2074            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationUserBulkResponseModelListResponseModel`")))),
2075        }
2076    } else {
2077        let content = resp.text().await?;
2078        let entity: Option<OrganizationsOrgIdUsersRevokePutError> =
2079            serde_json::from_str(&content).ok();
2080        Err(Error::ResponseError(ResponseContent {
2081            status,
2082            content,
2083            entity,
2084        }))
2085    }
2086}
2087
2088pub async fn organizations_org_id_users_user_id_reset_password_enrollment_put(
2089    configuration: &configuration::Configuration,
2090    org_id: uuid::Uuid,
2091    user_id: uuid::Uuid,
2092    organization_user_reset_password_enrollment_request_model: Option<
2093        models::OrganizationUserResetPasswordEnrollmentRequestModel,
2094    >,
2095) -> Result<(), Error<OrganizationsOrgIdUsersUserIdResetPasswordEnrollmentPutError>> {
2096    // add a prefix to parameters to efficiently prevent name collisions
2097    let p_org_id = org_id;
2098    let p_user_id = user_id;
2099    let p_organization_user_reset_password_enrollment_request_model =
2100        organization_user_reset_password_enrollment_request_model;
2101
2102    let uri_str = format!(
2103        "{}/organizations/{orgId}/users/{userId}/reset-password-enrollment",
2104        configuration.base_path,
2105        orgId = crate::apis::urlencode(p_org_id.to_string()),
2106        userId = crate::apis::urlencode(p_user_id.to_string())
2107    );
2108    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2109
2110    if let Some(ref user_agent) = configuration.user_agent {
2111        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2112    }
2113    if let Some(ref token) = configuration.oauth_access_token {
2114        req_builder = req_builder.bearer_auth(token.to_owned());
2115    };
2116    req_builder = req_builder.json(&p_organization_user_reset_password_enrollment_request_model);
2117
2118    let req = req_builder.build()?;
2119    let resp = configuration.client.execute(req).await?;
2120
2121    let status = resp.status();
2122
2123    if !status.is_client_error() && !status.is_server_error() {
2124        Ok(())
2125    } else {
2126        let content = resp.text().await?;
2127        let entity: Option<OrganizationsOrgIdUsersUserIdResetPasswordEnrollmentPutError> =
2128            serde_json::from_str(&content).ok();
2129        Err(Error::ResponseError(ResponseContent {
2130            status,
2131            content,
2132            entity,
2133        }))
2134    }
2135}