Skip to main content

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}/public-key
76    async fn get_public_key<'a>(
77        &self,
78        id: &'a str,
79    ) -> Result<models::OrganizationPublicKeyResponseModel, Error<GetPublicKeyError>>;
80
81    /// GET /organizations/{id}/sso
82    async fn get_sso<'a>(
83        &self,
84        id: uuid::Uuid,
85    ) -> Result<models::OrganizationSsoResponseModel, Error<GetSsoError>>;
86
87    /// GET /organizations/{id}/subscription
88    async fn get_subscription<'a>(
89        &self,
90        id: uuid::Uuid,
91    ) -> Result<models::OrganizationSubscriptionResponseModel, Error<GetSubscriptionError>>;
92
93    /// GET /organizations
94    async fn get_user(
95        &self,
96    ) -> Result<models::ProfileOrganizationResponseModelListResponseModel, Error<GetUserError>>;
97
98    /// POST /organizations/{id}/leave
99    async fn leave<'a>(&self, id: uuid::Uuid) -> Result<(), Error<LeaveError>>;
100
101    /// POST /organizations
102    async fn post<'a>(
103        &self,
104        organization_create_request_model: Option<models::OrganizationCreateRequestModel>,
105    ) -> Result<models::OrganizationResponseModel, Error<PostError>>;
106
107    /// POST /organizations/{id}/cancel
108    async fn post_cancel<'a>(
109        &self,
110        id: uuid::Uuid,
111        subscription_cancellation_request_model: Option<
112            models::SubscriptionCancellationRequestModel,
113        >,
114    ) -> Result<(), Error<PostCancelError>>;
115
116    /// POST /organizations/{id}/delete-recover-token
117    async fn post_delete_recover_token<'a>(
118        &self,
119        id: uuid::Uuid,
120        organization_verify_delete_recover_request_model: Option<
121            models::OrganizationVerifyDeleteRecoverRequestModel,
122        >,
123    ) -> Result<(), Error<PostDeleteRecoverTokenError>>;
124
125    /// POST /organizations/{id}/keys
126    async fn post_keys<'a>(
127        &self,
128        id: uuid::Uuid,
129        organization_keys_request_model: Option<models::OrganizationKeysRequestModel>,
130    ) -> Result<models::OrganizationKeysResponseModel, Error<PostKeysError>>;
131
132    /// POST /organizations/{id}/reinstate
133    async fn post_reinstate<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PostReinstateError>>;
134
135    /// POST /organizations/{id}/seat
136    async fn post_seat<'a>(
137        &self,
138        id: uuid::Uuid,
139        organization_seat_request_model: Option<models::OrganizationSeatRequestModel>,
140    ) -> Result<models::PaymentResponseModel, Error<PostSeatError>>;
141
142    /// POST /organizations/{id}/sm-subscription
143    async fn post_sm_subscription<'a>(
144        &self,
145        id: uuid::Uuid,
146        secrets_manager_subscription_update_request_model: Option<
147            models::SecretsManagerSubscriptionUpdateRequestModel,
148        >,
149    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSmSubscriptionError>>;
150
151    /// POST /organizations/{id}/sso
152    async fn post_sso<'a>(
153        &self,
154        id: uuid::Uuid,
155        organization_sso_request_model: Option<models::OrganizationSsoRequestModel>,
156    ) -> Result<models::OrganizationSsoResponseModel, Error<PostSsoError>>;
157
158    /// POST /organizations/{id}/storage
159    async fn post_storage<'a>(
160        &self,
161        id: &'a str,
162        storage_request_model: Option<models::StorageRequestModel>,
163    ) -> Result<models::PaymentResponseModel, Error<PostStorageError>>;
164
165    /// POST /organizations/{id}/subscribe-secrets-manager
166    async fn post_subscribe_secrets_manager<'a>(
167        &self,
168        id: uuid::Uuid,
169        secrets_manager_subscribe_request_model: Option<
170            models::SecretsManagerSubscribeRequestModel,
171        >,
172    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSubscribeSecretsManagerError>>;
173
174    /// POST /organizations/{id}/subscription
175    async fn post_subscription<'a>(
176        &self,
177        id: uuid::Uuid,
178        organization_subscription_update_request_model: Option<
179            models::OrganizationSubscriptionUpdateRequestModel,
180        >,
181    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSubscriptionError>>;
182
183    /// POST /organizations/{id}/upgrade
184    async fn post_upgrade<'a>(
185        &self,
186        id: uuid::Uuid,
187        organization_upgrade_request_model: Option<models::OrganizationUpgradeRequestModel>,
188    ) -> Result<models::PaymentResponseModel, Error<PostUpgradeError>>;
189
190    /// PUT /organizations/{organizationId}
191    async fn put<'a>(
192        &self,
193        organization_id: uuid::Uuid,
194        organization_update_request_model: Option<models::OrganizationUpdateRequestModel>,
195    ) -> Result<(), Error<PutError>>;
196
197    /// PUT /organizations/{id}/collection-management
198    async fn put_collection_management<'a>(
199        &self,
200        id: uuid::Uuid,
201        organization_collection_management_update_request_model: Option<
202            models::OrganizationCollectionManagementUpdateRequestModel,
203        >,
204    ) -> Result<models::OrganizationResponseModel, Error<PutCollectionManagementError>>;
205
206    /// POST /organizations/{id}/rotate-api-key
207    async fn rotate_api_key<'a>(
208        &self,
209        id: &'a str,
210        organization_api_key_request_model: Option<models::OrganizationApiKeyRequestModel>,
211    ) -> Result<models::ApiKeyResponseModel, Error<RotateApiKeyError>>;
212}
213
214pub struct OrganizationsApiClient {
215    configuration: Arc<configuration::Configuration>,
216}
217
218impl OrganizationsApiClient {
219    pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
220        Self { configuration }
221    }
222}
223
224#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
225#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
226impl OrganizationsApi for OrganizationsApiClient {
227    async fn api_key<'a>(
228        &self,
229        id: &'a str,
230        organization_api_key_request_model: Option<models::OrganizationApiKeyRequestModel>,
231    ) -> Result<models::ApiKeyResponseModel, Error<ApiKeyError>> {
232        let local_var_configuration = &self.configuration;
233
234        let local_var_client = &local_var_configuration.client;
235
236        let local_var_uri_str = format!(
237            "{}/organizations/{id}/api-key",
238            local_var_configuration.base_path,
239            id = crate::apis::urlencode(id)
240        );
241        let mut local_var_req_builder =
242            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
243
244        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
245        local_var_req_builder = local_var_req_builder.json(&organization_api_key_request_model);
246
247        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
248    }
249
250    async fn api_key_information<'a>(
251        &self,
252        id: uuid::Uuid,
253        r#type: models::OrganizationApiKeyType,
254    ) -> Result<models::OrganizationApiKeyInformationListResponseModel, Error<ApiKeyInformationError>>
255    {
256        let local_var_configuration = &self.configuration;
257
258        let local_var_client = &local_var_configuration.client;
259
260        let local_var_uri_str = format!("{}/organizations/{id}/api-key-information/{type}", local_var_configuration.base_path, id=id, type=r#type.to_string());
261        let mut local_var_req_builder =
262            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
263
264        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
265
266        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
267    }
268
269    async fn create_without_payment<'a>(
270        &self,
271        organization_no_payment_create_request: Option<models::OrganizationNoPaymentCreateRequest>,
272    ) -> Result<models::OrganizationResponseModel, Error<CreateWithoutPaymentError>> {
273        let local_var_configuration = &self.configuration;
274
275        let local_var_client = &local_var_configuration.client;
276
277        let local_var_uri_str = format!(
278            "{}/organizations/create-without-payment",
279            local_var_configuration.base_path
280        );
281        let mut local_var_req_builder =
282            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
283
284        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
285        local_var_req_builder = local_var_req_builder.json(&organization_no_payment_create_request);
286
287        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
288    }
289
290    async fn delete<'a>(
291        &self,
292        id: &'a str,
293        secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
294    ) -> Result<(), Error<DeleteError>> {
295        let local_var_configuration = &self.configuration;
296
297        let local_var_client = &local_var_configuration.client;
298
299        let local_var_uri_str = format!(
300            "{}/organizations/{id}",
301            local_var_configuration.base_path,
302            id = crate::apis::urlencode(id)
303        );
304        let mut local_var_req_builder =
305            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
306
307        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
308        local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model);
309
310        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
311    }
312
313    async fn get<'a>(
314        &self,
315        id: &'a str,
316    ) -> Result<models::OrganizationResponseModel, Error<GetError>> {
317        let local_var_configuration = &self.configuration;
318
319        let local_var_client = &local_var_configuration.client;
320
321        let local_var_uri_str = format!(
322            "{}/organizations/{id}",
323            local_var_configuration.base_path,
324            id = crate::apis::urlencode(id)
325        );
326        let mut local_var_req_builder =
327            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
328
329        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
330
331        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
332    }
333
334    async fn get_auto_enroll_status<'a>(
335        &self,
336        identifier: &'a str,
337    ) -> Result<models::OrganizationAutoEnrollStatusResponseModel, Error<GetAutoEnrollStatusError>>
338    {
339        let local_var_configuration = &self.configuration;
340
341        let local_var_client = &local_var_configuration.client;
342
343        let local_var_uri_str = format!(
344            "{}/organizations/{identifier}/auto-enroll-status",
345            local_var_configuration.base_path,
346            identifier = crate::apis::urlencode(identifier)
347        );
348        let mut local_var_req_builder =
349            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
350
351        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
352
353        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
354    }
355
356    async fn get_license<'a>(
357        &self,
358        id: uuid::Uuid,
359        installation_id: Option<uuid::Uuid>,
360    ) -> Result<models::OrganizationLicense, Error<GetLicenseError>> {
361        let local_var_configuration = &self.configuration;
362
363        let local_var_client = &local_var_configuration.client;
364
365        let local_var_uri_str = format!(
366            "{}/organizations/{id}/license",
367            local_var_configuration.base_path,
368            id = id
369        );
370        let mut local_var_req_builder =
371            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
372
373        if let Some(ref param_value) = installation_id {
374            local_var_req_builder =
375                local_var_req_builder.query(&[("installationId", &param_value.to_string())]);
376        }
377        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
378
379        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
380    }
381
382    async fn get_public_key<'a>(
383        &self,
384        id: &'a str,
385    ) -> Result<models::OrganizationPublicKeyResponseModel, Error<GetPublicKeyError>> {
386        let local_var_configuration = &self.configuration;
387
388        let local_var_client = &local_var_configuration.client;
389
390        let local_var_uri_str = format!(
391            "{}/organizations/{id}/public-key",
392            local_var_configuration.base_path,
393            id = crate::apis::urlencode(id)
394        );
395        let mut local_var_req_builder =
396            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
397
398        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
399
400        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
401    }
402
403    async fn get_sso<'a>(
404        &self,
405        id: uuid::Uuid,
406    ) -> Result<models::OrganizationSsoResponseModel, Error<GetSsoError>> {
407        let local_var_configuration = &self.configuration;
408
409        let local_var_client = &local_var_configuration.client;
410
411        let local_var_uri_str = format!(
412            "{}/organizations/{id}/sso",
413            local_var_configuration.base_path,
414            id = id
415        );
416        let mut local_var_req_builder =
417            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
418
419        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
420
421        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
422    }
423
424    async fn get_subscription<'a>(
425        &self,
426        id: uuid::Uuid,
427    ) -> Result<models::OrganizationSubscriptionResponseModel, Error<GetSubscriptionError>> {
428        let local_var_configuration = &self.configuration;
429
430        let local_var_client = &local_var_configuration.client;
431
432        let local_var_uri_str = format!(
433            "{}/organizations/{id}/subscription",
434            local_var_configuration.base_path,
435            id = id
436        );
437        let mut local_var_req_builder =
438            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
439
440        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
441
442        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
443    }
444
445    async fn get_user(
446        &self,
447    ) -> Result<models::ProfileOrganizationResponseModelListResponseModel, Error<GetUserError>>
448    {
449        let local_var_configuration = &self.configuration;
450
451        let local_var_client = &local_var_configuration.client;
452
453        let local_var_uri_str = format!("{}/organizations", local_var_configuration.base_path);
454        let mut local_var_req_builder =
455            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
456
457        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
458
459        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
460    }
461
462    async fn leave<'a>(&self, id: uuid::Uuid) -> Result<(), Error<LeaveError>> {
463        let local_var_configuration = &self.configuration;
464
465        let local_var_client = &local_var_configuration.client;
466
467        let local_var_uri_str = format!(
468            "{}/organizations/{id}/leave",
469            local_var_configuration.base_path,
470            id = id
471        );
472        let mut local_var_req_builder =
473            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
474
475        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
476
477        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
478    }
479
480    async fn post<'a>(
481        &self,
482        organization_create_request_model: Option<models::OrganizationCreateRequestModel>,
483    ) -> Result<models::OrganizationResponseModel, Error<PostError>> {
484        let local_var_configuration = &self.configuration;
485
486        let local_var_client = &local_var_configuration.client;
487
488        let local_var_uri_str = format!("{}/organizations", local_var_configuration.base_path);
489        let mut local_var_req_builder =
490            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
491
492        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
493        local_var_req_builder = local_var_req_builder.json(&organization_create_request_model);
494
495        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
496    }
497
498    async fn post_cancel<'a>(
499        &self,
500        id: uuid::Uuid,
501        subscription_cancellation_request_model: Option<
502            models::SubscriptionCancellationRequestModel,
503        >,
504    ) -> Result<(), Error<PostCancelError>> {
505        let local_var_configuration = &self.configuration;
506
507        let local_var_client = &local_var_configuration.client;
508
509        let local_var_uri_str = format!(
510            "{}/organizations/{id}/cancel",
511            local_var_configuration.base_path,
512            id = id
513        );
514        let mut local_var_req_builder =
515            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
516
517        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
518        local_var_req_builder =
519            local_var_req_builder.json(&subscription_cancellation_request_model);
520
521        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
522    }
523
524    async fn post_delete_recover_token<'a>(
525        &self,
526        id: uuid::Uuid,
527        organization_verify_delete_recover_request_model: Option<
528            models::OrganizationVerifyDeleteRecoverRequestModel,
529        >,
530    ) -> Result<(), Error<PostDeleteRecoverTokenError>> {
531        let local_var_configuration = &self.configuration;
532
533        let local_var_client = &local_var_configuration.client;
534
535        let local_var_uri_str = format!(
536            "{}/organizations/{id}/delete-recover-token",
537            local_var_configuration.base_path,
538            id = id
539        );
540        let mut local_var_req_builder =
541            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
542
543        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
544        local_var_req_builder =
545            local_var_req_builder.json(&organization_verify_delete_recover_request_model);
546
547        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
548    }
549
550    async fn post_keys<'a>(
551        &self,
552        id: uuid::Uuid,
553        organization_keys_request_model: Option<models::OrganizationKeysRequestModel>,
554    ) -> Result<models::OrganizationKeysResponseModel, Error<PostKeysError>> {
555        let local_var_configuration = &self.configuration;
556
557        let local_var_client = &local_var_configuration.client;
558
559        let local_var_uri_str = format!(
560            "{}/organizations/{id}/keys",
561            local_var_configuration.base_path,
562            id = id
563        );
564        let mut local_var_req_builder =
565            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
566
567        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
568        local_var_req_builder = local_var_req_builder.json(&organization_keys_request_model);
569
570        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
571    }
572
573    async fn post_reinstate<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PostReinstateError>> {
574        let local_var_configuration = &self.configuration;
575
576        let local_var_client = &local_var_configuration.client;
577
578        let local_var_uri_str = format!(
579            "{}/organizations/{id}/reinstate",
580            local_var_configuration.base_path,
581            id = id
582        );
583        let mut local_var_req_builder =
584            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
585
586        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
587
588        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
589    }
590
591    async fn post_seat<'a>(
592        &self,
593        id: uuid::Uuid,
594        organization_seat_request_model: Option<models::OrganizationSeatRequestModel>,
595    ) -> Result<models::PaymentResponseModel, Error<PostSeatError>> {
596        let local_var_configuration = &self.configuration;
597
598        let local_var_client = &local_var_configuration.client;
599
600        let local_var_uri_str = format!(
601            "{}/organizations/{id}/seat",
602            local_var_configuration.base_path,
603            id = id
604        );
605        let mut local_var_req_builder =
606            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
607
608        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
609        local_var_req_builder = local_var_req_builder.json(&organization_seat_request_model);
610
611        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
612    }
613
614    async fn post_sm_subscription<'a>(
615        &self,
616        id: uuid::Uuid,
617        secrets_manager_subscription_update_request_model: Option<
618            models::SecretsManagerSubscriptionUpdateRequestModel,
619        >,
620    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSmSubscriptionError>> {
621        let local_var_configuration = &self.configuration;
622
623        let local_var_client = &local_var_configuration.client;
624
625        let local_var_uri_str = format!(
626            "{}/organizations/{id}/sm-subscription",
627            local_var_configuration.base_path,
628            id = id
629        );
630        let mut local_var_req_builder =
631            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
632
633        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
634        local_var_req_builder =
635            local_var_req_builder.json(&secrets_manager_subscription_update_request_model);
636
637        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
638    }
639
640    async fn post_sso<'a>(
641        &self,
642        id: uuid::Uuid,
643        organization_sso_request_model: Option<models::OrganizationSsoRequestModel>,
644    ) -> Result<models::OrganizationSsoResponseModel, Error<PostSsoError>> {
645        let local_var_configuration = &self.configuration;
646
647        let local_var_client = &local_var_configuration.client;
648
649        let local_var_uri_str = format!(
650            "{}/organizations/{id}/sso",
651            local_var_configuration.base_path,
652            id = id
653        );
654        let mut local_var_req_builder =
655            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
656
657        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
658        local_var_req_builder = local_var_req_builder.json(&organization_sso_request_model);
659
660        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
661    }
662
663    async fn post_storage<'a>(
664        &self,
665        id: &'a str,
666        storage_request_model: Option<models::StorageRequestModel>,
667    ) -> Result<models::PaymentResponseModel, Error<PostStorageError>> {
668        let local_var_configuration = &self.configuration;
669
670        let local_var_client = &local_var_configuration.client;
671
672        let local_var_uri_str = format!(
673            "{}/organizations/{id}/storage",
674            local_var_configuration.base_path,
675            id = crate::apis::urlencode(id)
676        );
677        let mut local_var_req_builder =
678            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
679
680        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
681        local_var_req_builder = local_var_req_builder.json(&storage_request_model);
682
683        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
684    }
685
686    async fn post_subscribe_secrets_manager<'a>(
687        &self,
688        id: uuid::Uuid,
689        secrets_manager_subscribe_request_model: Option<
690            models::SecretsManagerSubscribeRequestModel,
691        >,
692    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSubscribeSecretsManagerError>>
693    {
694        let local_var_configuration = &self.configuration;
695
696        let local_var_client = &local_var_configuration.client;
697
698        let local_var_uri_str = format!(
699            "{}/organizations/{id}/subscribe-secrets-manager",
700            local_var_configuration.base_path,
701            id = id
702        );
703        let mut local_var_req_builder =
704            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
705
706        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
707        local_var_req_builder =
708            local_var_req_builder.json(&secrets_manager_subscribe_request_model);
709
710        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
711    }
712
713    async fn post_subscription<'a>(
714        &self,
715        id: uuid::Uuid,
716        organization_subscription_update_request_model: Option<
717            models::OrganizationSubscriptionUpdateRequestModel,
718        >,
719    ) -> Result<models::ProfileOrganizationResponseModel, Error<PostSubscriptionError>> {
720        let local_var_configuration = &self.configuration;
721
722        let local_var_client = &local_var_configuration.client;
723
724        let local_var_uri_str = format!(
725            "{}/organizations/{id}/subscription",
726            local_var_configuration.base_path,
727            id = id
728        );
729        let mut local_var_req_builder =
730            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
731
732        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
733        local_var_req_builder =
734            local_var_req_builder.json(&organization_subscription_update_request_model);
735
736        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
737    }
738
739    async fn post_upgrade<'a>(
740        &self,
741        id: uuid::Uuid,
742        organization_upgrade_request_model: Option<models::OrganizationUpgradeRequestModel>,
743    ) -> Result<models::PaymentResponseModel, Error<PostUpgradeError>> {
744        let local_var_configuration = &self.configuration;
745
746        let local_var_client = &local_var_configuration.client;
747
748        let local_var_uri_str = format!(
749            "{}/organizations/{id}/upgrade",
750            local_var_configuration.base_path,
751            id = id
752        );
753        let mut local_var_req_builder =
754            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
755
756        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
757        local_var_req_builder = local_var_req_builder.json(&organization_upgrade_request_model);
758
759        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
760    }
761
762    async fn put<'a>(
763        &self,
764        organization_id: uuid::Uuid,
765        organization_update_request_model: Option<models::OrganizationUpdateRequestModel>,
766    ) -> Result<(), Error<PutError>> {
767        let local_var_configuration = &self.configuration;
768
769        let local_var_client = &local_var_configuration.client;
770
771        let local_var_uri_str = format!(
772            "{}/organizations/{organizationId}",
773            local_var_configuration.base_path,
774            organizationId = organization_id
775        );
776        let mut local_var_req_builder =
777            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
778
779        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
780        local_var_req_builder = local_var_req_builder.json(&organization_update_request_model);
781
782        bitwarden_api_base::process_with_empty_response(local_var_req_builder).await
783    }
784
785    async fn put_collection_management<'a>(
786        &self,
787        id: uuid::Uuid,
788        organization_collection_management_update_request_model: Option<
789            models::OrganizationCollectionManagementUpdateRequestModel,
790        >,
791    ) -> Result<models::OrganizationResponseModel, Error<PutCollectionManagementError>> {
792        let local_var_configuration = &self.configuration;
793
794        let local_var_client = &local_var_configuration.client;
795
796        let local_var_uri_str = format!(
797            "{}/organizations/{id}/collection-management",
798            local_var_configuration.base_path,
799            id = id
800        );
801        let mut local_var_req_builder =
802            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
803
804        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
805        local_var_req_builder =
806            local_var_req_builder.json(&organization_collection_management_update_request_model);
807
808        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
809    }
810
811    async fn rotate_api_key<'a>(
812        &self,
813        id: &'a str,
814        organization_api_key_request_model: Option<models::OrganizationApiKeyRequestModel>,
815    ) -> Result<models::ApiKeyResponseModel, Error<RotateApiKeyError>> {
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}/rotate-api-key",
822            local_var_configuration.base_path,
823            id = crate::apis::urlencode(id)
824        );
825        let mut local_var_req_builder =
826            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
827
828        local_var_req_builder = local_var_req_builder.with_extension(AuthRequired::Bearer);
829        local_var_req_builder = local_var_req_builder.json(&organization_api_key_request_model);
830
831        bitwarden_api_base::process_with_json_response(local_var_req_builder).await
832    }
833}
834
835/// struct for typed errors of method [`OrganizationsApi::api_key`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum ApiKeyError {
839    UnknownValue(serde_json::Value),
840}
841/// struct for typed errors of method [`OrganizationsApi::api_key_information`]
842#[derive(Debug, Clone, Serialize, Deserialize)]
843#[serde(untagged)]
844pub enum ApiKeyInformationError {
845    UnknownValue(serde_json::Value),
846}
847/// struct for typed errors of method [`OrganizationsApi::create_without_payment`]
848#[derive(Debug, Clone, Serialize, Deserialize)]
849#[serde(untagged)]
850pub enum CreateWithoutPaymentError {
851    UnknownValue(serde_json::Value),
852}
853/// struct for typed errors of method [`OrganizationsApi::delete`]
854#[derive(Debug, Clone, Serialize, Deserialize)]
855#[serde(untagged)]
856pub enum DeleteError {
857    UnknownValue(serde_json::Value),
858}
859/// struct for typed errors of method [`OrganizationsApi::get`]
860#[derive(Debug, Clone, Serialize, Deserialize)]
861#[serde(untagged)]
862pub enum GetError {
863    UnknownValue(serde_json::Value),
864}
865/// struct for typed errors of method [`OrganizationsApi::get_auto_enroll_status`]
866#[derive(Debug, Clone, Serialize, Deserialize)]
867#[serde(untagged)]
868pub enum GetAutoEnrollStatusError {
869    UnknownValue(serde_json::Value),
870}
871/// struct for typed errors of method [`OrganizationsApi::get_license`]
872#[derive(Debug, Clone, Serialize, Deserialize)]
873#[serde(untagged)]
874pub enum GetLicenseError {
875    UnknownValue(serde_json::Value),
876}
877/// struct for typed errors of method [`OrganizationsApi::get_public_key`]
878#[derive(Debug, Clone, Serialize, Deserialize)]
879#[serde(untagged)]
880pub enum GetPublicKeyError {
881    UnknownValue(serde_json::Value),
882}
883/// struct for typed errors of method [`OrganizationsApi::get_sso`]
884#[derive(Debug, Clone, Serialize, Deserialize)]
885#[serde(untagged)]
886pub enum GetSsoError {
887    UnknownValue(serde_json::Value),
888}
889/// struct for typed errors of method [`OrganizationsApi::get_subscription`]
890#[derive(Debug, Clone, Serialize, Deserialize)]
891#[serde(untagged)]
892pub enum GetSubscriptionError {
893    UnknownValue(serde_json::Value),
894}
895/// struct for typed errors of method [`OrganizationsApi::get_user`]
896#[derive(Debug, Clone, Serialize, Deserialize)]
897#[serde(untagged)]
898pub enum GetUserError {
899    UnknownValue(serde_json::Value),
900}
901/// struct for typed errors of method [`OrganizationsApi::leave`]
902#[derive(Debug, Clone, Serialize, Deserialize)]
903#[serde(untagged)]
904pub enum LeaveError {
905    UnknownValue(serde_json::Value),
906}
907/// struct for typed errors of method [`OrganizationsApi::post`]
908#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum PostError {
911    UnknownValue(serde_json::Value),
912}
913/// struct for typed errors of method [`OrganizationsApi::post_cancel`]
914#[derive(Debug, Clone, Serialize, Deserialize)]
915#[serde(untagged)]
916pub enum PostCancelError {
917    UnknownValue(serde_json::Value),
918}
919/// struct for typed errors of method [`OrganizationsApi::post_delete_recover_token`]
920#[derive(Debug, Clone, Serialize, Deserialize)]
921#[serde(untagged)]
922pub enum PostDeleteRecoverTokenError {
923    UnknownValue(serde_json::Value),
924}
925/// struct for typed errors of method [`OrganizationsApi::post_keys`]
926#[derive(Debug, Clone, Serialize, Deserialize)]
927#[serde(untagged)]
928pub enum PostKeysError {
929    UnknownValue(serde_json::Value),
930}
931/// struct for typed errors of method [`OrganizationsApi::post_reinstate`]
932#[derive(Debug, Clone, Serialize, Deserialize)]
933#[serde(untagged)]
934pub enum PostReinstateError {
935    UnknownValue(serde_json::Value),
936}
937/// struct for typed errors of method [`OrganizationsApi::post_seat`]
938#[derive(Debug, Clone, Serialize, Deserialize)]
939#[serde(untagged)]
940pub enum PostSeatError {
941    UnknownValue(serde_json::Value),
942}
943/// struct for typed errors of method [`OrganizationsApi::post_sm_subscription`]
944#[derive(Debug, Clone, Serialize, Deserialize)]
945#[serde(untagged)]
946pub enum PostSmSubscriptionError {
947    UnknownValue(serde_json::Value),
948}
949/// struct for typed errors of method [`OrganizationsApi::post_sso`]
950#[derive(Debug, Clone, Serialize, Deserialize)]
951#[serde(untagged)]
952pub enum PostSsoError {
953    UnknownValue(serde_json::Value),
954}
955/// struct for typed errors of method [`OrganizationsApi::post_storage`]
956#[derive(Debug, Clone, Serialize, Deserialize)]
957#[serde(untagged)]
958pub enum PostStorageError {
959    UnknownValue(serde_json::Value),
960}
961/// struct for typed errors of method [`OrganizationsApi::post_subscribe_secrets_manager`]
962#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(untagged)]
964pub enum PostSubscribeSecretsManagerError {
965    UnknownValue(serde_json::Value),
966}
967/// struct for typed errors of method [`OrganizationsApi::post_subscription`]
968#[derive(Debug, Clone, Serialize, Deserialize)]
969#[serde(untagged)]
970pub enum PostSubscriptionError {
971    UnknownValue(serde_json::Value),
972}
973/// struct for typed errors of method [`OrganizationsApi::post_upgrade`]
974#[derive(Debug, Clone, Serialize, Deserialize)]
975#[serde(untagged)]
976pub enum PostUpgradeError {
977    UnknownValue(serde_json::Value),
978}
979/// struct for typed errors of method [`OrganizationsApi::put`]
980#[derive(Debug, Clone, Serialize, Deserialize)]
981#[serde(untagged)]
982pub enum PutError {
983    UnknownValue(serde_json::Value),
984}
985/// struct for typed errors of method [`OrganizationsApi::put_collection_management`]
986#[derive(Debug, Clone, Serialize, Deserialize)]
987#[serde(untagged)]
988pub enum PutCollectionManagementError {
989    UnknownValue(serde_json::Value),
990}
991/// struct for typed errors of method [`OrganizationsApi::rotate_api_key`]
992#[derive(Debug, Clone, Serialize, Deserialize)]
993#[serde(untagged)]
994pub enum RotateApiKeyError {
995    UnknownValue(serde_json::Value),
996}