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