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