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