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