bitwarden_api_api/apis/
groups_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::{Deserialize, Serialize};
13
14use super::{configuration, Error};
15use crate::{apis::ResponseContent, models};
16
17/// struct for typed errors of method [`organizations_org_id_groups_delete`]
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum OrganizationsOrgIdGroupsDeleteError {
21    UnknownValue(serde_json::Value),
22}
23
24/// struct for typed errors of method [`organizations_org_id_groups_delete_post`]
25#[derive(Debug, Clone, Serialize, Deserialize)]
26#[serde(untagged)]
27pub enum OrganizationsOrgIdGroupsDeletePostError {
28    UnknownValue(serde_json::Value),
29}
30
31/// struct for typed errors of method [`organizations_org_id_groups_details_get`]
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(untagged)]
34pub enum OrganizationsOrgIdGroupsDetailsGetError {
35    UnknownValue(serde_json::Value),
36}
37
38/// struct for typed errors of method [`organizations_org_id_groups_get`]
39#[derive(Debug, Clone, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum OrganizationsOrgIdGroupsGetError {
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`organizations_org_id_groups_id_delete`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum OrganizationsOrgIdGroupsIdDeleteError {
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`organizations_org_id_groups_id_delete_post`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum OrganizationsOrgIdGroupsIdDeletePostError {
56    UnknownValue(serde_json::Value),
57}
58
59/// struct for typed errors of method
60/// [`organizations_org_id_groups_id_delete_user_org_user_id_post`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum OrganizationsOrgIdGroupsIdDeleteUserOrgUserIdPostError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`organizations_org_id_groups_id_details_get`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum OrganizationsOrgIdGroupsIdDetailsGetError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`organizations_org_id_groups_id_get`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum OrganizationsOrgIdGroupsIdGetError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`organizations_org_id_groups_id_post`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum OrganizationsOrgIdGroupsIdPostError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`organizations_org_id_groups_id_put`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum OrganizationsOrgIdGroupsIdPutError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`organizations_org_id_groups_id_user_org_user_id_delete`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum OrganizationsOrgIdGroupsIdUserOrgUserIdDeleteError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`organizations_org_id_groups_id_users_get`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum OrganizationsOrgIdGroupsIdUsersGetError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`organizations_org_id_groups_post`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum OrganizationsOrgIdGroupsPostError {
113    UnknownValue(serde_json::Value),
114}
115
116pub async fn organizations_org_id_groups_delete(
117    configuration: &configuration::Configuration,
118    org_id: &str,
119    group_bulk_request_model: Option<models::GroupBulkRequestModel>,
120) -> Result<(), Error<OrganizationsOrgIdGroupsDeleteError>> {
121    let local_var_configuration = configuration;
122
123    let local_var_client = &local_var_configuration.client;
124
125    let local_var_uri_str = format!(
126        "{}/organizations/{orgId}/groups",
127        local_var_configuration.base_path,
128        orgId = crate::apis::urlencode(org_id)
129    );
130    let mut local_var_req_builder =
131        local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
132
133    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
134        local_var_req_builder =
135            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
136    }
137    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
138        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
139    };
140    local_var_req_builder = local_var_req_builder.json(&group_bulk_request_model);
141
142    let local_var_req = local_var_req_builder.build()?;
143    let local_var_resp = local_var_client.execute(local_var_req).await?;
144
145    let local_var_status = local_var_resp.status();
146    let local_var_content = local_var_resp.text().await?;
147
148    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
149        Ok(())
150    } else {
151        let local_var_entity: Option<OrganizationsOrgIdGroupsDeleteError> =
152            serde_json::from_str(&local_var_content).ok();
153        let local_var_error = ResponseContent {
154            status: local_var_status,
155            content: local_var_content,
156            entity: local_var_entity,
157        };
158        Err(Error::ResponseError(local_var_error))
159    }
160}
161
162pub async fn organizations_org_id_groups_delete_post(
163    configuration: &configuration::Configuration,
164    org_id: &str,
165    group_bulk_request_model: Option<models::GroupBulkRequestModel>,
166) -> Result<(), Error<OrganizationsOrgIdGroupsDeletePostError>> {
167    let local_var_configuration = configuration;
168
169    let local_var_client = &local_var_configuration.client;
170
171    let local_var_uri_str = format!(
172        "{}/organizations/{orgId}/groups/delete",
173        local_var_configuration.base_path,
174        orgId = crate::apis::urlencode(org_id)
175    );
176    let mut local_var_req_builder =
177        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
178
179    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
180        local_var_req_builder =
181            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
182    }
183    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
184        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
185    };
186    local_var_req_builder = local_var_req_builder.json(&group_bulk_request_model);
187
188    let local_var_req = local_var_req_builder.build()?;
189    let local_var_resp = local_var_client.execute(local_var_req).await?;
190
191    let local_var_status = local_var_resp.status();
192    let local_var_content = local_var_resp.text().await?;
193
194    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
195        Ok(())
196    } else {
197        let local_var_entity: Option<OrganizationsOrgIdGroupsDeletePostError> =
198            serde_json::from_str(&local_var_content).ok();
199        let local_var_error = ResponseContent {
200            status: local_var_status,
201            content: local_var_content,
202            entity: local_var_entity,
203        };
204        Err(Error::ResponseError(local_var_error))
205    }
206}
207
208pub async fn organizations_org_id_groups_details_get(
209    configuration: &configuration::Configuration,
210    org_id: uuid::Uuid,
211) -> Result<
212    models::GroupDetailsResponseModelListResponseModel,
213    Error<OrganizationsOrgIdGroupsDetailsGetError>,
214> {
215    let local_var_configuration = configuration;
216
217    let local_var_client = &local_var_configuration.client;
218
219    let local_var_uri_str = format!(
220        "{}/organizations/{orgId}/groups/details",
221        local_var_configuration.base_path,
222        orgId = crate::apis::urlencode(org_id.to_string())
223    );
224    let mut local_var_req_builder =
225        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
226
227    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
228        local_var_req_builder =
229            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
230    }
231    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
232        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
233    };
234
235    let local_var_req = local_var_req_builder.build()?;
236    let local_var_resp = local_var_client.execute(local_var_req).await?;
237
238    let local_var_status = local_var_resp.status();
239    let local_var_content = local_var_resp.text().await?;
240
241    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
242        serde_json::from_str(&local_var_content).map_err(Error::from)
243    } else {
244        let local_var_entity: Option<OrganizationsOrgIdGroupsDetailsGetError> =
245            serde_json::from_str(&local_var_content).ok();
246        let local_var_error = ResponseContent {
247            status: local_var_status,
248            content: local_var_content,
249            entity: local_var_entity,
250        };
251        Err(Error::ResponseError(local_var_error))
252    }
253}
254
255pub async fn organizations_org_id_groups_get(
256    configuration: &configuration::Configuration,
257    org_id: uuid::Uuid,
258) -> Result<models::GroupResponseModelListResponseModel, Error<OrganizationsOrgIdGroupsGetError>> {
259    let local_var_configuration = configuration;
260
261    let local_var_client = &local_var_configuration.client;
262
263    let local_var_uri_str = format!(
264        "{}/organizations/{orgId}/groups",
265        local_var_configuration.base_path,
266        orgId = crate::apis::urlencode(org_id.to_string())
267    );
268    let mut local_var_req_builder =
269        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
270
271    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
272        local_var_req_builder =
273            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
274    }
275    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
276        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
277    };
278
279    let local_var_req = local_var_req_builder.build()?;
280    let local_var_resp = local_var_client.execute(local_var_req).await?;
281
282    let local_var_status = local_var_resp.status();
283    let local_var_content = local_var_resp.text().await?;
284
285    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
286        serde_json::from_str(&local_var_content).map_err(Error::from)
287    } else {
288        let local_var_entity: Option<OrganizationsOrgIdGroupsGetError> =
289            serde_json::from_str(&local_var_content).ok();
290        let local_var_error = ResponseContent {
291            status: local_var_status,
292            content: local_var_content,
293            entity: local_var_entity,
294        };
295        Err(Error::ResponseError(local_var_error))
296    }
297}
298
299pub async fn organizations_org_id_groups_id_delete(
300    configuration: &configuration::Configuration,
301    org_id: &str,
302    id: &str,
303) -> Result<(), Error<OrganizationsOrgIdGroupsIdDeleteError>> {
304    let local_var_configuration = configuration;
305
306    let local_var_client = &local_var_configuration.client;
307
308    let local_var_uri_str = format!(
309        "{}/organizations/{orgId}/groups/{id}",
310        local_var_configuration.base_path,
311        orgId = crate::apis::urlencode(org_id),
312        id = crate::apis::urlencode(id)
313    );
314    let mut local_var_req_builder =
315        local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
316
317    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
318        local_var_req_builder =
319            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
320    }
321    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
322        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
323    };
324
325    let local_var_req = local_var_req_builder.build()?;
326    let local_var_resp = local_var_client.execute(local_var_req).await?;
327
328    let local_var_status = local_var_resp.status();
329    let local_var_content = local_var_resp.text().await?;
330
331    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
332        Ok(())
333    } else {
334        let local_var_entity: Option<OrganizationsOrgIdGroupsIdDeleteError> =
335            serde_json::from_str(&local_var_content).ok();
336        let local_var_error = ResponseContent {
337            status: local_var_status,
338            content: local_var_content,
339            entity: local_var_entity,
340        };
341        Err(Error::ResponseError(local_var_error))
342    }
343}
344
345pub async fn organizations_org_id_groups_id_delete_post(
346    configuration: &configuration::Configuration,
347    org_id: &str,
348    id: &str,
349) -> Result<(), Error<OrganizationsOrgIdGroupsIdDeletePostError>> {
350    let local_var_configuration = configuration;
351
352    let local_var_client = &local_var_configuration.client;
353
354    let local_var_uri_str = format!(
355        "{}/organizations/{orgId}/groups/{id}/delete",
356        local_var_configuration.base_path,
357        orgId = crate::apis::urlencode(org_id),
358        id = crate::apis::urlencode(id)
359    );
360    let mut local_var_req_builder =
361        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
362
363    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
364        local_var_req_builder =
365            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
366    }
367    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
368        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
369    };
370
371    let local_var_req = local_var_req_builder.build()?;
372    let local_var_resp = local_var_client.execute(local_var_req).await?;
373
374    let local_var_status = local_var_resp.status();
375    let local_var_content = local_var_resp.text().await?;
376
377    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
378        Ok(())
379    } else {
380        let local_var_entity: Option<OrganizationsOrgIdGroupsIdDeletePostError> =
381            serde_json::from_str(&local_var_content).ok();
382        let local_var_error = ResponseContent {
383            status: local_var_status,
384            content: local_var_content,
385            entity: local_var_entity,
386        };
387        Err(Error::ResponseError(local_var_error))
388    }
389}
390
391pub async fn organizations_org_id_groups_id_delete_user_org_user_id_post(
392    configuration: &configuration::Configuration,
393    org_id: &str,
394    id: &str,
395    org_user_id: &str,
396) -> Result<(), Error<OrganizationsOrgIdGroupsIdDeleteUserOrgUserIdPostError>> {
397    let local_var_configuration = configuration;
398
399    let local_var_client = &local_var_configuration.client;
400
401    let local_var_uri_str = format!(
402        "{}/organizations/{orgId}/groups/{id}/delete-user/{orgUserId}",
403        local_var_configuration.base_path,
404        orgId = crate::apis::urlencode(org_id),
405        id = crate::apis::urlencode(id),
406        orgUserId = crate::apis::urlencode(org_user_id)
407    );
408    let mut local_var_req_builder =
409        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
410
411    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
412        local_var_req_builder =
413            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
414    }
415    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
416        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
417    };
418
419    let local_var_req = local_var_req_builder.build()?;
420    let local_var_resp = local_var_client.execute(local_var_req).await?;
421
422    let local_var_status = local_var_resp.status();
423    let local_var_content = local_var_resp.text().await?;
424
425    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
426        Ok(())
427    } else {
428        let local_var_entity: Option<OrganizationsOrgIdGroupsIdDeleteUserOrgUserIdPostError> =
429            serde_json::from_str(&local_var_content).ok();
430        let local_var_error = ResponseContent {
431            status: local_var_status,
432            content: local_var_content,
433            entity: local_var_entity,
434        };
435        Err(Error::ResponseError(local_var_error))
436    }
437}
438
439pub async fn organizations_org_id_groups_id_details_get(
440    configuration: &configuration::Configuration,
441    org_id: &str,
442    id: &str,
443) -> Result<models::GroupDetailsResponseModel, Error<OrganizationsOrgIdGroupsIdDetailsGetError>> {
444    let local_var_configuration = configuration;
445
446    let local_var_client = &local_var_configuration.client;
447
448    let local_var_uri_str = format!(
449        "{}/organizations/{orgId}/groups/{id}/details",
450        local_var_configuration.base_path,
451        orgId = crate::apis::urlencode(org_id),
452        id = crate::apis::urlencode(id)
453    );
454    let mut local_var_req_builder =
455        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
456
457    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
458        local_var_req_builder =
459            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
460    }
461    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
462        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
463    };
464
465    let local_var_req = local_var_req_builder.build()?;
466    let local_var_resp = local_var_client.execute(local_var_req).await?;
467
468    let local_var_status = local_var_resp.status();
469    let local_var_content = local_var_resp.text().await?;
470
471    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
472        serde_json::from_str(&local_var_content).map_err(Error::from)
473    } else {
474        let local_var_entity: Option<OrganizationsOrgIdGroupsIdDetailsGetError> =
475            serde_json::from_str(&local_var_content).ok();
476        let local_var_error = ResponseContent {
477            status: local_var_status,
478            content: local_var_content,
479            entity: local_var_entity,
480        };
481        Err(Error::ResponseError(local_var_error))
482    }
483}
484
485pub async fn organizations_org_id_groups_id_get(
486    configuration: &configuration::Configuration,
487    org_id: &str,
488    id: &str,
489) -> Result<models::GroupResponseModel, Error<OrganizationsOrgIdGroupsIdGetError>> {
490    let local_var_configuration = configuration;
491
492    let local_var_client = &local_var_configuration.client;
493
494    let local_var_uri_str = format!(
495        "{}/organizations/{orgId}/groups/{id}",
496        local_var_configuration.base_path,
497        orgId = crate::apis::urlencode(org_id),
498        id = crate::apis::urlencode(id)
499    );
500    let mut local_var_req_builder =
501        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
502
503    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
504        local_var_req_builder =
505            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
506    }
507    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
508        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
509    };
510
511    let local_var_req = local_var_req_builder.build()?;
512    let local_var_resp = local_var_client.execute(local_var_req).await?;
513
514    let local_var_status = local_var_resp.status();
515    let local_var_content = local_var_resp.text().await?;
516
517    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
518        serde_json::from_str(&local_var_content).map_err(Error::from)
519    } else {
520        let local_var_entity: Option<OrganizationsOrgIdGroupsIdGetError> =
521            serde_json::from_str(&local_var_content).ok();
522        let local_var_error = ResponseContent {
523            status: local_var_status,
524            content: local_var_content,
525            entity: local_var_entity,
526        };
527        Err(Error::ResponseError(local_var_error))
528    }
529}
530
531pub async fn organizations_org_id_groups_id_post(
532    configuration: &configuration::Configuration,
533    org_id: uuid::Uuid,
534    id: uuid::Uuid,
535    group_request_model: Option<models::GroupRequestModel>,
536) -> Result<models::GroupResponseModel, Error<OrganizationsOrgIdGroupsIdPostError>> {
537    let local_var_configuration = configuration;
538
539    let local_var_client = &local_var_configuration.client;
540
541    let local_var_uri_str = format!(
542        "{}/organizations/{orgId}/groups/{id}",
543        local_var_configuration.base_path,
544        orgId = crate::apis::urlencode(org_id.to_string()),
545        id = crate::apis::urlencode(id.to_string())
546    );
547    let mut local_var_req_builder =
548        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
549
550    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
551        local_var_req_builder =
552            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
553    }
554    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
555        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
556    };
557    local_var_req_builder = local_var_req_builder.json(&group_request_model);
558
559    let local_var_req = local_var_req_builder.build()?;
560    let local_var_resp = local_var_client.execute(local_var_req).await?;
561
562    let local_var_status = local_var_resp.status();
563    let local_var_content = local_var_resp.text().await?;
564
565    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
566        serde_json::from_str(&local_var_content).map_err(Error::from)
567    } else {
568        let local_var_entity: Option<OrganizationsOrgIdGroupsIdPostError> =
569            serde_json::from_str(&local_var_content).ok();
570        let local_var_error = ResponseContent {
571            status: local_var_status,
572            content: local_var_content,
573            entity: local_var_entity,
574        };
575        Err(Error::ResponseError(local_var_error))
576    }
577}
578
579pub async fn organizations_org_id_groups_id_put(
580    configuration: &configuration::Configuration,
581    org_id: uuid::Uuid,
582    id: uuid::Uuid,
583    group_request_model: Option<models::GroupRequestModel>,
584) -> Result<models::GroupResponseModel, Error<OrganizationsOrgIdGroupsIdPutError>> {
585    let local_var_configuration = configuration;
586
587    let local_var_client = &local_var_configuration.client;
588
589    let local_var_uri_str = format!(
590        "{}/organizations/{orgId}/groups/{id}",
591        local_var_configuration.base_path,
592        orgId = crate::apis::urlencode(org_id.to_string()),
593        id = crate::apis::urlencode(id.to_string())
594    );
595    let mut local_var_req_builder =
596        local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
597
598    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
599        local_var_req_builder =
600            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
601    }
602    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
603        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
604    };
605    local_var_req_builder = local_var_req_builder.json(&group_request_model);
606
607    let local_var_req = local_var_req_builder.build()?;
608    let local_var_resp = local_var_client.execute(local_var_req).await?;
609
610    let local_var_status = local_var_resp.status();
611    let local_var_content = local_var_resp.text().await?;
612
613    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
614        serde_json::from_str(&local_var_content).map_err(Error::from)
615    } else {
616        let local_var_entity: Option<OrganizationsOrgIdGroupsIdPutError> =
617            serde_json::from_str(&local_var_content).ok();
618        let local_var_error = ResponseContent {
619            status: local_var_status,
620            content: local_var_content,
621            entity: local_var_entity,
622        };
623        Err(Error::ResponseError(local_var_error))
624    }
625}
626
627pub async fn organizations_org_id_groups_id_user_org_user_id_delete(
628    configuration: &configuration::Configuration,
629    org_id: &str,
630    id: &str,
631    org_user_id: &str,
632) -> Result<(), Error<OrganizationsOrgIdGroupsIdUserOrgUserIdDeleteError>> {
633    let local_var_configuration = configuration;
634
635    let local_var_client = &local_var_configuration.client;
636
637    let local_var_uri_str = format!(
638        "{}/organizations/{orgId}/groups/{id}/user/{orgUserId}",
639        local_var_configuration.base_path,
640        orgId = crate::apis::urlencode(org_id),
641        id = crate::apis::urlencode(id),
642        orgUserId = crate::apis::urlencode(org_user_id)
643    );
644    let mut local_var_req_builder =
645        local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
646
647    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
648        local_var_req_builder =
649            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
650    }
651    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
652        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
653    };
654
655    let local_var_req = local_var_req_builder.build()?;
656    let local_var_resp = local_var_client.execute(local_var_req).await?;
657
658    let local_var_status = local_var_resp.status();
659    let local_var_content = local_var_resp.text().await?;
660
661    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
662        Ok(())
663    } else {
664        let local_var_entity: Option<OrganizationsOrgIdGroupsIdUserOrgUserIdDeleteError> =
665            serde_json::from_str(&local_var_content).ok();
666        let local_var_error = ResponseContent {
667            status: local_var_status,
668            content: local_var_content,
669            entity: local_var_entity,
670        };
671        Err(Error::ResponseError(local_var_error))
672    }
673}
674
675pub async fn organizations_org_id_groups_id_users_get(
676    configuration: &configuration::Configuration,
677    org_id: &str,
678    id: &str,
679) -> Result<Vec<uuid::Uuid>, Error<OrganizationsOrgIdGroupsIdUsersGetError>> {
680    let local_var_configuration = configuration;
681
682    let local_var_client = &local_var_configuration.client;
683
684    let local_var_uri_str = format!(
685        "{}/organizations/{orgId}/groups/{id}/users",
686        local_var_configuration.base_path,
687        orgId = crate::apis::urlencode(org_id),
688        id = crate::apis::urlencode(id)
689    );
690    let mut local_var_req_builder =
691        local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
692
693    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
694        local_var_req_builder =
695            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
696    }
697    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
698        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
699    };
700
701    let local_var_req = local_var_req_builder.build()?;
702    let local_var_resp = local_var_client.execute(local_var_req).await?;
703
704    let local_var_status = local_var_resp.status();
705    let local_var_content = local_var_resp.text().await?;
706
707    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
708        serde_json::from_str(&local_var_content).map_err(Error::from)
709    } else {
710        let local_var_entity: Option<OrganizationsOrgIdGroupsIdUsersGetError> =
711            serde_json::from_str(&local_var_content).ok();
712        let local_var_error = ResponseContent {
713            status: local_var_status,
714            content: local_var_content,
715            entity: local_var_entity,
716        };
717        Err(Error::ResponseError(local_var_error))
718    }
719}
720
721pub async fn organizations_org_id_groups_post(
722    configuration: &configuration::Configuration,
723    org_id: uuid::Uuid,
724    group_request_model: Option<models::GroupRequestModel>,
725) -> Result<models::GroupResponseModel, Error<OrganizationsOrgIdGroupsPostError>> {
726    let local_var_configuration = configuration;
727
728    let local_var_client = &local_var_configuration.client;
729
730    let local_var_uri_str = format!(
731        "{}/organizations/{orgId}/groups",
732        local_var_configuration.base_path,
733        orgId = crate::apis::urlencode(org_id.to_string())
734    );
735    let mut local_var_req_builder =
736        local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
737
738    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
739        local_var_req_builder =
740            local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
741    }
742    if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
743        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
744    };
745    local_var_req_builder = local_var_req_builder.json(&group_request_model);
746
747    let local_var_req = local_var_req_builder.build()?;
748    let local_var_resp = local_var_client.execute(local_var_req).await?;
749
750    let local_var_status = local_var_resp.status();
751    let local_var_content = local_var_resp.text().await?;
752
753    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
754        serde_json::from_str(&local_var_content).map_err(Error::from)
755    } else {
756        let local_var_entity: Option<OrganizationsOrgIdGroupsPostError> =
757            serde_json::from_str(&local_var_content).ok();
758        let local_var_error = ResponseContent {
759            status: local_var_status,
760            content: local_var_content,
761            entity: local_var_entity,
762        };
763        Err(Error::ResponseError(local_var_error))
764    }
765}