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