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