bitwarden_api_api/apis/
ciphers_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::{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 CiphersApi: Send + Sync {
29    /// POST /ciphers/attachment/validate/azure
30    async fn azure_validate_file(&self) -> Result<(), Error<AzureValidateFileError>>;
31
32    /// DELETE /ciphers/{id}
33    async fn delete<'a>(&self, id: uuid::Uuid) -> Result<(), Error<DeleteError>>;
34
35    /// DELETE /ciphers/{id}/admin
36    async fn delete_admin<'a>(&self, id: uuid::Uuid) -> Result<(), Error<DeleteAdminError>>;
37
38    /// DELETE /ciphers/{id}/attachment/{attachmentId}
39    async fn delete_attachment<'a>(
40        &self,
41        id: uuid::Uuid,
42        attachment_id: &'a str,
43    ) -> Result<models::DeleteAttachmentResponseData, Error<DeleteAttachmentError>>;
44
45    /// DELETE /ciphers/{id}/attachment/{attachmentId}/admin
46    async fn delete_attachment_admin<'a>(
47        &self,
48        id: uuid::Uuid,
49        attachment_id: &'a str,
50    ) -> Result<models::DeleteAttachmentResponseData, Error<DeleteAttachmentAdminError>>;
51
52    /// DELETE /ciphers
53    async fn delete_many<'a>(
54        &self,
55        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
56    ) -> Result<(), Error<DeleteManyError>>;
57
58    /// DELETE /ciphers/admin
59    async fn delete_many_admin<'a>(
60        &self,
61        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
62    ) -> Result<(), Error<DeleteManyAdminError>>;
63
64    /// GET /ciphers/{id}
65    async fn get<'a>(&self, id: uuid::Uuid)
66    -> Result<models::CipherResponseModel, Error<GetError>>;
67
68    /// GET /ciphers/{id}/admin
69    async fn get_admin<'a>(
70        &self,
71        id: &'a str,
72    ) -> Result<models::CipherMiniResponseModel, Error<GetAdminError>>;
73
74    /// GET /ciphers
75    async fn get_all(
76        &self,
77    ) -> Result<models::CipherDetailsResponseModelListResponseModel, Error<GetAllError>>;
78
79    /// GET /ciphers/organization-details/assigned
80    async fn get_assigned_organization_ciphers<'a>(
81        &self,
82        organization_id: Option<uuid::Uuid>,
83    ) -> Result<
84        models::CipherDetailsResponseModelListResponseModel,
85        Error<GetAssignedOrganizationCiphersError>,
86    >;
87
88    /// GET /ciphers/{id}/attachment/{attachmentId}
89    async fn get_attachment_data<'a>(
90        &self,
91        id: uuid::Uuid,
92        attachment_id: &'a str,
93    ) -> Result<models::AttachmentResponseModel, Error<GetAttachmentDataError>>;
94
95    /// GET /ciphers/{id}/attachment/{attachmentId}/admin
96    async fn get_attachment_data_admin<'a>(
97        &self,
98        id: uuid::Uuid,
99        attachment_id: &'a str,
100    ) -> Result<models::AttachmentResponseModel, Error<GetAttachmentDataAdminError>>;
101
102    /// GET /ciphers/{id}/details
103    async fn get_details<'a>(
104        &self,
105        id: uuid::Uuid,
106    ) -> Result<models::CipherDetailsResponseModel, Error<GetDetailsError>>;
107
108    /// GET /ciphers/organization-details
109    async fn get_organization_ciphers<'a>(
110        &self,
111        organization_id: Option<uuid::Uuid>,
112    ) -> Result<
113        models::CipherMiniDetailsResponseModelListResponseModel,
114        Error<GetOrganizationCiphersError>,
115    >;
116
117    /// PUT /ciphers/move
118    async fn move_many<'a>(
119        &self,
120        cipher_bulk_move_request_model: Option<models::CipherBulkMoveRequestModel>,
121    ) -> Result<(), Error<MoveManyError>>;
122
123    /// POST /ciphers
124    async fn post<'a>(
125        &self,
126        cipher_request_model: Option<models::CipherRequestModel>,
127    ) -> Result<models::CipherResponseModel, Error<PostError>>;
128
129    /// POST /ciphers/admin
130    async fn post_admin<'a>(
131        &self,
132        cipher_create_request_model: Option<models::CipherCreateRequestModel>,
133    ) -> Result<models::CipherMiniResponseModel, Error<PostAdminError>>;
134
135    /// POST /ciphers/{id}/attachment/v2
136    async fn post_attachment<'a>(
137        &self,
138        id: uuid::Uuid,
139        attachment_request_model: Option<models::AttachmentRequestModel>,
140    ) -> Result<models::AttachmentUploadDataResponseModel, Error<PostAttachmentError>>;
141
142    /// POST /ciphers/{id}/attachment-admin
143    async fn post_attachment_admin<'a>(
144        &self,
145        id: &'a str,
146    ) -> Result<models::CipherMiniResponseModel, Error<PostAttachmentAdminError>>;
147
148    /// POST /ciphers/{id}/attachment/{attachmentId}/share
149    async fn post_attachment_share<'a>(
150        &self,
151        id: &'a str,
152        attachment_id: &'a str,
153        organization_id: Option<uuid::Uuid>,
154    ) -> Result<(), Error<PostAttachmentShareError>>;
155
156    /// POST /ciphers/bulk-collections
157    async fn post_bulk_collections<'a>(
158        &self,
159        cipher_bulk_update_collections_request_model: Option<
160            models::CipherBulkUpdateCollectionsRequestModel,
161        >,
162    ) -> Result<(), Error<PostBulkCollectionsError>>;
163
164    /// POST /ciphers/create
165    async fn post_create<'a>(
166        &self,
167        cipher_create_request_model: Option<models::CipherCreateRequestModel>,
168    ) -> Result<models::CipherResponseModel, Error<PostCreateError>>;
169
170    /// POST /ciphers/{id}/attachment/{attachmentId}
171    async fn post_file_for_existing_attachment<'a>(
172        &self,
173        id: uuid::Uuid,
174        attachment_id: &'a str,
175    ) -> Result<(), Error<PostFileForExistingAttachmentError>>;
176
177    /// POST /ciphers/purge
178    async fn post_purge<'a>(
179        &self,
180        organization_id: Option<uuid::Uuid>,
181        secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
182    ) -> Result<(), Error<PostPurgeError>>;
183
184    /// PUT /ciphers/{id}
185    async fn put<'a>(
186        &self,
187        id: uuid::Uuid,
188        cipher_request_model: Option<models::CipherRequestModel>,
189    ) -> Result<models::CipherResponseModel, Error<PutError>>;
190
191    /// PUT /ciphers/{id}/admin
192    async fn put_admin<'a>(
193        &self,
194        id: uuid::Uuid,
195        cipher_request_model: Option<models::CipherRequestModel>,
196    ) -> Result<models::CipherMiniResponseModel, Error<PutAdminError>>;
197
198    /// PUT /ciphers/{id}/archive
199    async fn put_archive<'a>(
200        &self,
201        id: uuid::Uuid,
202    ) -> Result<models::CipherMiniResponseModel, Error<PutArchiveError>>;
203
204    /// PUT /ciphers/archive
205    async fn put_archive_many<'a>(
206        &self,
207        cipher_bulk_archive_request_model: Option<models::CipherBulkArchiveRequestModel>,
208    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutArchiveManyError>>;
209
210    /// PUT /ciphers/{id}/collections
211    async fn put_collections<'a>(
212        &self,
213        id: uuid::Uuid,
214        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
215    ) -> Result<models::CipherDetailsResponseModel, Error<PutCollectionsError>>;
216
217    /// PUT /ciphers/{id}/collections-admin
218    async fn put_collections_admin<'a>(
219        &self,
220        id: &'a str,
221        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
222    ) -> Result<models::CipherMiniDetailsResponseModel, Error<PutCollectionsAdminError>>;
223
224    /// PUT /ciphers/{id}/collections_v2
225    async fn put_collections_v_next<'a>(
226        &self,
227        id: uuid::Uuid,
228        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
229    ) -> Result<models::OptionalCipherDetailsResponseModel, Error<PutCollections_vNextError>>;
230
231    /// PUT /ciphers/{id}/delete
232    async fn put_delete<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PutDeleteError>>;
233
234    /// PUT /ciphers/{id}/delete-admin
235    async fn put_delete_admin<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PutDeleteAdminError>>;
236
237    /// PUT /ciphers/delete
238    async fn put_delete_many<'a>(
239        &self,
240        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
241    ) -> Result<(), Error<PutDeleteManyError>>;
242
243    /// PUT /ciphers/delete-admin
244    async fn put_delete_many_admin<'a>(
245        &self,
246        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
247    ) -> Result<(), Error<PutDeleteManyAdminError>>;
248
249    /// PUT /ciphers/{id}/partial
250    async fn put_partial<'a>(
251        &self,
252        id: uuid::Uuid,
253        cipher_partial_request_model: Option<models::CipherPartialRequestModel>,
254    ) -> Result<models::CipherResponseModel, Error<PutPartialError>>;
255
256    /// PUT /ciphers/{id}/restore
257    async fn put_restore<'a>(
258        &self,
259        id: uuid::Uuid,
260    ) -> Result<models::CipherResponseModel, Error<PutRestoreError>>;
261
262    /// PUT /ciphers/{id}/restore-admin
263    async fn put_restore_admin<'a>(
264        &self,
265        id: uuid::Uuid,
266    ) -> Result<models::CipherMiniResponseModel, Error<PutRestoreAdminError>>;
267
268    /// PUT /ciphers/restore
269    async fn put_restore_many<'a>(
270        &self,
271        cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
272    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutRestoreManyError>>;
273
274    /// PUT /ciphers/restore-admin
275    async fn put_restore_many_admin<'a>(
276        &self,
277        cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
278    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutRestoreManyAdminError>>;
279
280    /// PUT /ciphers/{id}/share
281    async fn put_share<'a>(
282        &self,
283        id: uuid::Uuid,
284        cipher_share_request_model: Option<models::CipherShareRequestModel>,
285    ) -> Result<models::CipherResponseModel, Error<PutShareError>>;
286
287    /// PUT /ciphers/share
288    async fn put_share_many<'a>(
289        &self,
290        cipher_bulk_share_request_model: Option<models::CipherBulkShareRequestModel>,
291    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutShareManyError>>;
292
293    /// PUT /ciphers/{id}/unarchive
294    async fn put_unarchive<'a>(
295        &self,
296        id: uuid::Uuid,
297    ) -> Result<models::CipherMiniResponseModel, Error<PutUnarchiveError>>;
298
299    /// PUT /ciphers/unarchive
300    async fn put_unarchive_many<'a>(
301        &self,
302        cipher_bulk_unarchive_request_model: Option<models::CipherBulkUnarchiveRequestModel>,
303    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutUnarchiveManyError>>;
304
305    /// GET /ciphers/{id}/attachment/{attachmentId}/renew
306    async fn renew_file_upload_url<'a>(
307        &self,
308        id: uuid::Uuid,
309        attachment_id: &'a str,
310    ) -> Result<models::AttachmentUploadDataResponseModel, Error<RenewFileUploadUrlError>>;
311}
312
313pub struct CiphersApiClient {
314    configuration: Arc<configuration::Configuration>,
315}
316
317impl CiphersApiClient {
318    pub fn new(configuration: Arc<configuration::Configuration>) -> Self {
319        Self { configuration }
320    }
321}
322
323#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
324#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
325impl CiphersApi for CiphersApiClient {
326    async fn azure_validate_file(&self) -> Result<(), Error<AzureValidateFileError>> {
327        let local_var_configuration = &self.configuration;
328
329        let local_var_client = &local_var_configuration.client;
330
331        let local_var_uri_str = format!(
332            "{}/ciphers/attachment/validate/azure",
333            local_var_configuration.base_path
334        );
335        let mut local_var_req_builder =
336            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
337
338        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
339            local_var_req_builder = local_var_req_builder
340                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
341        }
342        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
343            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
344        };
345
346        let local_var_req = local_var_req_builder.build()?;
347        let local_var_resp = local_var_client.execute(local_var_req).await?;
348
349        let local_var_status = local_var_resp.status();
350        let local_var_content = local_var_resp.text().await?;
351
352        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
353            Ok(())
354        } else {
355            let local_var_entity: Option<AzureValidateFileError> =
356                serde_json::from_str(&local_var_content).ok();
357            let local_var_error = ResponseContent {
358                status: local_var_status,
359                content: local_var_content,
360                entity: local_var_entity,
361            };
362            Err(Error::ResponseError(local_var_error))
363        }
364    }
365
366    async fn delete<'a>(&self, id: uuid::Uuid) -> Result<(), Error<DeleteError>> {
367        let local_var_configuration = &self.configuration;
368
369        let local_var_client = &local_var_configuration.client;
370
371        let local_var_uri_str = format!(
372            "{}/ciphers/{id}",
373            local_var_configuration.base_path,
374            id = id
375        );
376        let mut local_var_req_builder =
377            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
378
379        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
380            local_var_req_builder = local_var_req_builder
381                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
382        }
383        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
384            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
385        };
386
387        let local_var_req = local_var_req_builder.build()?;
388        let local_var_resp = local_var_client.execute(local_var_req).await?;
389
390        let local_var_status = local_var_resp.status();
391        let local_var_content = local_var_resp.text().await?;
392
393        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
394            Ok(())
395        } else {
396            let local_var_entity: Option<DeleteError> =
397                serde_json::from_str(&local_var_content).ok();
398            let local_var_error = ResponseContent {
399                status: local_var_status,
400                content: local_var_content,
401                entity: local_var_entity,
402            };
403            Err(Error::ResponseError(local_var_error))
404        }
405    }
406
407    async fn delete_admin<'a>(&self, id: uuid::Uuid) -> Result<(), Error<DeleteAdminError>> {
408        let local_var_configuration = &self.configuration;
409
410        let local_var_client = &local_var_configuration.client;
411
412        let local_var_uri_str = format!(
413            "{}/ciphers/{id}/admin",
414            local_var_configuration.base_path,
415            id = id
416        );
417        let mut local_var_req_builder =
418            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
419
420        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
421            local_var_req_builder = local_var_req_builder
422                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
423        }
424        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
425            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
426        };
427
428        let local_var_req = local_var_req_builder.build()?;
429        let local_var_resp = local_var_client.execute(local_var_req).await?;
430
431        let local_var_status = local_var_resp.status();
432        let local_var_content = local_var_resp.text().await?;
433
434        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
435            Ok(())
436        } else {
437            let local_var_entity: Option<DeleteAdminError> =
438                serde_json::from_str(&local_var_content).ok();
439            let local_var_error = ResponseContent {
440                status: local_var_status,
441                content: local_var_content,
442                entity: local_var_entity,
443            };
444            Err(Error::ResponseError(local_var_error))
445        }
446    }
447
448    async fn delete_attachment<'a>(
449        &self,
450        id: uuid::Uuid,
451        attachment_id: &'a str,
452    ) -> Result<models::DeleteAttachmentResponseData, Error<DeleteAttachmentError>> {
453        let local_var_configuration = &self.configuration;
454
455        let local_var_client = &local_var_configuration.client;
456
457        let local_var_uri_str = format!(
458            "{}/ciphers/{id}/attachment/{attachmentId}",
459            local_var_configuration.base_path,
460            id = id,
461            attachmentId = crate::apis::urlencode(attachment_id)
462        );
463        let mut local_var_req_builder =
464            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
465
466        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
467            local_var_req_builder = local_var_req_builder
468                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
469        }
470        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
471            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
472        };
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::DeleteAttachmentResponseData`",
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::DeleteAttachmentResponseData`"
497                    ))));
498                }
499            }
500        } else {
501            let local_var_entity: Option<DeleteAttachmentError> =
502                serde_json::from_str(&local_var_content).ok();
503            let local_var_error = ResponseContent {
504                status: local_var_status,
505                content: local_var_content,
506                entity: local_var_entity,
507            };
508            Err(Error::ResponseError(local_var_error))
509        }
510    }
511
512    async fn delete_attachment_admin<'a>(
513        &self,
514        id: uuid::Uuid,
515        attachment_id: &'a str,
516    ) -> Result<models::DeleteAttachmentResponseData, Error<DeleteAttachmentAdminError>> {
517        let local_var_configuration = &self.configuration;
518
519        let local_var_client = &local_var_configuration.client;
520
521        let local_var_uri_str = format!(
522            "{}/ciphers/{id}/attachment/{attachmentId}/admin",
523            local_var_configuration.base_path,
524            id = id,
525            attachmentId = crate::apis::urlencode(attachment_id)
526        );
527        let mut local_var_req_builder =
528            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
529
530        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
531            local_var_req_builder = local_var_req_builder
532                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
533        }
534        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
535            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
536        };
537
538        let local_var_req = local_var_req_builder.build()?;
539        let local_var_resp = local_var_client.execute(local_var_req).await?;
540
541        let local_var_status = local_var_resp.status();
542        let local_var_content_type = local_var_resp
543            .headers()
544            .get("content-type")
545            .and_then(|v| v.to_str().ok())
546            .unwrap_or("application/octet-stream");
547        let local_var_content_type = super::ContentType::from(local_var_content_type);
548        let local_var_content = local_var_resp.text().await?;
549
550        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
551            match local_var_content_type {
552                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
553                ContentType::Text => {
554                    return Err(Error::from(serde_json::Error::custom(
555                        "Received `text/plain` content type response that cannot be converted to `models::DeleteAttachmentResponseData`",
556                    )));
557                }
558                ContentType::Unsupported(local_var_unknown_type) => {
559                    return Err(Error::from(serde_json::Error::custom(format!(
560                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::DeleteAttachmentResponseData`"
561                    ))));
562                }
563            }
564        } else {
565            let local_var_entity: Option<DeleteAttachmentAdminError> =
566                serde_json::from_str(&local_var_content).ok();
567            let local_var_error = ResponseContent {
568                status: local_var_status,
569                content: local_var_content,
570                entity: local_var_entity,
571            };
572            Err(Error::ResponseError(local_var_error))
573        }
574    }
575
576    async fn delete_many<'a>(
577        &self,
578        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
579    ) -> Result<(), Error<DeleteManyError>> {
580        let local_var_configuration = &self.configuration;
581
582        let local_var_client = &local_var_configuration.client;
583
584        let local_var_uri_str = format!("{}/ciphers", local_var_configuration.base_path);
585        let mut local_var_req_builder =
586            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
587
588        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
589            local_var_req_builder = local_var_req_builder
590                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
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.json(&cipher_bulk_delete_request_model);
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 = local_var_resp.text().await?;
602
603        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
604            Ok(())
605        } else {
606            let local_var_entity: Option<DeleteManyError> =
607                serde_json::from_str(&local_var_content).ok();
608            let local_var_error = ResponseContent {
609                status: local_var_status,
610                content: local_var_content,
611                entity: local_var_entity,
612            };
613            Err(Error::ResponseError(local_var_error))
614        }
615    }
616
617    async fn delete_many_admin<'a>(
618        &self,
619        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
620    ) -> Result<(), Error<DeleteManyAdminError>> {
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!("{}/ciphers/admin", local_var_configuration.base_path);
626        let mut local_var_req_builder =
627            local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
628
629        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
630            local_var_req_builder = local_var_req_builder
631                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
632        }
633        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
634            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
635        };
636        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_delete_request_model);
637
638        let local_var_req = local_var_req_builder.build()?;
639        let local_var_resp = local_var_client.execute(local_var_req).await?;
640
641        let local_var_status = local_var_resp.status();
642        let local_var_content = local_var_resp.text().await?;
643
644        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
645            Ok(())
646        } else {
647            let local_var_entity: Option<DeleteManyAdminError> =
648                serde_json::from_str(&local_var_content).ok();
649            let local_var_error = ResponseContent {
650                status: local_var_status,
651                content: local_var_content,
652                entity: local_var_entity,
653            };
654            Err(Error::ResponseError(local_var_error))
655        }
656    }
657
658    async fn get<'a>(
659        &self,
660        id: uuid::Uuid,
661    ) -> Result<models::CipherResponseModel, Error<GetError>> {
662        let local_var_configuration = &self.configuration;
663
664        let local_var_client = &local_var_configuration.client;
665
666        let local_var_uri_str = format!(
667            "{}/ciphers/{id}",
668            local_var_configuration.base_path,
669            id = id
670        );
671        let mut local_var_req_builder =
672            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
673
674        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
675            local_var_req_builder = local_var_req_builder
676                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
677        }
678        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
679            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
680        };
681
682        let local_var_req = local_var_req_builder.build()?;
683        let local_var_resp = local_var_client.execute(local_var_req).await?;
684
685        let local_var_status = local_var_resp.status();
686        let local_var_content_type = local_var_resp
687            .headers()
688            .get("content-type")
689            .and_then(|v| v.to_str().ok())
690            .unwrap_or("application/octet-stream");
691        let local_var_content_type = super::ContentType::from(local_var_content_type);
692        let local_var_content = local_var_resp.text().await?;
693
694        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
695            match local_var_content_type {
696                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
697                ContentType::Text => {
698                    return Err(Error::from(serde_json::Error::custom(
699                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
700                    )));
701                }
702                ContentType::Unsupported(local_var_unknown_type) => {
703                    return Err(Error::from(serde_json::Error::custom(format!(
704                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
705                    ))));
706                }
707            }
708        } else {
709            let local_var_entity: Option<GetError> = serde_json::from_str(&local_var_content).ok();
710            let local_var_error = ResponseContent {
711                status: local_var_status,
712                content: local_var_content,
713                entity: local_var_entity,
714            };
715            Err(Error::ResponseError(local_var_error))
716        }
717    }
718
719    async fn get_admin<'a>(
720        &self,
721        id: &'a str,
722    ) -> Result<models::CipherMiniResponseModel, Error<GetAdminError>> {
723        let local_var_configuration = &self.configuration;
724
725        let local_var_client = &local_var_configuration.client;
726
727        let local_var_uri_str = format!(
728            "{}/ciphers/{id}/admin",
729            local_var_configuration.base_path,
730            id = crate::apis::urlencode(id)
731        );
732        let mut local_var_req_builder =
733            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
734
735        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
736            local_var_req_builder = local_var_req_builder
737                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
738        }
739        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
740            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
741        };
742
743        let local_var_req = local_var_req_builder.build()?;
744        let local_var_resp = local_var_client.execute(local_var_req).await?;
745
746        let local_var_status = local_var_resp.status();
747        let local_var_content_type = local_var_resp
748            .headers()
749            .get("content-type")
750            .and_then(|v| v.to_str().ok())
751            .unwrap_or("application/octet-stream");
752        let local_var_content_type = super::ContentType::from(local_var_content_type);
753        let local_var_content = local_var_resp.text().await?;
754
755        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
756            match local_var_content_type {
757                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
758                ContentType::Text => {
759                    return Err(Error::from(serde_json::Error::custom(
760                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
761                    )));
762                }
763                ContentType::Unsupported(local_var_unknown_type) => {
764                    return Err(Error::from(serde_json::Error::custom(format!(
765                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
766                    ))));
767                }
768            }
769        } else {
770            let local_var_entity: Option<GetAdminError> =
771                serde_json::from_str(&local_var_content).ok();
772            let local_var_error = ResponseContent {
773                status: local_var_status,
774                content: local_var_content,
775                entity: local_var_entity,
776            };
777            Err(Error::ResponseError(local_var_error))
778        }
779    }
780
781    async fn get_all(
782        &self,
783    ) -> Result<models::CipherDetailsResponseModelListResponseModel, Error<GetAllError>> {
784        let local_var_configuration = &self.configuration;
785
786        let local_var_client = &local_var_configuration.client;
787
788        let local_var_uri_str = format!("{}/ciphers", local_var_configuration.base_path);
789        let mut local_var_req_builder =
790            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
791
792        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
793            local_var_req_builder = local_var_req_builder
794                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
795        }
796        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
797            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
798        };
799
800        let local_var_req = local_var_req_builder.build()?;
801        let local_var_resp = local_var_client.execute(local_var_req).await?;
802
803        let local_var_status = local_var_resp.status();
804        let local_var_content_type = local_var_resp
805            .headers()
806            .get("content-type")
807            .and_then(|v| v.to_str().ok())
808            .unwrap_or("application/octet-stream");
809        let local_var_content_type = super::ContentType::from(local_var_content_type);
810        let local_var_content = local_var_resp.text().await?;
811
812        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
813            match local_var_content_type {
814                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
815                ContentType::Text => {
816                    return Err(Error::from(serde_json::Error::custom(
817                        "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`",
818                    )));
819                }
820                ContentType::Unsupported(local_var_unknown_type) => {
821                    return Err(Error::from(serde_json::Error::custom(format!(
822                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`"
823                    ))));
824                }
825            }
826        } else {
827            let local_var_entity: Option<GetAllError> =
828                serde_json::from_str(&local_var_content).ok();
829            let local_var_error = ResponseContent {
830                status: local_var_status,
831                content: local_var_content,
832                entity: local_var_entity,
833            };
834            Err(Error::ResponseError(local_var_error))
835        }
836    }
837
838    async fn get_assigned_organization_ciphers<'a>(
839        &self,
840        organization_id: Option<uuid::Uuid>,
841    ) -> Result<
842        models::CipherDetailsResponseModelListResponseModel,
843        Error<GetAssignedOrganizationCiphersError>,
844    > {
845        let local_var_configuration = &self.configuration;
846
847        let local_var_client = &local_var_configuration.client;
848
849        let local_var_uri_str = format!(
850            "{}/ciphers/organization-details/assigned",
851            local_var_configuration.base_path
852        );
853        let mut local_var_req_builder =
854            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
855
856        if let Some(ref param_value) = organization_id {
857            local_var_req_builder =
858                local_var_req_builder.query(&[("organizationId", &param_value.to_string())]);
859        }
860        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
861            local_var_req_builder = local_var_req_builder
862                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
863        }
864        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
865            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
866        };
867
868        let local_var_req = local_var_req_builder.build()?;
869        let local_var_resp = local_var_client.execute(local_var_req).await?;
870
871        let local_var_status = local_var_resp.status();
872        let local_var_content_type = local_var_resp
873            .headers()
874            .get("content-type")
875            .and_then(|v| v.to_str().ok())
876            .unwrap_or("application/octet-stream");
877        let local_var_content_type = super::ContentType::from(local_var_content_type);
878        let local_var_content = local_var_resp.text().await?;
879
880        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
881            match local_var_content_type {
882                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
883                ContentType::Text => {
884                    return Err(Error::from(serde_json::Error::custom(
885                        "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`",
886                    )));
887                }
888                ContentType::Unsupported(local_var_unknown_type) => {
889                    return Err(Error::from(serde_json::Error::custom(format!(
890                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModelListResponseModel`"
891                    ))));
892                }
893            }
894        } else {
895            let local_var_entity: Option<GetAssignedOrganizationCiphersError> =
896                serde_json::from_str(&local_var_content).ok();
897            let local_var_error = ResponseContent {
898                status: local_var_status,
899                content: local_var_content,
900                entity: local_var_entity,
901            };
902            Err(Error::ResponseError(local_var_error))
903        }
904    }
905
906    async fn get_attachment_data<'a>(
907        &self,
908        id: uuid::Uuid,
909        attachment_id: &'a str,
910    ) -> Result<models::AttachmentResponseModel, Error<GetAttachmentDataError>> {
911        let local_var_configuration = &self.configuration;
912
913        let local_var_client = &local_var_configuration.client;
914
915        let local_var_uri_str = format!(
916            "{}/ciphers/{id}/attachment/{attachmentId}",
917            local_var_configuration.base_path,
918            id = id,
919            attachmentId = crate::apis::urlencode(attachment_id)
920        );
921        let mut local_var_req_builder =
922            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
923
924        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
925            local_var_req_builder = local_var_req_builder
926                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
927        }
928        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
929            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
930        };
931
932        let local_var_req = local_var_req_builder.build()?;
933        let local_var_resp = local_var_client.execute(local_var_req).await?;
934
935        let local_var_status = local_var_resp.status();
936        let local_var_content_type = local_var_resp
937            .headers()
938            .get("content-type")
939            .and_then(|v| v.to_str().ok())
940            .unwrap_or("application/octet-stream");
941        let local_var_content_type = super::ContentType::from(local_var_content_type);
942        let local_var_content = local_var_resp.text().await?;
943
944        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
945            match local_var_content_type {
946                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
947                ContentType::Text => {
948                    return Err(Error::from(serde_json::Error::custom(
949                        "Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`",
950                    )));
951                }
952                ContentType::Unsupported(local_var_unknown_type) => {
953                    return Err(Error::from(serde_json::Error::custom(format!(
954                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`"
955                    ))));
956                }
957            }
958        } else {
959            let local_var_entity: Option<GetAttachmentDataError> =
960                serde_json::from_str(&local_var_content).ok();
961            let local_var_error = ResponseContent {
962                status: local_var_status,
963                content: local_var_content,
964                entity: local_var_entity,
965            };
966            Err(Error::ResponseError(local_var_error))
967        }
968    }
969
970    async fn get_attachment_data_admin<'a>(
971        &self,
972        id: uuid::Uuid,
973        attachment_id: &'a str,
974    ) -> Result<models::AttachmentResponseModel, Error<GetAttachmentDataAdminError>> {
975        let local_var_configuration = &self.configuration;
976
977        let local_var_client = &local_var_configuration.client;
978
979        let local_var_uri_str = format!(
980            "{}/ciphers/{id}/attachment/{attachmentId}/admin",
981            local_var_configuration.base_path,
982            id = id,
983            attachmentId = crate::apis::urlencode(attachment_id)
984        );
985        let mut local_var_req_builder =
986            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
987
988        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
989            local_var_req_builder = local_var_req_builder
990                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
991        }
992        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
993            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
994        };
995
996        let local_var_req = local_var_req_builder.build()?;
997        let local_var_resp = local_var_client.execute(local_var_req).await?;
998
999        let local_var_status = local_var_resp.status();
1000        let local_var_content_type = local_var_resp
1001            .headers()
1002            .get("content-type")
1003            .and_then(|v| v.to_str().ok())
1004            .unwrap_or("application/octet-stream");
1005        let local_var_content_type = super::ContentType::from(local_var_content_type);
1006        let local_var_content = local_var_resp.text().await?;
1007
1008        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1009            match local_var_content_type {
1010                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1011                ContentType::Text => {
1012                    return Err(Error::from(serde_json::Error::custom(
1013                        "Received `text/plain` content type response that cannot be converted to `models::AttachmentResponseModel`",
1014                    )));
1015                }
1016                ContentType::Unsupported(local_var_unknown_type) => {
1017                    return Err(Error::from(serde_json::Error::custom(format!(
1018                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentResponseModel`"
1019                    ))));
1020                }
1021            }
1022        } else {
1023            let local_var_entity: Option<GetAttachmentDataAdminError> =
1024                serde_json::from_str(&local_var_content).ok();
1025            let local_var_error = ResponseContent {
1026                status: local_var_status,
1027                content: local_var_content,
1028                entity: local_var_entity,
1029            };
1030            Err(Error::ResponseError(local_var_error))
1031        }
1032    }
1033
1034    async fn get_details<'a>(
1035        &self,
1036        id: uuid::Uuid,
1037    ) -> Result<models::CipherDetailsResponseModel, Error<GetDetailsError>> {
1038        let local_var_configuration = &self.configuration;
1039
1040        let local_var_client = &local_var_configuration.client;
1041
1042        let local_var_uri_str = format!(
1043            "{}/ciphers/{id}/details",
1044            local_var_configuration.base_path,
1045            id = id
1046        );
1047        let mut local_var_req_builder =
1048            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1049
1050        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1051            local_var_req_builder = local_var_req_builder
1052                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1053        }
1054        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1055            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1056        };
1057
1058        let local_var_req = local_var_req_builder.build()?;
1059        let local_var_resp = local_var_client.execute(local_var_req).await?;
1060
1061        let local_var_status = local_var_resp.status();
1062        let local_var_content_type = local_var_resp
1063            .headers()
1064            .get("content-type")
1065            .and_then(|v| v.to_str().ok())
1066            .unwrap_or("application/octet-stream");
1067        let local_var_content_type = super::ContentType::from(local_var_content_type);
1068        let local_var_content = local_var_resp.text().await?;
1069
1070        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1071            match local_var_content_type {
1072                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1073                ContentType::Text => {
1074                    return Err(Error::from(serde_json::Error::custom(
1075                        "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`",
1076                    )));
1077                }
1078                ContentType::Unsupported(local_var_unknown_type) => {
1079                    return Err(Error::from(serde_json::Error::custom(format!(
1080                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`"
1081                    ))));
1082                }
1083            }
1084        } else {
1085            let local_var_entity: Option<GetDetailsError> =
1086                serde_json::from_str(&local_var_content).ok();
1087            let local_var_error = ResponseContent {
1088                status: local_var_status,
1089                content: local_var_content,
1090                entity: local_var_entity,
1091            };
1092            Err(Error::ResponseError(local_var_error))
1093        }
1094    }
1095
1096    async fn get_organization_ciphers<'a>(
1097        &self,
1098        organization_id: Option<uuid::Uuid>,
1099    ) -> Result<
1100        models::CipherMiniDetailsResponseModelListResponseModel,
1101        Error<GetOrganizationCiphersError>,
1102    > {
1103        let local_var_configuration = &self.configuration;
1104
1105        let local_var_client = &local_var_configuration.client;
1106
1107        let local_var_uri_str = format!(
1108            "{}/ciphers/organization-details",
1109            local_var_configuration.base_path
1110        );
1111        let mut local_var_req_builder =
1112            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1113
1114        if let Some(ref param_value) = organization_id {
1115            local_var_req_builder =
1116                local_var_req_builder.query(&[("organizationId", &param_value.to_string())]);
1117        }
1118        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1119            local_var_req_builder = local_var_req_builder
1120                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1121        }
1122        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1123            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1124        };
1125
1126        let local_var_req = local_var_req_builder.build()?;
1127        let local_var_resp = local_var_client.execute(local_var_req).await?;
1128
1129        let local_var_status = local_var_resp.status();
1130        let local_var_content_type = local_var_resp
1131            .headers()
1132            .get("content-type")
1133            .and_then(|v| v.to_str().ok())
1134            .unwrap_or("application/octet-stream");
1135        let local_var_content_type = super::ContentType::from(local_var_content_type);
1136        let local_var_content = local_var_resp.text().await?;
1137
1138        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1139            match local_var_content_type {
1140                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1141                ContentType::Text => {
1142                    return Err(Error::from(serde_json::Error::custom(
1143                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`",
1144                    )));
1145                }
1146                ContentType::Unsupported(local_var_unknown_type) => {
1147                    return Err(Error::from(serde_json::Error::custom(format!(
1148                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModelListResponseModel`"
1149                    ))));
1150                }
1151            }
1152        } else {
1153            let local_var_entity: Option<GetOrganizationCiphersError> =
1154                serde_json::from_str(&local_var_content).ok();
1155            let local_var_error = ResponseContent {
1156                status: local_var_status,
1157                content: local_var_content,
1158                entity: local_var_entity,
1159            };
1160            Err(Error::ResponseError(local_var_error))
1161        }
1162    }
1163
1164    async fn move_many<'a>(
1165        &self,
1166        cipher_bulk_move_request_model: Option<models::CipherBulkMoveRequestModel>,
1167    ) -> Result<(), Error<MoveManyError>> {
1168        let local_var_configuration = &self.configuration;
1169
1170        let local_var_client = &local_var_configuration.client;
1171
1172        let local_var_uri_str = format!("{}/ciphers/move", local_var_configuration.base_path);
1173        let mut local_var_req_builder =
1174            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1175
1176        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1177            local_var_req_builder = local_var_req_builder
1178                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1179        }
1180        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1181            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1182        };
1183        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_move_request_model);
1184
1185        let local_var_req = local_var_req_builder.build()?;
1186        let local_var_resp = local_var_client.execute(local_var_req).await?;
1187
1188        let local_var_status = local_var_resp.status();
1189        let local_var_content = local_var_resp.text().await?;
1190
1191        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1192            Ok(())
1193        } else {
1194            let local_var_entity: Option<MoveManyError> =
1195                serde_json::from_str(&local_var_content).ok();
1196            let local_var_error = ResponseContent {
1197                status: local_var_status,
1198                content: local_var_content,
1199                entity: local_var_entity,
1200            };
1201            Err(Error::ResponseError(local_var_error))
1202        }
1203    }
1204
1205    async fn post<'a>(
1206        &self,
1207        cipher_request_model: Option<models::CipherRequestModel>,
1208    ) -> Result<models::CipherResponseModel, Error<PostError>> {
1209        let local_var_configuration = &self.configuration;
1210
1211        let local_var_client = &local_var_configuration.client;
1212
1213        let local_var_uri_str = format!("{}/ciphers", local_var_configuration.base_path);
1214        let mut local_var_req_builder =
1215            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1216
1217        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1218            local_var_req_builder = local_var_req_builder
1219                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1220        }
1221        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1222            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1223        };
1224        local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
1225
1226        let local_var_req = local_var_req_builder.build()?;
1227        let local_var_resp = local_var_client.execute(local_var_req).await?;
1228
1229        let local_var_status = local_var_resp.status();
1230        let local_var_content_type = local_var_resp
1231            .headers()
1232            .get("content-type")
1233            .and_then(|v| v.to_str().ok())
1234            .unwrap_or("application/octet-stream");
1235        let local_var_content_type = super::ContentType::from(local_var_content_type);
1236        let local_var_content = local_var_resp.text().await?;
1237
1238        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1239            match local_var_content_type {
1240                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1241                ContentType::Text => {
1242                    return Err(Error::from(serde_json::Error::custom(
1243                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
1244                    )));
1245                }
1246                ContentType::Unsupported(local_var_unknown_type) => {
1247                    return Err(Error::from(serde_json::Error::custom(format!(
1248                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
1249                    ))));
1250                }
1251            }
1252        } else {
1253            let local_var_entity: Option<PostError> = serde_json::from_str(&local_var_content).ok();
1254            let local_var_error = ResponseContent {
1255                status: local_var_status,
1256                content: local_var_content,
1257                entity: local_var_entity,
1258            };
1259            Err(Error::ResponseError(local_var_error))
1260        }
1261    }
1262
1263    async fn post_admin<'a>(
1264        &self,
1265        cipher_create_request_model: Option<models::CipherCreateRequestModel>,
1266    ) -> Result<models::CipherMiniResponseModel, Error<PostAdminError>> {
1267        let local_var_configuration = &self.configuration;
1268
1269        let local_var_client = &local_var_configuration.client;
1270
1271        let local_var_uri_str = format!("{}/ciphers/admin", local_var_configuration.base_path);
1272        let mut local_var_req_builder =
1273            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1274
1275        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1276            local_var_req_builder = local_var_req_builder
1277                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1278        }
1279        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1280            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1281        };
1282        local_var_req_builder = local_var_req_builder.json(&cipher_create_request_model);
1283
1284        let local_var_req = local_var_req_builder.build()?;
1285        let local_var_resp = local_var_client.execute(local_var_req).await?;
1286
1287        let local_var_status = local_var_resp.status();
1288        let local_var_content_type = local_var_resp
1289            .headers()
1290            .get("content-type")
1291            .and_then(|v| v.to_str().ok())
1292            .unwrap_or("application/octet-stream");
1293        let local_var_content_type = super::ContentType::from(local_var_content_type);
1294        let local_var_content = local_var_resp.text().await?;
1295
1296        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1297            match local_var_content_type {
1298                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1299                ContentType::Text => {
1300                    return Err(Error::from(serde_json::Error::custom(
1301                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
1302                    )));
1303                }
1304                ContentType::Unsupported(local_var_unknown_type) => {
1305                    return Err(Error::from(serde_json::Error::custom(format!(
1306                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
1307                    ))));
1308                }
1309            }
1310        } else {
1311            let local_var_entity: Option<PostAdminError> =
1312                serde_json::from_str(&local_var_content).ok();
1313            let local_var_error = ResponseContent {
1314                status: local_var_status,
1315                content: local_var_content,
1316                entity: local_var_entity,
1317            };
1318            Err(Error::ResponseError(local_var_error))
1319        }
1320    }
1321
1322    async fn post_attachment<'a>(
1323        &self,
1324        id: uuid::Uuid,
1325        attachment_request_model: Option<models::AttachmentRequestModel>,
1326    ) -> Result<models::AttachmentUploadDataResponseModel, Error<PostAttachmentError>> {
1327        let local_var_configuration = &self.configuration;
1328
1329        let local_var_client = &local_var_configuration.client;
1330
1331        let local_var_uri_str = format!(
1332            "{}/ciphers/{id}/attachment/v2",
1333            local_var_configuration.base_path,
1334            id = id
1335        );
1336        let mut local_var_req_builder =
1337            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1338
1339        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1340            local_var_req_builder = local_var_req_builder
1341                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1342        }
1343        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1344            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1345        };
1346        local_var_req_builder = local_var_req_builder.json(&attachment_request_model);
1347
1348        let local_var_req = local_var_req_builder.build()?;
1349        let local_var_resp = local_var_client.execute(local_var_req).await?;
1350
1351        let local_var_status = local_var_resp.status();
1352        let local_var_content_type = local_var_resp
1353            .headers()
1354            .get("content-type")
1355            .and_then(|v| v.to_str().ok())
1356            .unwrap_or("application/octet-stream");
1357        let local_var_content_type = super::ContentType::from(local_var_content_type);
1358        let local_var_content = local_var_resp.text().await?;
1359
1360        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1361            match local_var_content_type {
1362                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1363                ContentType::Text => {
1364                    return Err(Error::from(serde_json::Error::custom(
1365                        "Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`",
1366                    )));
1367                }
1368                ContentType::Unsupported(local_var_unknown_type) => {
1369                    return Err(Error::from(serde_json::Error::custom(format!(
1370                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`"
1371                    ))));
1372                }
1373            }
1374        } else {
1375            let local_var_entity: Option<PostAttachmentError> =
1376                serde_json::from_str(&local_var_content).ok();
1377            let local_var_error = ResponseContent {
1378                status: local_var_status,
1379                content: local_var_content,
1380                entity: local_var_entity,
1381            };
1382            Err(Error::ResponseError(local_var_error))
1383        }
1384    }
1385
1386    async fn post_attachment_admin<'a>(
1387        &self,
1388        id: &'a str,
1389    ) -> Result<models::CipherMiniResponseModel, Error<PostAttachmentAdminError>> {
1390        let local_var_configuration = &self.configuration;
1391
1392        let local_var_client = &local_var_configuration.client;
1393
1394        let local_var_uri_str = format!(
1395            "{}/ciphers/{id}/attachment-admin",
1396            local_var_configuration.base_path,
1397            id = crate::apis::urlencode(id)
1398        );
1399        let mut local_var_req_builder =
1400            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1401
1402        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1403            local_var_req_builder = local_var_req_builder
1404                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1405        }
1406        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1407            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1408        };
1409
1410        let local_var_req = local_var_req_builder.build()?;
1411        let local_var_resp = local_var_client.execute(local_var_req).await?;
1412
1413        let local_var_status = local_var_resp.status();
1414        let local_var_content_type = local_var_resp
1415            .headers()
1416            .get("content-type")
1417            .and_then(|v| v.to_str().ok())
1418            .unwrap_or("application/octet-stream");
1419        let local_var_content_type = super::ContentType::from(local_var_content_type);
1420        let local_var_content = local_var_resp.text().await?;
1421
1422        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1423            match local_var_content_type {
1424                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1425                ContentType::Text => {
1426                    return Err(Error::from(serde_json::Error::custom(
1427                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
1428                    )));
1429                }
1430                ContentType::Unsupported(local_var_unknown_type) => {
1431                    return Err(Error::from(serde_json::Error::custom(format!(
1432                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
1433                    ))));
1434                }
1435            }
1436        } else {
1437            let local_var_entity: Option<PostAttachmentAdminError> =
1438                serde_json::from_str(&local_var_content).ok();
1439            let local_var_error = ResponseContent {
1440                status: local_var_status,
1441                content: local_var_content,
1442                entity: local_var_entity,
1443            };
1444            Err(Error::ResponseError(local_var_error))
1445        }
1446    }
1447
1448    async fn post_attachment_share<'a>(
1449        &self,
1450        id: &'a str,
1451        attachment_id: &'a str,
1452        organization_id: Option<uuid::Uuid>,
1453    ) -> Result<(), Error<PostAttachmentShareError>> {
1454        let local_var_configuration = &self.configuration;
1455
1456        let local_var_client = &local_var_configuration.client;
1457
1458        let local_var_uri_str = format!(
1459            "{}/ciphers/{id}/attachment/{attachmentId}/share",
1460            local_var_configuration.base_path,
1461            id = crate::apis::urlencode(id),
1462            attachmentId = crate::apis::urlencode(attachment_id)
1463        );
1464        let mut local_var_req_builder =
1465            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1466
1467        if let Some(ref param_value) = organization_id {
1468            local_var_req_builder =
1469                local_var_req_builder.query(&[("organizationId", &param_value.to_string())]);
1470        }
1471        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1472            local_var_req_builder = local_var_req_builder
1473                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1474        }
1475        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1476            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1477        };
1478
1479        let local_var_req = local_var_req_builder.build()?;
1480        let local_var_resp = local_var_client.execute(local_var_req).await?;
1481
1482        let local_var_status = local_var_resp.status();
1483        let local_var_content = local_var_resp.text().await?;
1484
1485        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1486            Ok(())
1487        } else {
1488            let local_var_entity: Option<PostAttachmentShareError> =
1489                serde_json::from_str(&local_var_content).ok();
1490            let local_var_error = ResponseContent {
1491                status: local_var_status,
1492                content: local_var_content,
1493                entity: local_var_entity,
1494            };
1495            Err(Error::ResponseError(local_var_error))
1496        }
1497    }
1498
1499    async fn post_bulk_collections<'a>(
1500        &self,
1501        cipher_bulk_update_collections_request_model: Option<
1502            models::CipherBulkUpdateCollectionsRequestModel,
1503        >,
1504    ) -> Result<(), Error<PostBulkCollectionsError>> {
1505        let local_var_configuration = &self.configuration;
1506
1507        let local_var_client = &local_var_configuration.client;
1508
1509        let local_var_uri_str = format!(
1510            "{}/ciphers/bulk-collections",
1511            local_var_configuration.base_path
1512        );
1513        let mut local_var_req_builder =
1514            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1515
1516        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1517            local_var_req_builder = local_var_req_builder
1518                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1519        }
1520        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1521            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1522        };
1523        local_var_req_builder =
1524            local_var_req_builder.json(&cipher_bulk_update_collections_request_model);
1525
1526        let local_var_req = local_var_req_builder.build()?;
1527        let local_var_resp = local_var_client.execute(local_var_req).await?;
1528
1529        let local_var_status = local_var_resp.status();
1530        let local_var_content = local_var_resp.text().await?;
1531
1532        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1533            Ok(())
1534        } else {
1535            let local_var_entity: Option<PostBulkCollectionsError> =
1536                serde_json::from_str(&local_var_content).ok();
1537            let local_var_error = ResponseContent {
1538                status: local_var_status,
1539                content: local_var_content,
1540                entity: local_var_entity,
1541            };
1542            Err(Error::ResponseError(local_var_error))
1543        }
1544    }
1545
1546    async fn post_create<'a>(
1547        &self,
1548        cipher_create_request_model: Option<models::CipherCreateRequestModel>,
1549    ) -> Result<models::CipherResponseModel, Error<PostCreateError>> {
1550        let local_var_configuration = &self.configuration;
1551
1552        let local_var_client = &local_var_configuration.client;
1553
1554        let local_var_uri_str = format!("{}/ciphers/create", local_var_configuration.base_path);
1555        let mut local_var_req_builder =
1556            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1557
1558        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1559            local_var_req_builder = local_var_req_builder
1560                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1561        }
1562        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1563            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1564        };
1565        local_var_req_builder = local_var_req_builder.json(&cipher_create_request_model);
1566
1567        let local_var_req = local_var_req_builder.build()?;
1568        let local_var_resp = local_var_client.execute(local_var_req).await?;
1569
1570        let local_var_status = local_var_resp.status();
1571        let local_var_content_type = local_var_resp
1572            .headers()
1573            .get("content-type")
1574            .and_then(|v| v.to_str().ok())
1575            .unwrap_or("application/octet-stream");
1576        let local_var_content_type = super::ContentType::from(local_var_content_type);
1577        let local_var_content = local_var_resp.text().await?;
1578
1579        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1580            match local_var_content_type {
1581                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1582                ContentType::Text => {
1583                    return Err(Error::from(serde_json::Error::custom(
1584                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
1585                    )));
1586                }
1587                ContentType::Unsupported(local_var_unknown_type) => {
1588                    return Err(Error::from(serde_json::Error::custom(format!(
1589                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
1590                    ))));
1591                }
1592            }
1593        } else {
1594            let local_var_entity: Option<PostCreateError> =
1595                serde_json::from_str(&local_var_content).ok();
1596            let local_var_error = ResponseContent {
1597                status: local_var_status,
1598                content: local_var_content,
1599                entity: local_var_entity,
1600            };
1601            Err(Error::ResponseError(local_var_error))
1602        }
1603    }
1604
1605    async fn post_file_for_existing_attachment<'a>(
1606        &self,
1607        id: uuid::Uuid,
1608        attachment_id: &'a str,
1609    ) -> Result<(), Error<PostFileForExistingAttachmentError>> {
1610        let local_var_configuration = &self.configuration;
1611
1612        let local_var_client = &local_var_configuration.client;
1613
1614        let local_var_uri_str = format!(
1615            "{}/ciphers/{id}/attachment/{attachmentId}",
1616            local_var_configuration.base_path,
1617            id = id,
1618            attachmentId = crate::apis::urlencode(attachment_id)
1619        );
1620        let mut local_var_req_builder =
1621            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1622
1623        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1624            local_var_req_builder = local_var_req_builder
1625                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1626        }
1627        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1628            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1629        };
1630
1631        let local_var_req = local_var_req_builder.build()?;
1632        let local_var_resp = local_var_client.execute(local_var_req).await?;
1633
1634        let local_var_status = local_var_resp.status();
1635        let local_var_content = local_var_resp.text().await?;
1636
1637        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1638            Ok(())
1639        } else {
1640            let local_var_entity: Option<PostFileForExistingAttachmentError> =
1641                serde_json::from_str(&local_var_content).ok();
1642            let local_var_error = ResponseContent {
1643                status: local_var_status,
1644                content: local_var_content,
1645                entity: local_var_entity,
1646            };
1647            Err(Error::ResponseError(local_var_error))
1648        }
1649    }
1650
1651    async fn post_purge<'a>(
1652        &self,
1653        organization_id: Option<uuid::Uuid>,
1654        secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
1655    ) -> Result<(), Error<PostPurgeError>> {
1656        let local_var_configuration = &self.configuration;
1657
1658        let local_var_client = &local_var_configuration.client;
1659
1660        let local_var_uri_str = format!("{}/ciphers/purge", local_var_configuration.base_path);
1661        let mut local_var_req_builder =
1662            local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1663
1664        if let Some(ref param_value) = organization_id {
1665            local_var_req_builder =
1666                local_var_req_builder.query(&[("organizationId", &param_value.to_string())]);
1667        }
1668        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1669            local_var_req_builder = local_var_req_builder
1670                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1671        }
1672        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1673            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1674        };
1675        local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model);
1676
1677        let local_var_req = local_var_req_builder.build()?;
1678        let local_var_resp = local_var_client.execute(local_var_req).await?;
1679
1680        let local_var_status = local_var_resp.status();
1681        let local_var_content = local_var_resp.text().await?;
1682
1683        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1684            Ok(())
1685        } else {
1686            let local_var_entity: Option<PostPurgeError> =
1687                serde_json::from_str(&local_var_content).ok();
1688            let local_var_error = ResponseContent {
1689                status: local_var_status,
1690                content: local_var_content,
1691                entity: local_var_entity,
1692            };
1693            Err(Error::ResponseError(local_var_error))
1694        }
1695    }
1696
1697    async fn put<'a>(
1698        &self,
1699        id: uuid::Uuid,
1700        cipher_request_model: Option<models::CipherRequestModel>,
1701    ) -> Result<models::CipherResponseModel, Error<PutError>> {
1702        let local_var_configuration = &self.configuration;
1703
1704        let local_var_client = &local_var_configuration.client;
1705
1706        let local_var_uri_str = format!(
1707            "{}/ciphers/{id}",
1708            local_var_configuration.base_path,
1709            id = id
1710        );
1711        let mut local_var_req_builder =
1712            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1713
1714        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1715            local_var_req_builder = local_var_req_builder
1716                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1717        }
1718        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1719            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1720        };
1721        local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
1722
1723        let local_var_req = local_var_req_builder.build()?;
1724        let local_var_resp = local_var_client.execute(local_var_req).await?;
1725
1726        let local_var_status = local_var_resp.status();
1727        let local_var_content_type = local_var_resp
1728            .headers()
1729            .get("content-type")
1730            .and_then(|v| v.to_str().ok())
1731            .unwrap_or("application/octet-stream");
1732        let local_var_content_type = super::ContentType::from(local_var_content_type);
1733        let local_var_content = local_var_resp.text().await?;
1734
1735        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1736            match local_var_content_type {
1737                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1738                ContentType::Text => {
1739                    return Err(Error::from(serde_json::Error::custom(
1740                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
1741                    )));
1742                }
1743                ContentType::Unsupported(local_var_unknown_type) => {
1744                    return Err(Error::from(serde_json::Error::custom(format!(
1745                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
1746                    ))));
1747                }
1748            }
1749        } else {
1750            let local_var_entity: Option<PutError> = serde_json::from_str(&local_var_content).ok();
1751            let local_var_error = ResponseContent {
1752                status: local_var_status,
1753                content: local_var_content,
1754                entity: local_var_entity,
1755            };
1756            Err(Error::ResponseError(local_var_error))
1757        }
1758    }
1759
1760    async fn put_admin<'a>(
1761        &self,
1762        id: uuid::Uuid,
1763        cipher_request_model: Option<models::CipherRequestModel>,
1764    ) -> Result<models::CipherMiniResponseModel, Error<PutAdminError>> {
1765        let local_var_configuration = &self.configuration;
1766
1767        let local_var_client = &local_var_configuration.client;
1768
1769        let local_var_uri_str = format!(
1770            "{}/ciphers/{id}/admin",
1771            local_var_configuration.base_path,
1772            id = id
1773        );
1774        let mut local_var_req_builder =
1775            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1776
1777        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1778            local_var_req_builder = local_var_req_builder
1779                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1780        }
1781        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1782            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1783        };
1784        local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
1785
1786        let local_var_req = local_var_req_builder.build()?;
1787        let local_var_resp = local_var_client.execute(local_var_req).await?;
1788
1789        let local_var_status = local_var_resp.status();
1790        let local_var_content_type = local_var_resp
1791            .headers()
1792            .get("content-type")
1793            .and_then(|v| v.to_str().ok())
1794            .unwrap_or("application/octet-stream");
1795        let local_var_content_type = super::ContentType::from(local_var_content_type);
1796        let local_var_content = local_var_resp.text().await?;
1797
1798        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1799            match local_var_content_type {
1800                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1801                ContentType::Text => {
1802                    return Err(Error::from(serde_json::Error::custom(
1803                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
1804                    )));
1805                }
1806                ContentType::Unsupported(local_var_unknown_type) => {
1807                    return Err(Error::from(serde_json::Error::custom(format!(
1808                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
1809                    ))));
1810                }
1811            }
1812        } else {
1813            let local_var_entity: Option<PutAdminError> =
1814                serde_json::from_str(&local_var_content).ok();
1815            let local_var_error = ResponseContent {
1816                status: local_var_status,
1817                content: local_var_content,
1818                entity: local_var_entity,
1819            };
1820            Err(Error::ResponseError(local_var_error))
1821        }
1822    }
1823
1824    async fn put_archive<'a>(
1825        &self,
1826        id: uuid::Uuid,
1827    ) -> Result<models::CipherMiniResponseModel, Error<PutArchiveError>> {
1828        let local_var_configuration = &self.configuration;
1829
1830        let local_var_client = &local_var_configuration.client;
1831
1832        let local_var_uri_str = format!(
1833            "{}/ciphers/{id}/archive",
1834            local_var_configuration.base_path,
1835            id = id
1836        );
1837        let mut local_var_req_builder =
1838            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1839
1840        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1841            local_var_req_builder = local_var_req_builder
1842                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1843        }
1844        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1845            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1846        };
1847
1848        let local_var_req = local_var_req_builder.build()?;
1849        let local_var_resp = local_var_client.execute(local_var_req).await?;
1850
1851        let local_var_status = local_var_resp.status();
1852        let local_var_content_type = local_var_resp
1853            .headers()
1854            .get("content-type")
1855            .and_then(|v| v.to_str().ok())
1856            .unwrap_or("application/octet-stream");
1857        let local_var_content_type = super::ContentType::from(local_var_content_type);
1858        let local_var_content = local_var_resp.text().await?;
1859
1860        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1861            match local_var_content_type {
1862                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1863                ContentType::Text => {
1864                    return Err(Error::from(serde_json::Error::custom(
1865                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
1866                    )));
1867                }
1868                ContentType::Unsupported(local_var_unknown_type) => {
1869                    return Err(Error::from(serde_json::Error::custom(format!(
1870                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
1871                    ))));
1872                }
1873            }
1874        } else {
1875            let local_var_entity: Option<PutArchiveError> =
1876                serde_json::from_str(&local_var_content).ok();
1877            let local_var_error = ResponseContent {
1878                status: local_var_status,
1879                content: local_var_content,
1880                entity: local_var_entity,
1881            };
1882            Err(Error::ResponseError(local_var_error))
1883        }
1884    }
1885
1886    async fn put_archive_many<'a>(
1887        &self,
1888        cipher_bulk_archive_request_model: Option<models::CipherBulkArchiveRequestModel>,
1889    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutArchiveManyError>> {
1890        let local_var_configuration = &self.configuration;
1891
1892        let local_var_client = &local_var_configuration.client;
1893
1894        let local_var_uri_str = format!("{}/ciphers/archive", local_var_configuration.base_path);
1895        let mut local_var_req_builder =
1896            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1897
1898        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1899            local_var_req_builder = local_var_req_builder
1900                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1901        }
1902        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1903            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1904        };
1905        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_archive_request_model);
1906
1907        let local_var_req = local_var_req_builder.build()?;
1908        let local_var_resp = local_var_client.execute(local_var_req).await?;
1909
1910        let local_var_status = local_var_resp.status();
1911        let local_var_content_type = local_var_resp
1912            .headers()
1913            .get("content-type")
1914            .and_then(|v| v.to_str().ok())
1915            .unwrap_or("application/octet-stream");
1916        let local_var_content_type = super::ContentType::from(local_var_content_type);
1917        let local_var_content = local_var_resp.text().await?;
1918
1919        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1920            match local_var_content_type {
1921                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1922                ContentType::Text => {
1923                    return Err(Error::from(serde_json::Error::custom(
1924                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`",
1925                    )));
1926                }
1927                ContentType::Unsupported(local_var_unknown_type) => {
1928                    return Err(Error::from(serde_json::Error::custom(format!(
1929                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"
1930                    ))));
1931                }
1932            }
1933        } else {
1934            let local_var_entity: Option<PutArchiveManyError> =
1935                serde_json::from_str(&local_var_content).ok();
1936            let local_var_error = ResponseContent {
1937                status: local_var_status,
1938                content: local_var_content,
1939                entity: local_var_entity,
1940            };
1941            Err(Error::ResponseError(local_var_error))
1942        }
1943    }
1944
1945    async fn put_collections<'a>(
1946        &self,
1947        id: uuid::Uuid,
1948        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1949    ) -> Result<models::CipherDetailsResponseModel, Error<PutCollectionsError>> {
1950        let local_var_configuration = &self.configuration;
1951
1952        let local_var_client = &local_var_configuration.client;
1953
1954        let local_var_uri_str = format!(
1955            "{}/ciphers/{id}/collections",
1956            local_var_configuration.base_path,
1957            id = id
1958        );
1959        let mut local_var_req_builder =
1960            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1961
1962        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1963            local_var_req_builder = local_var_req_builder
1964                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1965        }
1966        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1967            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1968        };
1969        local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1970
1971        let local_var_req = local_var_req_builder.build()?;
1972        let local_var_resp = local_var_client.execute(local_var_req).await?;
1973
1974        let local_var_status = local_var_resp.status();
1975        let local_var_content_type = local_var_resp
1976            .headers()
1977            .get("content-type")
1978            .and_then(|v| v.to_str().ok())
1979            .unwrap_or("application/octet-stream");
1980        let local_var_content_type = super::ContentType::from(local_var_content_type);
1981        let local_var_content = local_var_resp.text().await?;
1982
1983        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1984            match local_var_content_type {
1985                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
1986                ContentType::Text => {
1987                    return Err(Error::from(serde_json::Error::custom(
1988                        "Received `text/plain` content type response that cannot be converted to `models::CipherDetailsResponseModel`",
1989                    )));
1990                }
1991                ContentType::Unsupported(local_var_unknown_type) => {
1992                    return Err(Error::from(serde_json::Error::custom(format!(
1993                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherDetailsResponseModel`"
1994                    ))));
1995                }
1996            }
1997        } else {
1998            let local_var_entity: Option<PutCollectionsError> =
1999                serde_json::from_str(&local_var_content).ok();
2000            let local_var_error = ResponseContent {
2001                status: local_var_status,
2002                content: local_var_content,
2003                entity: local_var_entity,
2004            };
2005            Err(Error::ResponseError(local_var_error))
2006        }
2007    }
2008
2009    async fn put_collections_admin<'a>(
2010        &self,
2011        id: &'a str,
2012        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
2013    ) -> Result<models::CipherMiniDetailsResponseModel, Error<PutCollectionsAdminError>> {
2014        let local_var_configuration = &self.configuration;
2015
2016        let local_var_client = &local_var_configuration.client;
2017
2018        let local_var_uri_str = format!(
2019            "{}/ciphers/{id}/collections-admin",
2020            local_var_configuration.base_path,
2021            id = crate::apis::urlencode(id)
2022        );
2023        let mut local_var_req_builder =
2024            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2025
2026        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2027            local_var_req_builder = local_var_req_builder
2028                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2029        }
2030        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2031            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2032        };
2033        local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
2034
2035        let local_var_req = local_var_req_builder.build()?;
2036        let local_var_resp = local_var_client.execute(local_var_req).await?;
2037
2038        let local_var_status = local_var_resp.status();
2039        let local_var_content_type = local_var_resp
2040            .headers()
2041            .get("content-type")
2042            .and_then(|v| v.to_str().ok())
2043            .unwrap_or("application/octet-stream");
2044        let local_var_content_type = super::ContentType::from(local_var_content_type);
2045        let local_var_content = local_var_resp.text().await?;
2046
2047        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2048            match local_var_content_type {
2049                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2050                ContentType::Text => {
2051                    return Err(Error::from(serde_json::Error::custom(
2052                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`",
2053                    )));
2054                }
2055                ContentType::Unsupported(local_var_unknown_type) => {
2056                    return Err(Error::from(serde_json::Error::custom(format!(
2057                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniDetailsResponseModel`"
2058                    ))));
2059                }
2060            }
2061        } else {
2062            let local_var_entity: Option<PutCollectionsAdminError> =
2063                serde_json::from_str(&local_var_content).ok();
2064            let local_var_error = ResponseContent {
2065                status: local_var_status,
2066                content: local_var_content,
2067                entity: local_var_entity,
2068            };
2069            Err(Error::ResponseError(local_var_error))
2070        }
2071    }
2072
2073    async fn put_collections_v_next<'a>(
2074        &self,
2075        id: uuid::Uuid,
2076        cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
2077    ) -> Result<models::OptionalCipherDetailsResponseModel, Error<PutCollections_vNextError>> {
2078        let local_var_configuration = &self.configuration;
2079
2080        let local_var_client = &local_var_configuration.client;
2081
2082        let local_var_uri_str = format!(
2083            "{}/ciphers/{id}/collections_v2",
2084            local_var_configuration.base_path,
2085            id = id
2086        );
2087        let mut local_var_req_builder =
2088            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2089
2090        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2091            local_var_req_builder = local_var_req_builder
2092                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2093        }
2094        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2095            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2096        };
2097        local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
2098
2099        let local_var_req = local_var_req_builder.build()?;
2100        let local_var_resp = local_var_client.execute(local_var_req).await?;
2101
2102        let local_var_status = local_var_resp.status();
2103        let local_var_content_type = local_var_resp
2104            .headers()
2105            .get("content-type")
2106            .and_then(|v| v.to_str().ok())
2107            .unwrap_or("application/octet-stream");
2108        let local_var_content_type = super::ContentType::from(local_var_content_type);
2109        let local_var_content = local_var_resp.text().await?;
2110
2111        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2112            match local_var_content_type {
2113                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2114                ContentType::Text => {
2115                    return Err(Error::from(serde_json::Error::custom(
2116                        "Received `text/plain` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`",
2117                    )));
2118                }
2119                ContentType::Unsupported(local_var_unknown_type) => {
2120                    return Err(Error::from(serde_json::Error::custom(format!(
2121                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::OptionalCipherDetailsResponseModel`"
2122                    ))));
2123                }
2124            }
2125        } else {
2126            let local_var_entity: Option<PutCollections_vNextError> =
2127                serde_json::from_str(&local_var_content).ok();
2128            let local_var_error = ResponseContent {
2129                status: local_var_status,
2130                content: local_var_content,
2131                entity: local_var_entity,
2132            };
2133            Err(Error::ResponseError(local_var_error))
2134        }
2135    }
2136
2137    async fn put_delete<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PutDeleteError>> {
2138        let local_var_configuration = &self.configuration;
2139
2140        let local_var_client = &local_var_configuration.client;
2141
2142        let local_var_uri_str = format!(
2143            "{}/ciphers/{id}/delete",
2144            local_var_configuration.base_path,
2145            id = id
2146        );
2147        let mut local_var_req_builder =
2148            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2149
2150        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2151            local_var_req_builder = local_var_req_builder
2152                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2153        }
2154        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2155            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2156        };
2157
2158        let local_var_req = local_var_req_builder.build()?;
2159        let local_var_resp = local_var_client.execute(local_var_req).await?;
2160
2161        let local_var_status = local_var_resp.status();
2162        let local_var_content = local_var_resp.text().await?;
2163
2164        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2165            Ok(())
2166        } else {
2167            let local_var_entity: Option<PutDeleteError> =
2168                serde_json::from_str(&local_var_content).ok();
2169            let local_var_error = ResponseContent {
2170                status: local_var_status,
2171                content: local_var_content,
2172                entity: local_var_entity,
2173            };
2174            Err(Error::ResponseError(local_var_error))
2175        }
2176    }
2177
2178    async fn put_delete_admin<'a>(&self, id: uuid::Uuid) -> Result<(), Error<PutDeleteAdminError>> {
2179        let local_var_configuration = &self.configuration;
2180
2181        let local_var_client = &local_var_configuration.client;
2182
2183        let local_var_uri_str = format!(
2184            "{}/ciphers/{id}/delete-admin",
2185            local_var_configuration.base_path,
2186            id = id
2187        );
2188        let mut local_var_req_builder =
2189            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2190
2191        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2192            local_var_req_builder = local_var_req_builder
2193                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2194        }
2195        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2196            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2197        };
2198
2199        let local_var_req = local_var_req_builder.build()?;
2200        let local_var_resp = local_var_client.execute(local_var_req).await?;
2201
2202        let local_var_status = local_var_resp.status();
2203        let local_var_content = local_var_resp.text().await?;
2204
2205        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2206            Ok(())
2207        } else {
2208            let local_var_entity: Option<PutDeleteAdminError> =
2209                serde_json::from_str(&local_var_content).ok();
2210            let local_var_error = ResponseContent {
2211                status: local_var_status,
2212                content: local_var_content,
2213                entity: local_var_entity,
2214            };
2215            Err(Error::ResponseError(local_var_error))
2216        }
2217    }
2218
2219    async fn put_delete_many<'a>(
2220        &self,
2221        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
2222    ) -> Result<(), Error<PutDeleteManyError>> {
2223        let local_var_configuration = &self.configuration;
2224
2225        let local_var_client = &local_var_configuration.client;
2226
2227        let local_var_uri_str = format!("{}/ciphers/delete", local_var_configuration.base_path);
2228        let mut local_var_req_builder =
2229            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2230
2231        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2232            local_var_req_builder = local_var_req_builder
2233                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2234        }
2235        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2236            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2237        };
2238        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_delete_request_model);
2239
2240        let local_var_req = local_var_req_builder.build()?;
2241        let local_var_resp = local_var_client.execute(local_var_req).await?;
2242
2243        let local_var_status = local_var_resp.status();
2244        let local_var_content = local_var_resp.text().await?;
2245
2246        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2247            Ok(())
2248        } else {
2249            let local_var_entity: Option<PutDeleteManyError> =
2250                serde_json::from_str(&local_var_content).ok();
2251            let local_var_error = ResponseContent {
2252                status: local_var_status,
2253                content: local_var_content,
2254                entity: local_var_entity,
2255            };
2256            Err(Error::ResponseError(local_var_error))
2257        }
2258    }
2259
2260    async fn put_delete_many_admin<'a>(
2261        &self,
2262        cipher_bulk_delete_request_model: Option<models::CipherBulkDeleteRequestModel>,
2263    ) -> Result<(), Error<PutDeleteManyAdminError>> {
2264        let local_var_configuration = &self.configuration;
2265
2266        let local_var_client = &local_var_configuration.client;
2267
2268        let local_var_uri_str =
2269            format!("{}/ciphers/delete-admin", local_var_configuration.base_path);
2270        let mut local_var_req_builder =
2271            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2272
2273        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2274            local_var_req_builder = local_var_req_builder
2275                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2276        }
2277        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2278            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2279        };
2280        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_delete_request_model);
2281
2282        let local_var_req = local_var_req_builder.build()?;
2283        let local_var_resp = local_var_client.execute(local_var_req).await?;
2284
2285        let local_var_status = local_var_resp.status();
2286        let local_var_content = local_var_resp.text().await?;
2287
2288        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2289            Ok(())
2290        } else {
2291            let local_var_entity: Option<PutDeleteManyAdminError> =
2292                serde_json::from_str(&local_var_content).ok();
2293            let local_var_error = ResponseContent {
2294                status: local_var_status,
2295                content: local_var_content,
2296                entity: local_var_entity,
2297            };
2298            Err(Error::ResponseError(local_var_error))
2299        }
2300    }
2301
2302    async fn put_partial<'a>(
2303        &self,
2304        id: uuid::Uuid,
2305        cipher_partial_request_model: Option<models::CipherPartialRequestModel>,
2306    ) -> Result<models::CipherResponseModel, Error<PutPartialError>> {
2307        let local_var_configuration = &self.configuration;
2308
2309        let local_var_client = &local_var_configuration.client;
2310
2311        let local_var_uri_str = format!(
2312            "{}/ciphers/{id}/partial",
2313            local_var_configuration.base_path,
2314            id = id
2315        );
2316        let mut local_var_req_builder =
2317            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2318
2319        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2320            local_var_req_builder = local_var_req_builder
2321                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2322        }
2323        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2324            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2325        };
2326        local_var_req_builder = local_var_req_builder.json(&cipher_partial_request_model);
2327
2328        let local_var_req = local_var_req_builder.build()?;
2329        let local_var_resp = local_var_client.execute(local_var_req).await?;
2330
2331        let local_var_status = local_var_resp.status();
2332        let local_var_content_type = local_var_resp
2333            .headers()
2334            .get("content-type")
2335            .and_then(|v| v.to_str().ok())
2336            .unwrap_or("application/octet-stream");
2337        let local_var_content_type = super::ContentType::from(local_var_content_type);
2338        let local_var_content = local_var_resp.text().await?;
2339
2340        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2341            match local_var_content_type {
2342                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2343                ContentType::Text => {
2344                    return Err(Error::from(serde_json::Error::custom(
2345                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
2346                    )));
2347                }
2348                ContentType::Unsupported(local_var_unknown_type) => {
2349                    return Err(Error::from(serde_json::Error::custom(format!(
2350                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
2351                    ))));
2352                }
2353            }
2354        } else {
2355            let local_var_entity: Option<PutPartialError> =
2356                serde_json::from_str(&local_var_content).ok();
2357            let local_var_error = ResponseContent {
2358                status: local_var_status,
2359                content: local_var_content,
2360                entity: local_var_entity,
2361            };
2362            Err(Error::ResponseError(local_var_error))
2363        }
2364    }
2365
2366    async fn put_restore<'a>(
2367        &self,
2368        id: uuid::Uuid,
2369    ) -> Result<models::CipherResponseModel, Error<PutRestoreError>> {
2370        let local_var_configuration = &self.configuration;
2371
2372        let local_var_client = &local_var_configuration.client;
2373
2374        let local_var_uri_str = format!(
2375            "{}/ciphers/{id}/restore",
2376            local_var_configuration.base_path,
2377            id = id
2378        );
2379        let mut local_var_req_builder =
2380            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2381
2382        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2383            local_var_req_builder = local_var_req_builder
2384                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2385        }
2386        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2387            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2388        };
2389
2390        let local_var_req = local_var_req_builder.build()?;
2391        let local_var_resp = local_var_client.execute(local_var_req).await?;
2392
2393        let local_var_status = local_var_resp.status();
2394        let local_var_content_type = local_var_resp
2395            .headers()
2396            .get("content-type")
2397            .and_then(|v| v.to_str().ok())
2398            .unwrap_or("application/octet-stream");
2399        let local_var_content_type = super::ContentType::from(local_var_content_type);
2400        let local_var_content = local_var_resp.text().await?;
2401
2402        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2403            match local_var_content_type {
2404                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2405                ContentType::Text => {
2406                    return Err(Error::from(serde_json::Error::custom(
2407                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
2408                    )));
2409                }
2410                ContentType::Unsupported(local_var_unknown_type) => {
2411                    return Err(Error::from(serde_json::Error::custom(format!(
2412                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
2413                    ))));
2414                }
2415            }
2416        } else {
2417            let local_var_entity: Option<PutRestoreError> =
2418                serde_json::from_str(&local_var_content).ok();
2419            let local_var_error = ResponseContent {
2420                status: local_var_status,
2421                content: local_var_content,
2422                entity: local_var_entity,
2423            };
2424            Err(Error::ResponseError(local_var_error))
2425        }
2426    }
2427
2428    async fn put_restore_admin<'a>(
2429        &self,
2430        id: uuid::Uuid,
2431    ) -> Result<models::CipherMiniResponseModel, Error<PutRestoreAdminError>> {
2432        let local_var_configuration = &self.configuration;
2433
2434        let local_var_client = &local_var_configuration.client;
2435
2436        let local_var_uri_str = format!(
2437            "{}/ciphers/{id}/restore-admin",
2438            local_var_configuration.base_path,
2439            id = id
2440        );
2441        let mut local_var_req_builder =
2442            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2443
2444        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2445            local_var_req_builder = local_var_req_builder
2446                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2447        }
2448        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2449            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2450        };
2451
2452        let local_var_req = local_var_req_builder.build()?;
2453        let local_var_resp = local_var_client.execute(local_var_req).await?;
2454
2455        let local_var_status = local_var_resp.status();
2456        let local_var_content_type = local_var_resp
2457            .headers()
2458            .get("content-type")
2459            .and_then(|v| v.to_str().ok())
2460            .unwrap_or("application/octet-stream");
2461        let local_var_content_type = super::ContentType::from(local_var_content_type);
2462        let local_var_content = local_var_resp.text().await?;
2463
2464        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2465            match local_var_content_type {
2466                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2467                ContentType::Text => {
2468                    return Err(Error::from(serde_json::Error::custom(
2469                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
2470                    )));
2471                }
2472                ContentType::Unsupported(local_var_unknown_type) => {
2473                    return Err(Error::from(serde_json::Error::custom(format!(
2474                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
2475                    ))));
2476                }
2477            }
2478        } else {
2479            let local_var_entity: Option<PutRestoreAdminError> =
2480                serde_json::from_str(&local_var_content).ok();
2481            let local_var_error = ResponseContent {
2482                status: local_var_status,
2483                content: local_var_content,
2484                entity: local_var_entity,
2485            };
2486            Err(Error::ResponseError(local_var_error))
2487        }
2488    }
2489
2490    async fn put_restore_many<'a>(
2491        &self,
2492        cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
2493    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutRestoreManyError>> {
2494        let local_var_configuration = &self.configuration;
2495
2496        let local_var_client = &local_var_configuration.client;
2497
2498        let local_var_uri_str = format!("{}/ciphers/restore", local_var_configuration.base_path);
2499        let mut local_var_req_builder =
2500            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2501
2502        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2503            local_var_req_builder = local_var_req_builder
2504                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2505        }
2506        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2507            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2508        };
2509        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_restore_request_model);
2510
2511        let local_var_req = local_var_req_builder.build()?;
2512        let local_var_resp = local_var_client.execute(local_var_req).await?;
2513
2514        let local_var_status = local_var_resp.status();
2515        let local_var_content_type = local_var_resp
2516            .headers()
2517            .get("content-type")
2518            .and_then(|v| v.to_str().ok())
2519            .unwrap_or("application/octet-stream");
2520        let local_var_content_type = super::ContentType::from(local_var_content_type);
2521        let local_var_content = local_var_resp.text().await?;
2522
2523        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2524            match local_var_content_type {
2525                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2526                ContentType::Text => {
2527                    return Err(Error::from(serde_json::Error::custom(
2528                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`",
2529                    )));
2530                }
2531                ContentType::Unsupported(local_var_unknown_type) => {
2532                    return Err(Error::from(serde_json::Error::custom(format!(
2533                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"
2534                    ))));
2535                }
2536            }
2537        } else {
2538            let local_var_entity: Option<PutRestoreManyError> =
2539                serde_json::from_str(&local_var_content).ok();
2540            let local_var_error = ResponseContent {
2541                status: local_var_status,
2542                content: local_var_content,
2543                entity: local_var_entity,
2544            };
2545            Err(Error::ResponseError(local_var_error))
2546        }
2547    }
2548
2549    async fn put_restore_many_admin<'a>(
2550        &self,
2551        cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
2552    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutRestoreManyAdminError>>
2553    {
2554        let local_var_configuration = &self.configuration;
2555
2556        let local_var_client = &local_var_configuration.client;
2557
2558        let local_var_uri_str = format!(
2559            "{}/ciphers/restore-admin",
2560            local_var_configuration.base_path
2561        );
2562        let mut local_var_req_builder =
2563            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2564
2565        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2566            local_var_req_builder = local_var_req_builder
2567                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2568        }
2569        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2570            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2571        };
2572        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_restore_request_model);
2573
2574        let local_var_req = local_var_req_builder.build()?;
2575        let local_var_resp = local_var_client.execute(local_var_req).await?;
2576
2577        let local_var_status = local_var_resp.status();
2578        let local_var_content_type = local_var_resp
2579            .headers()
2580            .get("content-type")
2581            .and_then(|v| v.to_str().ok())
2582            .unwrap_or("application/octet-stream");
2583        let local_var_content_type = super::ContentType::from(local_var_content_type);
2584        let local_var_content = local_var_resp.text().await?;
2585
2586        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2587            match local_var_content_type {
2588                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2589                ContentType::Text => {
2590                    return Err(Error::from(serde_json::Error::custom(
2591                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`",
2592                    )));
2593                }
2594                ContentType::Unsupported(local_var_unknown_type) => {
2595                    return Err(Error::from(serde_json::Error::custom(format!(
2596                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"
2597                    ))));
2598                }
2599            }
2600        } else {
2601            let local_var_entity: Option<PutRestoreManyAdminError> =
2602                serde_json::from_str(&local_var_content).ok();
2603            let local_var_error = ResponseContent {
2604                status: local_var_status,
2605                content: local_var_content,
2606                entity: local_var_entity,
2607            };
2608            Err(Error::ResponseError(local_var_error))
2609        }
2610    }
2611
2612    async fn put_share<'a>(
2613        &self,
2614        id: uuid::Uuid,
2615        cipher_share_request_model: Option<models::CipherShareRequestModel>,
2616    ) -> Result<models::CipherResponseModel, Error<PutShareError>> {
2617        let local_var_configuration = &self.configuration;
2618
2619        let local_var_client = &local_var_configuration.client;
2620
2621        let local_var_uri_str = format!(
2622            "{}/ciphers/{id}/share",
2623            local_var_configuration.base_path,
2624            id = id
2625        );
2626        let mut local_var_req_builder =
2627            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2628
2629        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2630            local_var_req_builder = local_var_req_builder
2631                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2632        }
2633        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2634            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2635        };
2636        local_var_req_builder = local_var_req_builder.json(&cipher_share_request_model);
2637
2638        let local_var_req = local_var_req_builder.build()?;
2639        let local_var_resp = local_var_client.execute(local_var_req).await?;
2640
2641        let local_var_status = local_var_resp.status();
2642        let local_var_content_type = local_var_resp
2643            .headers()
2644            .get("content-type")
2645            .and_then(|v| v.to_str().ok())
2646            .unwrap_or("application/octet-stream");
2647        let local_var_content_type = super::ContentType::from(local_var_content_type);
2648        let local_var_content = local_var_resp.text().await?;
2649
2650        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2651            match local_var_content_type {
2652                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2653                ContentType::Text => {
2654                    return Err(Error::from(serde_json::Error::custom(
2655                        "Received `text/plain` content type response that cannot be converted to `models::CipherResponseModel`",
2656                    )));
2657                }
2658                ContentType::Unsupported(local_var_unknown_type) => {
2659                    return Err(Error::from(serde_json::Error::custom(format!(
2660                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherResponseModel`"
2661                    ))));
2662                }
2663            }
2664        } else {
2665            let local_var_entity: Option<PutShareError> =
2666                serde_json::from_str(&local_var_content).ok();
2667            let local_var_error = ResponseContent {
2668                status: local_var_status,
2669                content: local_var_content,
2670                entity: local_var_entity,
2671            };
2672            Err(Error::ResponseError(local_var_error))
2673        }
2674    }
2675
2676    async fn put_share_many<'a>(
2677        &self,
2678        cipher_bulk_share_request_model: Option<models::CipherBulkShareRequestModel>,
2679    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutShareManyError>> {
2680        let local_var_configuration = &self.configuration;
2681
2682        let local_var_client = &local_var_configuration.client;
2683
2684        let local_var_uri_str = format!("{}/ciphers/share", local_var_configuration.base_path);
2685        let mut local_var_req_builder =
2686            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2687
2688        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2689            local_var_req_builder = local_var_req_builder
2690                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2691        }
2692        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2693            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2694        };
2695        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_share_request_model);
2696
2697        let local_var_req = local_var_req_builder.build()?;
2698        let local_var_resp = local_var_client.execute(local_var_req).await?;
2699
2700        let local_var_status = local_var_resp.status();
2701        let local_var_content_type = local_var_resp
2702            .headers()
2703            .get("content-type")
2704            .and_then(|v| v.to_str().ok())
2705            .unwrap_or("application/octet-stream");
2706        let local_var_content_type = super::ContentType::from(local_var_content_type);
2707        let local_var_content = local_var_resp.text().await?;
2708
2709        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2710            match local_var_content_type {
2711                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2712                ContentType::Text => {
2713                    return Err(Error::from(serde_json::Error::custom(
2714                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`",
2715                    )));
2716                }
2717                ContentType::Unsupported(local_var_unknown_type) => {
2718                    return Err(Error::from(serde_json::Error::custom(format!(
2719                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"
2720                    ))));
2721                }
2722            }
2723        } else {
2724            let local_var_entity: Option<PutShareManyError> =
2725                serde_json::from_str(&local_var_content).ok();
2726            let local_var_error = ResponseContent {
2727                status: local_var_status,
2728                content: local_var_content,
2729                entity: local_var_entity,
2730            };
2731            Err(Error::ResponseError(local_var_error))
2732        }
2733    }
2734
2735    async fn put_unarchive<'a>(
2736        &self,
2737        id: uuid::Uuid,
2738    ) -> Result<models::CipherMiniResponseModel, Error<PutUnarchiveError>> {
2739        let local_var_configuration = &self.configuration;
2740
2741        let local_var_client = &local_var_configuration.client;
2742
2743        let local_var_uri_str = format!(
2744            "{}/ciphers/{id}/unarchive",
2745            local_var_configuration.base_path,
2746            id = id
2747        );
2748        let mut local_var_req_builder =
2749            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2750
2751        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2752            local_var_req_builder = local_var_req_builder
2753                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2754        }
2755        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2756            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2757        };
2758
2759        let local_var_req = local_var_req_builder.build()?;
2760        let local_var_resp = local_var_client.execute(local_var_req).await?;
2761
2762        let local_var_status = local_var_resp.status();
2763        let local_var_content_type = local_var_resp
2764            .headers()
2765            .get("content-type")
2766            .and_then(|v| v.to_str().ok())
2767            .unwrap_or("application/octet-stream");
2768        let local_var_content_type = super::ContentType::from(local_var_content_type);
2769        let local_var_content = local_var_resp.text().await?;
2770
2771        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2772            match local_var_content_type {
2773                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2774                ContentType::Text => {
2775                    return Err(Error::from(serde_json::Error::custom(
2776                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`",
2777                    )));
2778                }
2779                ContentType::Unsupported(local_var_unknown_type) => {
2780                    return Err(Error::from(serde_json::Error::custom(format!(
2781                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`"
2782                    ))));
2783                }
2784            }
2785        } else {
2786            let local_var_entity: Option<PutUnarchiveError> =
2787                serde_json::from_str(&local_var_content).ok();
2788            let local_var_error = ResponseContent {
2789                status: local_var_status,
2790                content: local_var_content,
2791                entity: local_var_entity,
2792            };
2793            Err(Error::ResponseError(local_var_error))
2794        }
2795    }
2796
2797    async fn put_unarchive_many<'a>(
2798        &self,
2799        cipher_bulk_unarchive_request_model: Option<models::CipherBulkUnarchiveRequestModel>,
2800    ) -> Result<models::CipherMiniResponseModelListResponseModel, Error<PutUnarchiveManyError>>
2801    {
2802        let local_var_configuration = &self.configuration;
2803
2804        let local_var_client = &local_var_configuration.client;
2805
2806        let local_var_uri_str = format!("{}/ciphers/unarchive", local_var_configuration.base_path);
2807        let mut local_var_req_builder =
2808            local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2809
2810        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2811            local_var_req_builder = local_var_req_builder
2812                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2813        }
2814        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2815            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2816        };
2817        local_var_req_builder = local_var_req_builder.json(&cipher_bulk_unarchive_request_model);
2818
2819        let local_var_req = local_var_req_builder.build()?;
2820        let local_var_resp = local_var_client.execute(local_var_req).await?;
2821
2822        let local_var_status = local_var_resp.status();
2823        let local_var_content_type = local_var_resp
2824            .headers()
2825            .get("content-type")
2826            .and_then(|v| v.to_str().ok())
2827            .unwrap_or("application/octet-stream");
2828        let local_var_content_type = super::ContentType::from(local_var_content_type);
2829        let local_var_content = local_var_resp.text().await?;
2830
2831        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2832            match local_var_content_type {
2833                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2834                ContentType::Text => {
2835                    return Err(Error::from(serde_json::Error::custom(
2836                        "Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`",
2837                    )));
2838                }
2839                ContentType::Unsupported(local_var_unknown_type) => {
2840                    return Err(Error::from(serde_json::Error::custom(format!(
2841                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"
2842                    ))));
2843                }
2844            }
2845        } else {
2846            let local_var_entity: Option<PutUnarchiveManyError> =
2847                serde_json::from_str(&local_var_content).ok();
2848            let local_var_error = ResponseContent {
2849                status: local_var_status,
2850                content: local_var_content,
2851                entity: local_var_entity,
2852            };
2853            Err(Error::ResponseError(local_var_error))
2854        }
2855    }
2856
2857    async fn renew_file_upload_url<'a>(
2858        &self,
2859        id: uuid::Uuid,
2860        attachment_id: &'a str,
2861    ) -> Result<models::AttachmentUploadDataResponseModel, Error<RenewFileUploadUrlError>> {
2862        let local_var_configuration = &self.configuration;
2863
2864        let local_var_client = &local_var_configuration.client;
2865
2866        let local_var_uri_str = format!(
2867            "{}/ciphers/{id}/attachment/{attachmentId}/renew",
2868            local_var_configuration.base_path,
2869            id = id,
2870            attachmentId = crate::apis::urlencode(attachment_id)
2871        );
2872        let mut local_var_req_builder =
2873            local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2874
2875        if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2876            local_var_req_builder = local_var_req_builder
2877                .header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2878        }
2879        if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2880            local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2881        };
2882
2883        let local_var_req = local_var_req_builder.build()?;
2884        let local_var_resp = local_var_client.execute(local_var_req).await?;
2885
2886        let local_var_status = local_var_resp.status();
2887        let local_var_content_type = local_var_resp
2888            .headers()
2889            .get("content-type")
2890            .and_then(|v| v.to_str().ok())
2891            .unwrap_or("application/octet-stream");
2892        let local_var_content_type = super::ContentType::from(local_var_content_type);
2893        let local_var_content = local_var_resp.text().await?;
2894
2895        if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2896            match local_var_content_type {
2897                ContentType::Json => serde_json::from_str(&local_var_content).map_err(Error::from),
2898                ContentType::Text => {
2899                    return Err(Error::from(serde_json::Error::custom(
2900                        "Received `text/plain` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`",
2901                    )));
2902                }
2903                ContentType::Unsupported(local_var_unknown_type) => {
2904                    return Err(Error::from(serde_json::Error::custom(format!(
2905                        "Received `{local_var_unknown_type}` content type response that cannot be converted to `models::AttachmentUploadDataResponseModel`"
2906                    ))));
2907                }
2908            }
2909        } else {
2910            let local_var_entity: Option<RenewFileUploadUrlError> =
2911                serde_json::from_str(&local_var_content).ok();
2912            let local_var_error = ResponseContent {
2913                status: local_var_status,
2914                content: local_var_content,
2915                entity: local_var_entity,
2916            };
2917            Err(Error::ResponseError(local_var_error))
2918        }
2919    }
2920}
2921
2922/// struct for typed errors of method [`CiphersApi::azure_validate_file`]
2923#[derive(Debug, Clone, Serialize, Deserialize)]
2924#[serde(untagged)]
2925pub enum AzureValidateFileError {
2926    UnknownValue(serde_json::Value),
2927}
2928/// struct for typed errors of method [`CiphersApi::delete`]
2929#[derive(Debug, Clone, Serialize, Deserialize)]
2930#[serde(untagged)]
2931pub enum DeleteError {
2932    UnknownValue(serde_json::Value),
2933}
2934/// struct for typed errors of method [`CiphersApi::delete_admin`]
2935#[derive(Debug, Clone, Serialize, Deserialize)]
2936#[serde(untagged)]
2937pub enum DeleteAdminError {
2938    UnknownValue(serde_json::Value),
2939}
2940/// struct for typed errors of method [`CiphersApi::delete_attachment`]
2941#[derive(Debug, Clone, Serialize, Deserialize)]
2942#[serde(untagged)]
2943pub enum DeleteAttachmentError {
2944    UnknownValue(serde_json::Value),
2945}
2946/// struct for typed errors of method [`CiphersApi::delete_attachment_admin`]
2947#[derive(Debug, Clone, Serialize, Deserialize)]
2948#[serde(untagged)]
2949pub enum DeleteAttachmentAdminError {
2950    UnknownValue(serde_json::Value),
2951}
2952/// struct for typed errors of method [`CiphersApi::delete_many`]
2953#[derive(Debug, Clone, Serialize, Deserialize)]
2954#[serde(untagged)]
2955pub enum DeleteManyError {
2956    UnknownValue(serde_json::Value),
2957}
2958/// struct for typed errors of method [`CiphersApi::delete_many_admin`]
2959#[derive(Debug, Clone, Serialize, Deserialize)]
2960#[serde(untagged)]
2961pub enum DeleteManyAdminError {
2962    UnknownValue(serde_json::Value),
2963}
2964/// struct for typed errors of method [`CiphersApi::get`]
2965#[derive(Debug, Clone, Serialize, Deserialize)]
2966#[serde(untagged)]
2967pub enum GetError {
2968    UnknownValue(serde_json::Value),
2969}
2970/// struct for typed errors of method [`CiphersApi::get_admin`]
2971#[derive(Debug, Clone, Serialize, Deserialize)]
2972#[serde(untagged)]
2973pub enum GetAdminError {
2974    UnknownValue(serde_json::Value),
2975}
2976/// struct for typed errors of method [`CiphersApi::get_all`]
2977#[derive(Debug, Clone, Serialize, Deserialize)]
2978#[serde(untagged)]
2979pub enum GetAllError {
2980    UnknownValue(serde_json::Value),
2981}
2982/// struct for typed errors of method [`CiphersApi::get_assigned_organization_ciphers`]
2983#[derive(Debug, Clone, Serialize, Deserialize)]
2984#[serde(untagged)]
2985pub enum GetAssignedOrganizationCiphersError {
2986    UnknownValue(serde_json::Value),
2987}
2988/// struct for typed errors of method [`CiphersApi::get_attachment_data`]
2989#[derive(Debug, Clone, Serialize, Deserialize)]
2990#[serde(untagged)]
2991pub enum GetAttachmentDataError {
2992    UnknownValue(serde_json::Value),
2993}
2994/// struct for typed errors of method [`CiphersApi::get_attachment_data_admin`]
2995#[derive(Debug, Clone, Serialize, Deserialize)]
2996#[serde(untagged)]
2997pub enum GetAttachmentDataAdminError {
2998    UnknownValue(serde_json::Value),
2999}
3000/// struct for typed errors of method [`CiphersApi::get_details`]
3001#[derive(Debug, Clone, Serialize, Deserialize)]
3002#[serde(untagged)]
3003pub enum GetDetailsError {
3004    UnknownValue(serde_json::Value),
3005}
3006/// struct for typed errors of method [`CiphersApi::get_organization_ciphers`]
3007#[derive(Debug, Clone, Serialize, Deserialize)]
3008#[serde(untagged)]
3009pub enum GetOrganizationCiphersError {
3010    UnknownValue(serde_json::Value),
3011}
3012/// struct for typed errors of method [`CiphersApi::move_many`]
3013#[derive(Debug, Clone, Serialize, Deserialize)]
3014#[serde(untagged)]
3015pub enum MoveManyError {
3016    UnknownValue(serde_json::Value),
3017}
3018/// struct for typed errors of method [`CiphersApi::post`]
3019#[derive(Debug, Clone, Serialize, Deserialize)]
3020#[serde(untagged)]
3021pub enum PostError {
3022    UnknownValue(serde_json::Value),
3023}
3024/// struct for typed errors of method [`CiphersApi::post_admin`]
3025#[derive(Debug, Clone, Serialize, Deserialize)]
3026#[serde(untagged)]
3027pub enum PostAdminError {
3028    UnknownValue(serde_json::Value),
3029}
3030/// struct for typed errors of method [`CiphersApi::post_attachment`]
3031#[derive(Debug, Clone, Serialize, Deserialize)]
3032#[serde(untagged)]
3033pub enum PostAttachmentError {
3034    UnknownValue(serde_json::Value),
3035}
3036/// struct for typed errors of method [`CiphersApi::post_attachment_admin`]
3037#[derive(Debug, Clone, Serialize, Deserialize)]
3038#[serde(untagged)]
3039pub enum PostAttachmentAdminError {
3040    UnknownValue(serde_json::Value),
3041}
3042/// struct for typed errors of method [`CiphersApi::post_attachment_share`]
3043#[derive(Debug, Clone, Serialize, Deserialize)]
3044#[serde(untagged)]
3045pub enum PostAttachmentShareError {
3046    UnknownValue(serde_json::Value),
3047}
3048/// struct for typed errors of method [`CiphersApi::post_bulk_collections`]
3049#[derive(Debug, Clone, Serialize, Deserialize)]
3050#[serde(untagged)]
3051pub enum PostBulkCollectionsError {
3052    UnknownValue(serde_json::Value),
3053}
3054/// struct for typed errors of method [`CiphersApi::post_create`]
3055#[derive(Debug, Clone, Serialize, Deserialize)]
3056#[serde(untagged)]
3057pub enum PostCreateError {
3058    UnknownValue(serde_json::Value),
3059}
3060/// struct for typed errors of method [`CiphersApi::post_file_for_existing_attachment`]
3061#[derive(Debug, Clone, Serialize, Deserialize)]
3062#[serde(untagged)]
3063pub enum PostFileForExistingAttachmentError {
3064    UnknownValue(serde_json::Value),
3065}
3066/// struct for typed errors of method [`CiphersApi::post_purge`]
3067#[derive(Debug, Clone, Serialize, Deserialize)]
3068#[serde(untagged)]
3069pub enum PostPurgeError {
3070    UnknownValue(serde_json::Value),
3071}
3072/// struct for typed errors of method [`CiphersApi::put`]
3073#[derive(Debug, Clone, Serialize, Deserialize)]
3074#[serde(untagged)]
3075pub enum PutError {
3076    UnknownValue(serde_json::Value),
3077}
3078/// struct for typed errors of method [`CiphersApi::put_admin`]
3079#[derive(Debug, Clone, Serialize, Deserialize)]
3080#[serde(untagged)]
3081pub enum PutAdminError {
3082    UnknownValue(serde_json::Value),
3083}
3084/// struct for typed errors of method [`CiphersApi::put_archive`]
3085#[derive(Debug, Clone, Serialize, Deserialize)]
3086#[serde(untagged)]
3087pub enum PutArchiveError {
3088    UnknownValue(serde_json::Value),
3089}
3090/// struct for typed errors of method [`CiphersApi::put_archive_many`]
3091#[derive(Debug, Clone, Serialize, Deserialize)]
3092#[serde(untagged)]
3093pub enum PutArchiveManyError {
3094    UnknownValue(serde_json::Value),
3095}
3096/// struct for typed errors of method [`CiphersApi::put_collections`]
3097#[derive(Debug, Clone, Serialize, Deserialize)]
3098#[serde(untagged)]
3099pub enum PutCollectionsError {
3100    UnknownValue(serde_json::Value),
3101}
3102/// struct for typed errors of method [`CiphersApi::put_collections_admin`]
3103#[derive(Debug, Clone, Serialize, Deserialize)]
3104#[serde(untagged)]
3105pub enum PutCollectionsAdminError {
3106    UnknownValue(serde_json::Value),
3107}
3108/// struct for typed errors of method [`CiphersApi::put_collections_v_next`]
3109#[derive(Debug, Clone, Serialize, Deserialize)]
3110#[serde(untagged)]
3111pub enum PutCollections_vNextError {
3112    UnknownValue(serde_json::Value),
3113}
3114/// struct for typed errors of method [`CiphersApi::put_delete`]
3115#[derive(Debug, Clone, Serialize, Deserialize)]
3116#[serde(untagged)]
3117pub enum PutDeleteError {
3118    UnknownValue(serde_json::Value),
3119}
3120/// struct for typed errors of method [`CiphersApi::put_delete_admin`]
3121#[derive(Debug, Clone, Serialize, Deserialize)]
3122#[serde(untagged)]
3123pub enum PutDeleteAdminError {
3124    UnknownValue(serde_json::Value),
3125}
3126/// struct for typed errors of method [`CiphersApi::put_delete_many`]
3127#[derive(Debug, Clone, Serialize, Deserialize)]
3128#[serde(untagged)]
3129pub enum PutDeleteManyError {
3130    UnknownValue(serde_json::Value),
3131}
3132/// struct for typed errors of method [`CiphersApi::put_delete_many_admin`]
3133#[derive(Debug, Clone, Serialize, Deserialize)]
3134#[serde(untagged)]
3135pub enum PutDeleteManyAdminError {
3136    UnknownValue(serde_json::Value),
3137}
3138/// struct for typed errors of method [`CiphersApi::put_partial`]
3139#[derive(Debug, Clone, Serialize, Deserialize)]
3140#[serde(untagged)]
3141pub enum PutPartialError {
3142    UnknownValue(serde_json::Value),
3143}
3144/// struct for typed errors of method [`CiphersApi::put_restore`]
3145#[derive(Debug, Clone, Serialize, Deserialize)]
3146#[serde(untagged)]
3147pub enum PutRestoreError {
3148    UnknownValue(serde_json::Value),
3149}
3150/// struct for typed errors of method [`CiphersApi::put_restore_admin`]
3151#[derive(Debug, Clone, Serialize, Deserialize)]
3152#[serde(untagged)]
3153pub enum PutRestoreAdminError {
3154    UnknownValue(serde_json::Value),
3155}
3156/// struct for typed errors of method [`CiphersApi::put_restore_many`]
3157#[derive(Debug, Clone, Serialize, Deserialize)]
3158#[serde(untagged)]
3159pub enum PutRestoreManyError {
3160    UnknownValue(serde_json::Value),
3161}
3162/// struct for typed errors of method [`CiphersApi::put_restore_many_admin`]
3163#[derive(Debug, Clone, Serialize, Deserialize)]
3164#[serde(untagged)]
3165pub enum PutRestoreManyAdminError {
3166    UnknownValue(serde_json::Value),
3167}
3168/// struct for typed errors of method [`CiphersApi::put_share`]
3169#[derive(Debug, Clone, Serialize, Deserialize)]
3170#[serde(untagged)]
3171pub enum PutShareError {
3172    UnknownValue(serde_json::Value),
3173}
3174/// struct for typed errors of method [`CiphersApi::put_share_many`]
3175#[derive(Debug, Clone, Serialize, Deserialize)]
3176#[serde(untagged)]
3177pub enum PutShareManyError {
3178    UnknownValue(serde_json::Value),
3179}
3180/// struct for typed errors of method [`CiphersApi::put_unarchive`]
3181#[derive(Debug, Clone, Serialize, Deserialize)]
3182#[serde(untagged)]
3183pub enum PutUnarchiveError {
3184    UnknownValue(serde_json::Value),
3185}
3186/// struct for typed errors of method [`CiphersApi::put_unarchive_many`]
3187#[derive(Debug, Clone, Serialize, Deserialize)]
3188#[serde(untagged)]
3189pub enum PutUnarchiveManyError {
3190    UnknownValue(serde_json::Value),
3191}
3192/// struct for typed errors of method [`CiphersApi::renew_file_upload_url`]
3193#[derive(Debug, Clone, Serialize, Deserialize)]
3194#[serde(untagged)]
3195pub enum RenewFileUploadUrlError {
3196    UnknownValue(serde_json::Value),
3197}