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<models::DeleteAttachmentResponseData, Error<CiphersIdAttachmentAttachmentIdDeleteError>>
1154{
1155 let local_var_configuration = configuration;
1156
1157 let local_var_client = &local_var_configuration.client;
1158
1159 let local_var_uri_str = format!(
1160 "{}/ciphers/{id}/attachment/{attachmentId}",
1161 local_var_configuration.base_path,
1162 id = crate::apis::urlencode(id.to_string()),
1163 attachmentId = crate::apis::urlencode(attachment_id)
1164 );
1165 let mut local_var_req_builder =
1166 local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1167
1168 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1169 local_var_req_builder =
1170 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1171 }
1172 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1173 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1174 };
1175
1176 let local_var_req = local_var_req_builder.build()?;
1177 let local_var_resp = local_var_client.execute(local_var_req).await?;
1178
1179 let local_var_status = local_var_resp.status();
1180 let local_var_content = local_var_resp.text().await?;
1181
1182 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1183 serde_json::from_str(&local_var_content).map_err(Error::from)
1184 } else {
1185 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdDeleteError> =
1186 serde_json::from_str(&local_var_content).ok();
1187 let local_var_error = ResponseContent {
1188 status: local_var_status,
1189 content: local_var_content,
1190 entity: local_var_entity,
1191 };
1192 Err(Error::ResponseError(local_var_error))
1193 }
1194}
1195
1196pub async fn ciphers_id_attachment_attachment_id_delete_admin_post(
1197 configuration: &configuration::Configuration,
1198 id: &str,
1199 attachment_id: &str,
1200) -> Result<(), Error<CiphersIdAttachmentAttachmentIdDeleteAdminPostError>> {
1201 let local_var_configuration = configuration;
1202
1203 let local_var_client = &local_var_configuration.client;
1204
1205 let local_var_uri_str = format!(
1206 "{}/ciphers/{id}/attachment/{attachmentId}/delete-admin",
1207 local_var_configuration.base_path,
1208 id = crate::apis::urlencode(id),
1209 attachmentId = crate::apis::urlencode(attachment_id)
1210 );
1211 let mut local_var_req_builder =
1212 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1213
1214 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1215 local_var_req_builder =
1216 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1217 }
1218 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1219 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1220 };
1221
1222 let local_var_req = local_var_req_builder.build()?;
1223 let local_var_resp = local_var_client.execute(local_var_req).await?;
1224
1225 let local_var_status = local_var_resp.status();
1226 let local_var_content = local_var_resp.text().await?;
1227
1228 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1229 Ok(())
1230 } else {
1231 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdDeleteAdminPostError> =
1232 serde_json::from_str(&local_var_content).ok();
1233 let local_var_error = ResponseContent {
1234 status: local_var_status,
1235 content: local_var_content,
1236 entity: local_var_entity,
1237 };
1238 Err(Error::ResponseError(local_var_error))
1239 }
1240}
1241
1242pub async fn ciphers_id_attachment_attachment_id_delete_post(
1243 configuration: &configuration::Configuration,
1244 id: uuid::Uuid,
1245 attachment_id: &str,
1246) -> Result<
1247 models::DeleteAttachmentResponseData,
1248 Error<CiphersIdAttachmentAttachmentIdDeletePostError>,
1249> {
1250 let local_var_configuration = configuration;
1251
1252 let local_var_client = &local_var_configuration.client;
1253
1254 let local_var_uri_str = format!(
1255 "{}/ciphers/{id}/attachment/{attachmentId}/delete",
1256 local_var_configuration.base_path,
1257 id = crate::apis::urlencode(id.to_string()),
1258 attachmentId = crate::apis::urlencode(attachment_id)
1259 );
1260 let mut local_var_req_builder =
1261 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1262
1263 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1264 local_var_req_builder =
1265 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1266 }
1267 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1268 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1269 };
1270
1271 let local_var_req = local_var_req_builder.build()?;
1272 let local_var_resp = local_var_client.execute(local_var_req).await?;
1273
1274 let local_var_status = local_var_resp.status();
1275 let local_var_content = local_var_resp.text().await?;
1276
1277 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1278 serde_json::from_str(&local_var_content).map_err(Error::from)
1279 } else {
1280 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdDeletePostError> =
1281 serde_json::from_str(&local_var_content).ok();
1282 let local_var_error = ResponseContent {
1283 status: local_var_status,
1284 content: local_var_content,
1285 entity: local_var_entity,
1286 };
1287 Err(Error::ResponseError(local_var_error))
1288 }
1289}
1290
1291pub async fn ciphers_id_attachment_attachment_id_get(
1292 configuration: &configuration::Configuration,
1293 id: uuid::Uuid,
1294 attachment_id: &str,
1295) -> Result<models::AttachmentResponseModel, Error<CiphersIdAttachmentAttachmentIdGetError>> {
1296 let local_var_configuration = configuration;
1297
1298 let local_var_client = &local_var_configuration.client;
1299
1300 let local_var_uri_str = format!(
1301 "{}/ciphers/{id}/attachment/{attachmentId}",
1302 local_var_configuration.base_path,
1303 id = crate::apis::urlencode(id.to_string()),
1304 attachmentId = crate::apis::urlencode(attachment_id)
1305 );
1306 let mut local_var_req_builder =
1307 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1308
1309 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1310 local_var_req_builder =
1311 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1312 }
1313 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1314 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1315 };
1316
1317 let local_var_req = local_var_req_builder.build()?;
1318 let local_var_resp = local_var_client.execute(local_var_req).await?;
1319
1320 let local_var_status = local_var_resp.status();
1321 let local_var_content = local_var_resp.text().await?;
1322
1323 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1324 serde_json::from_str(&local_var_content).map_err(Error::from)
1325 } else {
1326 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdGetError> =
1327 serde_json::from_str(&local_var_content).ok();
1328 let local_var_error = ResponseContent {
1329 status: local_var_status,
1330 content: local_var_content,
1331 entity: local_var_entity,
1332 };
1333 Err(Error::ResponseError(local_var_error))
1334 }
1335}
1336
1337pub async fn ciphers_id_attachment_attachment_id_post(
1338 configuration: &configuration::Configuration,
1339 id: uuid::Uuid,
1340 attachment_id: &str,
1341) -> Result<(), Error<CiphersIdAttachmentAttachmentIdPostError>> {
1342 let local_var_configuration = configuration;
1343
1344 let local_var_client = &local_var_configuration.client;
1345
1346 let local_var_uri_str = format!(
1347 "{}/ciphers/{id}/attachment/{attachmentId}",
1348 local_var_configuration.base_path,
1349 id = crate::apis::urlencode(id.to_string()),
1350 attachmentId = crate::apis::urlencode(attachment_id)
1351 );
1352 let mut local_var_req_builder =
1353 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1354
1355 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1356 local_var_req_builder =
1357 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1358 }
1359 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1360 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1361 };
1362
1363 let local_var_req = local_var_req_builder.build()?;
1364 let local_var_resp = local_var_client.execute(local_var_req).await?;
1365
1366 let local_var_status = local_var_resp.status();
1367 let local_var_content = local_var_resp.text().await?;
1368
1369 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1370 Ok(())
1371 } else {
1372 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdPostError> =
1373 serde_json::from_str(&local_var_content).ok();
1374 let local_var_error = ResponseContent {
1375 status: local_var_status,
1376 content: local_var_content,
1377 entity: local_var_entity,
1378 };
1379 Err(Error::ResponseError(local_var_error))
1380 }
1381}
1382
1383pub async fn ciphers_id_attachment_attachment_id_renew_get(
1384 configuration: &configuration::Configuration,
1385 id: uuid::Uuid,
1386 attachment_id: &str,
1387) -> Result<
1388 models::AttachmentUploadDataResponseModel,
1389 Error<CiphersIdAttachmentAttachmentIdRenewGetError>,
1390> {
1391 let local_var_configuration = configuration;
1392
1393 let local_var_client = &local_var_configuration.client;
1394
1395 let local_var_uri_str = format!(
1396 "{}/ciphers/{id}/attachment/{attachmentId}/renew",
1397 local_var_configuration.base_path,
1398 id = crate::apis::urlencode(id.to_string()),
1399 attachmentId = crate::apis::urlencode(attachment_id)
1400 );
1401 let mut local_var_req_builder =
1402 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1403
1404 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1405 local_var_req_builder =
1406 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1407 }
1408 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1409 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1410 };
1411
1412 let local_var_req = local_var_req_builder.build()?;
1413 let local_var_resp = local_var_client.execute(local_var_req).await?;
1414
1415 let local_var_status = local_var_resp.status();
1416 let local_var_content = local_var_resp.text().await?;
1417
1418 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1419 serde_json::from_str(&local_var_content).map_err(Error::from)
1420 } else {
1421 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdRenewGetError> =
1422 serde_json::from_str(&local_var_content).ok();
1423 let local_var_error = ResponseContent {
1424 status: local_var_status,
1425 content: local_var_content,
1426 entity: local_var_entity,
1427 };
1428 Err(Error::ResponseError(local_var_error))
1429 }
1430}
1431
1432pub async fn ciphers_id_attachment_attachment_id_share_post(
1433 configuration: &configuration::Configuration,
1434 id: &str,
1435 attachment_id: &str,
1436 organization_id: Option<uuid::Uuid>,
1437) -> Result<(), Error<CiphersIdAttachmentAttachmentIdSharePostError>> {
1438 let local_var_configuration = configuration;
1439
1440 let local_var_client = &local_var_configuration.client;
1441
1442 let local_var_uri_str = format!(
1443 "{}/ciphers/{id}/attachment/{attachmentId}/share",
1444 local_var_configuration.base_path,
1445 id = crate::apis::urlencode(id),
1446 attachmentId = crate::apis::urlencode(attachment_id)
1447 );
1448 let mut local_var_req_builder =
1449 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1450
1451 if let Some(ref local_var_str) = organization_id {
1452 local_var_req_builder =
1453 local_var_req_builder.query(&[("organizationId", &local_var_str.to_string())]);
1454 }
1455 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1456 local_var_req_builder =
1457 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1458 }
1459 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1460 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1461 };
1462
1463 let local_var_req = local_var_req_builder.build()?;
1464 let local_var_resp = local_var_client.execute(local_var_req).await?;
1465
1466 let local_var_status = local_var_resp.status();
1467 let local_var_content = local_var_resp.text().await?;
1468
1469 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1470 Ok(())
1471 } else {
1472 let local_var_entity: Option<CiphersIdAttachmentAttachmentIdSharePostError> =
1473 serde_json::from_str(&local_var_content).ok();
1474 let local_var_error = ResponseContent {
1475 status: local_var_status,
1476 content: local_var_content,
1477 entity: local_var_entity,
1478 };
1479 Err(Error::ResponseError(local_var_error))
1480 }
1481}
1482
1483pub async fn ciphers_id_attachment_post(
1484 configuration: &configuration::Configuration,
1485 id: uuid::Uuid,
1486) -> Result<models::CipherResponseModel, Error<CiphersIdAttachmentPostError>> {
1487 let local_var_configuration = configuration;
1488
1489 let local_var_client = &local_var_configuration.client;
1490
1491 let local_var_uri_str = format!(
1492 "{}/ciphers/{id}/attachment",
1493 local_var_configuration.base_path,
1494 id = crate::apis::urlencode(id.to_string())
1495 );
1496 let mut local_var_req_builder =
1497 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1498
1499 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1500 local_var_req_builder =
1501 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1502 }
1503 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1504 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1505 };
1506
1507 let local_var_req = local_var_req_builder.build()?;
1508 let local_var_resp = local_var_client.execute(local_var_req).await?;
1509
1510 let local_var_status = local_var_resp.status();
1511 let local_var_content = local_var_resp.text().await?;
1512
1513 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1514 serde_json::from_str(&local_var_content).map_err(Error::from)
1515 } else {
1516 let local_var_entity: Option<CiphersIdAttachmentPostError> =
1517 serde_json::from_str(&local_var_content).ok();
1518 let local_var_error = ResponseContent {
1519 status: local_var_status,
1520 content: local_var_content,
1521 entity: local_var_entity,
1522 };
1523 Err(Error::ResponseError(local_var_error))
1524 }
1525}
1526
1527pub async fn ciphers_id_attachment_v2_post(
1528 configuration: &configuration::Configuration,
1529 id: uuid::Uuid,
1530 attachment_request_model: Option<models::AttachmentRequestModel>,
1531) -> Result<models::AttachmentUploadDataResponseModel, Error<CiphersIdAttachmentV2PostError>> {
1532 let local_var_configuration = configuration;
1533
1534 let local_var_client = &local_var_configuration.client;
1535
1536 let local_var_uri_str = format!(
1537 "{}/ciphers/{id}/attachment/v2",
1538 local_var_configuration.base_path,
1539 id = crate::apis::urlencode(id.to_string())
1540 );
1541 let mut local_var_req_builder =
1542 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1543
1544 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1545 local_var_req_builder =
1546 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1547 }
1548 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1549 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1550 };
1551 local_var_req_builder = local_var_req_builder.json(&attachment_request_model);
1552
1553 let local_var_req = local_var_req_builder.build()?;
1554 let local_var_resp = local_var_client.execute(local_var_req).await?;
1555
1556 let local_var_status = local_var_resp.status();
1557 let local_var_content = local_var_resp.text().await?;
1558
1559 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1560 serde_json::from_str(&local_var_content).map_err(Error::from)
1561 } else {
1562 let local_var_entity: Option<CiphersIdAttachmentV2PostError> =
1563 serde_json::from_str(&local_var_content).ok();
1564 let local_var_error = ResponseContent {
1565 status: local_var_status,
1566 content: local_var_content,
1567 entity: local_var_entity,
1568 };
1569 Err(Error::ResponseError(local_var_error))
1570 }
1571}
1572
1573pub async fn ciphers_id_collections_admin_post(
1574 configuration: &configuration::Configuration,
1575 id: &str,
1576 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1577) -> Result<models::CipherMiniDetailsResponseModel, Error<CiphersIdCollectionsAdminPostError>> {
1578 let local_var_configuration = configuration;
1579
1580 let local_var_client = &local_var_configuration.client;
1581
1582 let local_var_uri_str = format!(
1583 "{}/ciphers/{id}/collections-admin",
1584 local_var_configuration.base_path,
1585 id = crate::apis::urlencode(id)
1586 );
1587 let mut local_var_req_builder =
1588 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1589
1590 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1591 local_var_req_builder =
1592 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1593 }
1594 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1595 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1596 };
1597 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1598
1599 let local_var_req = local_var_req_builder.build()?;
1600 let local_var_resp = local_var_client.execute(local_var_req).await?;
1601
1602 let local_var_status = local_var_resp.status();
1603 let local_var_content = local_var_resp.text().await?;
1604
1605 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1606 serde_json::from_str(&local_var_content).map_err(Error::from)
1607 } else {
1608 let local_var_entity: Option<CiphersIdCollectionsAdminPostError> =
1609 serde_json::from_str(&local_var_content).ok();
1610 let local_var_error = ResponseContent {
1611 status: local_var_status,
1612 content: local_var_content,
1613 entity: local_var_entity,
1614 };
1615 Err(Error::ResponseError(local_var_error))
1616 }
1617}
1618
1619pub async fn ciphers_id_collections_admin_put(
1620 configuration: &configuration::Configuration,
1621 id: &str,
1622 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1623) -> Result<models::CipherMiniDetailsResponseModel, Error<CiphersIdCollectionsAdminPutError>> {
1624 let local_var_configuration = configuration;
1625
1626 let local_var_client = &local_var_configuration.client;
1627
1628 let local_var_uri_str = format!(
1629 "{}/ciphers/{id}/collections-admin",
1630 local_var_configuration.base_path,
1631 id = crate::apis::urlencode(id)
1632 );
1633 let mut local_var_req_builder =
1634 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1635
1636 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1637 local_var_req_builder =
1638 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1639 }
1640 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1641 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1642 };
1643 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1644
1645 let local_var_req = local_var_req_builder.build()?;
1646 let local_var_resp = local_var_client.execute(local_var_req).await?;
1647
1648 let local_var_status = local_var_resp.status();
1649 let local_var_content = local_var_resp.text().await?;
1650
1651 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1652 serde_json::from_str(&local_var_content).map_err(Error::from)
1653 } else {
1654 let local_var_entity: Option<CiphersIdCollectionsAdminPutError> =
1655 serde_json::from_str(&local_var_content).ok();
1656 let local_var_error = ResponseContent {
1657 status: local_var_status,
1658 content: local_var_content,
1659 entity: local_var_entity,
1660 };
1661 Err(Error::ResponseError(local_var_error))
1662 }
1663}
1664
1665pub async fn ciphers_id_collections_post(
1666 configuration: &configuration::Configuration,
1667 id: uuid::Uuid,
1668 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1669) -> Result<models::CipherDetailsResponseModel, Error<CiphersIdCollectionsPostError>> {
1670 let local_var_configuration = configuration;
1671
1672 let local_var_client = &local_var_configuration.client;
1673
1674 let local_var_uri_str = format!(
1675 "{}/ciphers/{id}/collections",
1676 local_var_configuration.base_path,
1677 id = crate::apis::urlencode(id.to_string())
1678 );
1679 let mut local_var_req_builder =
1680 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1681
1682 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1683 local_var_req_builder =
1684 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1685 }
1686 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1687 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1688 };
1689 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1690
1691 let local_var_req = local_var_req_builder.build()?;
1692 let local_var_resp = local_var_client.execute(local_var_req).await?;
1693
1694 let local_var_status = local_var_resp.status();
1695 let local_var_content = local_var_resp.text().await?;
1696
1697 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1698 serde_json::from_str(&local_var_content).map_err(Error::from)
1699 } else {
1700 let local_var_entity: Option<CiphersIdCollectionsPostError> =
1701 serde_json::from_str(&local_var_content).ok();
1702 let local_var_error = ResponseContent {
1703 status: local_var_status,
1704 content: local_var_content,
1705 entity: local_var_entity,
1706 };
1707 Err(Error::ResponseError(local_var_error))
1708 }
1709}
1710
1711pub async fn ciphers_id_collections_put(
1712 configuration: &configuration::Configuration,
1713 id: uuid::Uuid,
1714 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1715) -> Result<models::CipherDetailsResponseModel, Error<CiphersIdCollectionsPutError>> {
1716 let local_var_configuration = configuration;
1717
1718 let local_var_client = &local_var_configuration.client;
1719
1720 let local_var_uri_str = format!(
1721 "{}/ciphers/{id}/collections",
1722 local_var_configuration.base_path,
1723 id = crate::apis::urlencode(id.to_string())
1724 );
1725 let mut local_var_req_builder =
1726 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1727
1728 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1729 local_var_req_builder =
1730 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1731 }
1732 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1733 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1734 };
1735 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1736
1737 let local_var_req = local_var_req_builder.build()?;
1738 let local_var_resp = local_var_client.execute(local_var_req).await?;
1739
1740 let local_var_status = local_var_resp.status();
1741 let local_var_content = local_var_resp.text().await?;
1742
1743 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1744 serde_json::from_str(&local_var_content).map_err(Error::from)
1745 } else {
1746 let local_var_entity: Option<CiphersIdCollectionsPutError> =
1747 serde_json::from_str(&local_var_content).ok();
1748 let local_var_error = ResponseContent {
1749 status: local_var_status,
1750 content: local_var_content,
1751 entity: local_var_entity,
1752 };
1753 Err(Error::ResponseError(local_var_error))
1754 }
1755}
1756
1757pub async fn ciphers_id_collections_v2_post(
1758 configuration: &configuration::Configuration,
1759 id: uuid::Uuid,
1760 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1761) -> Result<models::OptionalCipherDetailsResponseModel, Error<CiphersIdCollectionsV2PostError>> {
1762 let local_var_configuration = configuration;
1763
1764 let local_var_client = &local_var_configuration.client;
1765
1766 let local_var_uri_str = format!(
1767 "{}/ciphers/{id}/collections_v2",
1768 local_var_configuration.base_path,
1769 id = crate::apis::urlencode(id.to_string())
1770 );
1771 let mut local_var_req_builder =
1772 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1773
1774 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1775 local_var_req_builder =
1776 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1777 }
1778 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1779 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1780 };
1781 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1782
1783 let local_var_req = local_var_req_builder.build()?;
1784 let local_var_resp = local_var_client.execute(local_var_req).await?;
1785
1786 let local_var_status = local_var_resp.status();
1787 let local_var_content = local_var_resp.text().await?;
1788
1789 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1790 serde_json::from_str(&local_var_content).map_err(Error::from)
1791 } else {
1792 let local_var_entity: Option<CiphersIdCollectionsV2PostError> =
1793 serde_json::from_str(&local_var_content).ok();
1794 let local_var_error = ResponseContent {
1795 status: local_var_status,
1796 content: local_var_content,
1797 entity: local_var_entity,
1798 };
1799 Err(Error::ResponseError(local_var_error))
1800 }
1801}
1802
1803pub async fn ciphers_id_collections_v2_put(
1804 configuration: &configuration::Configuration,
1805 id: uuid::Uuid,
1806 cipher_collections_request_model: Option<models::CipherCollectionsRequestModel>,
1807) -> Result<models::OptionalCipherDetailsResponseModel, Error<CiphersIdCollectionsV2PutError>> {
1808 let local_var_configuration = configuration;
1809
1810 let local_var_client = &local_var_configuration.client;
1811
1812 let local_var_uri_str = format!(
1813 "{}/ciphers/{id}/collections_v2",
1814 local_var_configuration.base_path,
1815 id = crate::apis::urlencode(id.to_string())
1816 );
1817 let mut local_var_req_builder =
1818 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1819
1820 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1821 local_var_req_builder =
1822 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1823 }
1824 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1825 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1826 };
1827 local_var_req_builder = local_var_req_builder.json(&cipher_collections_request_model);
1828
1829 let local_var_req = local_var_req_builder.build()?;
1830 let local_var_resp = local_var_client.execute(local_var_req).await?;
1831
1832 let local_var_status = local_var_resp.status();
1833 let local_var_content = local_var_resp.text().await?;
1834
1835 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1836 serde_json::from_str(&local_var_content).map_err(Error::from)
1837 } else {
1838 let local_var_entity: Option<CiphersIdCollectionsV2PutError> =
1839 serde_json::from_str(&local_var_content).ok();
1840 let local_var_error = ResponseContent {
1841 status: local_var_status,
1842 content: local_var_content,
1843 entity: local_var_entity,
1844 };
1845 Err(Error::ResponseError(local_var_error))
1846 }
1847}
1848
1849pub async fn ciphers_id_delete(
1850 configuration: &configuration::Configuration,
1851 id: uuid::Uuid,
1852) -> Result<(), Error<CiphersIdDeleteError>> {
1853 let local_var_configuration = configuration;
1854
1855 let local_var_client = &local_var_configuration.client;
1856
1857 let local_var_uri_str = format!(
1858 "{}/ciphers/{id}",
1859 local_var_configuration.base_path,
1860 id = crate::apis::urlencode(id.to_string())
1861 );
1862 let mut local_var_req_builder =
1863 local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1864
1865 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1866 local_var_req_builder =
1867 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1868 }
1869 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1870 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1871 };
1872
1873 let local_var_req = local_var_req_builder.build()?;
1874 let local_var_resp = local_var_client.execute(local_var_req).await?;
1875
1876 let local_var_status = local_var_resp.status();
1877 let local_var_content = local_var_resp.text().await?;
1878
1879 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1880 Ok(())
1881 } else {
1882 let local_var_entity: Option<CiphersIdDeleteError> =
1883 serde_json::from_str(&local_var_content).ok();
1884 let local_var_error = ResponseContent {
1885 status: local_var_status,
1886 content: local_var_content,
1887 entity: local_var_entity,
1888 };
1889 Err(Error::ResponseError(local_var_error))
1890 }
1891}
1892
1893pub async fn ciphers_id_delete_admin_post(
1894 configuration: &configuration::Configuration,
1895 id: &str,
1896) -> Result<(), Error<CiphersIdDeleteAdminPostError>> {
1897 let local_var_configuration = configuration;
1898
1899 let local_var_client = &local_var_configuration.client;
1900
1901 let local_var_uri_str = format!(
1902 "{}/ciphers/{id}/delete-admin",
1903 local_var_configuration.base_path,
1904 id = crate::apis::urlencode(id)
1905 );
1906 let mut local_var_req_builder =
1907 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1908
1909 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1910 local_var_req_builder =
1911 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1912 }
1913 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1914 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1915 };
1916
1917 let local_var_req = local_var_req_builder.build()?;
1918 let local_var_resp = local_var_client.execute(local_var_req).await?;
1919
1920 let local_var_status = local_var_resp.status();
1921 let local_var_content = local_var_resp.text().await?;
1922
1923 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1924 Ok(())
1925 } else {
1926 let local_var_entity: Option<CiphersIdDeleteAdminPostError> =
1927 serde_json::from_str(&local_var_content).ok();
1928 let local_var_error = ResponseContent {
1929 status: local_var_status,
1930 content: local_var_content,
1931 entity: local_var_entity,
1932 };
1933 Err(Error::ResponseError(local_var_error))
1934 }
1935}
1936
1937pub async fn ciphers_id_delete_admin_put(
1938 configuration: &configuration::Configuration,
1939 id: &str,
1940) -> Result<(), Error<CiphersIdDeleteAdminPutError>> {
1941 let local_var_configuration = configuration;
1942
1943 let local_var_client = &local_var_configuration.client;
1944
1945 let local_var_uri_str = format!(
1946 "{}/ciphers/{id}/delete-admin",
1947 local_var_configuration.base_path,
1948 id = crate::apis::urlencode(id)
1949 );
1950 let mut local_var_req_builder =
1951 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1952
1953 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1954 local_var_req_builder =
1955 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1956 }
1957 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
1958 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
1959 };
1960
1961 let local_var_req = local_var_req_builder.build()?;
1962 let local_var_resp = local_var_client.execute(local_var_req).await?;
1963
1964 let local_var_status = local_var_resp.status();
1965 let local_var_content = local_var_resp.text().await?;
1966
1967 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1968 Ok(())
1969 } else {
1970 let local_var_entity: Option<CiphersIdDeleteAdminPutError> =
1971 serde_json::from_str(&local_var_content).ok();
1972 let local_var_error = ResponseContent {
1973 status: local_var_status,
1974 content: local_var_content,
1975 entity: local_var_entity,
1976 };
1977 Err(Error::ResponseError(local_var_error))
1978 }
1979}
1980
1981pub async fn ciphers_id_delete_post(
1982 configuration: &configuration::Configuration,
1983 id: uuid::Uuid,
1984) -> Result<(), Error<CiphersIdDeletePostError>> {
1985 let local_var_configuration = configuration;
1986
1987 let local_var_client = &local_var_configuration.client;
1988
1989 let local_var_uri_str = format!(
1990 "{}/ciphers/{id}/delete",
1991 local_var_configuration.base_path,
1992 id = crate::apis::urlencode(id.to_string())
1993 );
1994 let mut local_var_req_builder =
1995 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1996
1997 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1998 local_var_req_builder =
1999 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2000 }
2001 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2002 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2003 };
2004
2005 let local_var_req = local_var_req_builder.build()?;
2006 let local_var_resp = local_var_client.execute(local_var_req).await?;
2007
2008 let local_var_status = local_var_resp.status();
2009 let local_var_content = local_var_resp.text().await?;
2010
2011 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2012 Ok(())
2013 } else {
2014 let local_var_entity: Option<CiphersIdDeletePostError> =
2015 serde_json::from_str(&local_var_content).ok();
2016 let local_var_error = ResponseContent {
2017 status: local_var_status,
2018 content: local_var_content,
2019 entity: local_var_entity,
2020 };
2021 Err(Error::ResponseError(local_var_error))
2022 }
2023}
2024
2025pub async fn ciphers_id_delete_put(
2026 configuration: &configuration::Configuration,
2027 id: uuid::Uuid,
2028) -> Result<(), Error<CiphersIdDeletePutError>> {
2029 let local_var_configuration = configuration;
2030
2031 let local_var_client = &local_var_configuration.client;
2032
2033 let local_var_uri_str = format!(
2034 "{}/ciphers/{id}/delete",
2035 local_var_configuration.base_path,
2036 id = crate::apis::urlencode(id.to_string())
2037 );
2038 let mut local_var_req_builder =
2039 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2040
2041 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2042 local_var_req_builder =
2043 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2044 }
2045 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2046 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2047 };
2048
2049 let local_var_req = local_var_req_builder.build()?;
2050 let local_var_resp = local_var_client.execute(local_var_req).await?;
2051
2052 let local_var_status = local_var_resp.status();
2053 let local_var_content = local_var_resp.text().await?;
2054
2055 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2056 Ok(())
2057 } else {
2058 let local_var_entity: Option<CiphersIdDeletePutError> =
2059 serde_json::from_str(&local_var_content).ok();
2060 let local_var_error = ResponseContent {
2061 status: local_var_status,
2062 content: local_var_content,
2063 entity: local_var_entity,
2064 };
2065 Err(Error::ResponseError(local_var_error))
2066 }
2067}
2068
2069pub async fn ciphers_id_details_get(
2070 configuration: &configuration::Configuration,
2071 id: uuid::Uuid,
2072) -> Result<models::CipherDetailsResponseModel, Error<CiphersIdDetailsGetError>> {
2073 let local_var_configuration = configuration;
2074
2075 let local_var_client = &local_var_configuration.client;
2076
2077 let local_var_uri_str = format!(
2078 "{}/ciphers/{id}/details",
2079 local_var_configuration.base_path,
2080 id = crate::apis::urlencode(id.to_string())
2081 );
2082 let mut local_var_req_builder =
2083 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2084
2085 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2086 local_var_req_builder =
2087 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2088 }
2089 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2090 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2091 };
2092
2093 let local_var_req = local_var_req_builder.build()?;
2094 let local_var_resp = local_var_client.execute(local_var_req).await?;
2095
2096 let local_var_status = local_var_resp.status();
2097 let local_var_content = local_var_resp.text().await?;
2098
2099 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2100 serde_json::from_str(&local_var_content).map_err(Error::from)
2101 } else {
2102 let local_var_entity: Option<CiphersIdDetailsGetError> =
2103 serde_json::from_str(&local_var_content).ok();
2104 let local_var_error = ResponseContent {
2105 status: local_var_status,
2106 content: local_var_content,
2107 entity: local_var_entity,
2108 };
2109 Err(Error::ResponseError(local_var_error))
2110 }
2111}
2112
2113pub async fn ciphers_id_full_details_get(
2114 configuration: &configuration::Configuration,
2115 id: uuid::Uuid,
2116) -> Result<models::CipherDetailsResponseModel, Error<CiphersIdFullDetailsGetError>> {
2117 let local_var_configuration = configuration;
2118
2119 let local_var_client = &local_var_configuration.client;
2120
2121 let local_var_uri_str = format!(
2122 "{}/ciphers/{id}/full-details",
2123 local_var_configuration.base_path,
2124 id = crate::apis::urlencode(id.to_string())
2125 );
2126 let mut local_var_req_builder =
2127 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2128
2129 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2130 local_var_req_builder =
2131 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2132 }
2133 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2134 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2135 };
2136
2137 let local_var_req = local_var_req_builder.build()?;
2138 let local_var_resp = local_var_client.execute(local_var_req).await?;
2139
2140 let local_var_status = local_var_resp.status();
2141 let local_var_content = local_var_resp.text().await?;
2142
2143 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2144 serde_json::from_str(&local_var_content).map_err(Error::from)
2145 } else {
2146 let local_var_entity: Option<CiphersIdFullDetailsGetError> =
2147 serde_json::from_str(&local_var_content).ok();
2148 let local_var_error = ResponseContent {
2149 status: local_var_status,
2150 content: local_var_content,
2151 entity: local_var_entity,
2152 };
2153 Err(Error::ResponseError(local_var_error))
2154 }
2155}
2156
2157pub async fn ciphers_id_get(
2158 configuration: &configuration::Configuration,
2159 id: uuid::Uuid,
2160) -> Result<models::CipherResponseModel, Error<CiphersIdGetError>> {
2161 let local_var_configuration = configuration;
2162
2163 let local_var_client = &local_var_configuration.client;
2164
2165 let local_var_uri_str = format!(
2166 "{}/ciphers/{id}",
2167 local_var_configuration.base_path,
2168 id = crate::apis::urlencode(id.to_string())
2169 );
2170 let mut local_var_req_builder =
2171 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2172
2173 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2174 local_var_req_builder =
2175 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2176 }
2177 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2178 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2179 };
2180
2181 let local_var_req = local_var_req_builder.build()?;
2182 let local_var_resp = local_var_client.execute(local_var_req).await?;
2183
2184 let local_var_status = local_var_resp.status();
2185 let local_var_content = local_var_resp.text().await?;
2186
2187 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2188 serde_json::from_str(&local_var_content).map_err(Error::from)
2189 } else {
2190 let local_var_entity: Option<CiphersIdGetError> =
2191 serde_json::from_str(&local_var_content).ok();
2192 let local_var_error = ResponseContent {
2193 status: local_var_status,
2194 content: local_var_content,
2195 entity: local_var_entity,
2196 };
2197 Err(Error::ResponseError(local_var_error))
2198 }
2199}
2200
2201pub async fn ciphers_id_partial_post(
2202 configuration: &configuration::Configuration,
2203 id: uuid::Uuid,
2204 cipher_partial_request_model: Option<models::CipherPartialRequestModel>,
2205) -> Result<models::CipherResponseModel, Error<CiphersIdPartialPostError>> {
2206 let local_var_configuration = configuration;
2207
2208 let local_var_client = &local_var_configuration.client;
2209
2210 let local_var_uri_str = format!(
2211 "{}/ciphers/{id}/partial",
2212 local_var_configuration.base_path,
2213 id = crate::apis::urlencode(id.to_string())
2214 );
2215 let mut local_var_req_builder =
2216 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2217
2218 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2219 local_var_req_builder =
2220 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2221 }
2222 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2223 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2224 };
2225 local_var_req_builder = local_var_req_builder.json(&cipher_partial_request_model);
2226
2227 let local_var_req = local_var_req_builder.build()?;
2228 let local_var_resp = local_var_client.execute(local_var_req).await?;
2229
2230 let local_var_status = local_var_resp.status();
2231 let local_var_content = local_var_resp.text().await?;
2232
2233 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2234 serde_json::from_str(&local_var_content).map_err(Error::from)
2235 } else {
2236 let local_var_entity: Option<CiphersIdPartialPostError> =
2237 serde_json::from_str(&local_var_content).ok();
2238 let local_var_error = ResponseContent {
2239 status: local_var_status,
2240 content: local_var_content,
2241 entity: local_var_entity,
2242 };
2243 Err(Error::ResponseError(local_var_error))
2244 }
2245}
2246
2247pub async fn ciphers_id_partial_put(
2248 configuration: &configuration::Configuration,
2249 id: uuid::Uuid,
2250 cipher_partial_request_model: Option<models::CipherPartialRequestModel>,
2251) -> Result<models::CipherResponseModel, Error<CiphersIdPartialPutError>> {
2252 let local_var_configuration = configuration;
2253
2254 let local_var_client = &local_var_configuration.client;
2255
2256 let local_var_uri_str = format!(
2257 "{}/ciphers/{id}/partial",
2258 local_var_configuration.base_path,
2259 id = crate::apis::urlencode(id.to_string())
2260 );
2261 let mut local_var_req_builder =
2262 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2263
2264 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2265 local_var_req_builder =
2266 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2267 }
2268 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2269 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2270 };
2271 local_var_req_builder = local_var_req_builder.json(&cipher_partial_request_model);
2272
2273 let local_var_req = local_var_req_builder.build()?;
2274 let local_var_resp = local_var_client.execute(local_var_req).await?;
2275
2276 let local_var_status = local_var_resp.status();
2277 let local_var_content = local_var_resp.text().await?;
2278
2279 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2280 serde_json::from_str(&local_var_content).map_err(Error::from)
2281 } else {
2282 let local_var_entity: Option<CiphersIdPartialPutError> =
2283 serde_json::from_str(&local_var_content).ok();
2284 let local_var_error = ResponseContent {
2285 status: local_var_status,
2286 content: local_var_content,
2287 entity: local_var_entity,
2288 };
2289 Err(Error::ResponseError(local_var_error))
2290 }
2291}
2292
2293pub async fn ciphers_id_post(
2294 configuration: &configuration::Configuration,
2295 id: uuid::Uuid,
2296 cipher_request_model: Option<models::CipherRequestModel>,
2297) -> Result<models::CipherResponseModel, Error<CiphersIdPostError>> {
2298 let local_var_configuration = configuration;
2299
2300 let local_var_client = &local_var_configuration.client;
2301
2302 let local_var_uri_str = format!(
2303 "{}/ciphers/{id}",
2304 local_var_configuration.base_path,
2305 id = crate::apis::urlencode(id.to_string())
2306 );
2307 let mut local_var_req_builder =
2308 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2309
2310 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2311 local_var_req_builder =
2312 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2313 }
2314 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2315 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2316 };
2317 local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
2318
2319 let local_var_req = local_var_req_builder.build()?;
2320 let local_var_resp = local_var_client.execute(local_var_req).await?;
2321
2322 let local_var_status = local_var_resp.status();
2323 let local_var_content = local_var_resp.text().await?;
2324
2325 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2326 serde_json::from_str(&local_var_content).map_err(Error::from)
2327 } else {
2328 let local_var_entity: Option<CiphersIdPostError> =
2329 serde_json::from_str(&local_var_content).ok();
2330 let local_var_error = ResponseContent {
2331 status: local_var_status,
2332 content: local_var_content,
2333 entity: local_var_entity,
2334 };
2335 Err(Error::ResponseError(local_var_error))
2336 }
2337}
2338
2339pub async fn ciphers_id_put(
2340 configuration: &configuration::Configuration,
2341 id: uuid::Uuid,
2342 cipher_request_model: Option<models::CipherRequestModel>,
2343) -> Result<models::CipherResponseModel, Error<CiphersIdPutError>> {
2344 let local_var_configuration = configuration;
2345
2346 let local_var_client = &local_var_configuration.client;
2347
2348 let local_var_uri_str = format!(
2349 "{}/ciphers/{id}",
2350 local_var_configuration.base_path,
2351 id = crate::apis::urlencode(id.to_string())
2352 );
2353 let mut local_var_req_builder =
2354 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2355
2356 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2357 local_var_req_builder =
2358 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2359 }
2360 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2361 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2362 };
2363 local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
2364
2365 let local_var_req = local_var_req_builder.build()?;
2366 let local_var_resp = local_var_client.execute(local_var_req).await?;
2367
2368 let local_var_status = local_var_resp.status();
2369 let local_var_content = local_var_resp.text().await?;
2370
2371 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2372 serde_json::from_str(&local_var_content).map_err(Error::from)
2373 } else {
2374 let local_var_entity: Option<CiphersIdPutError> =
2375 serde_json::from_str(&local_var_content).ok();
2376 let local_var_error = ResponseContent {
2377 status: local_var_status,
2378 content: local_var_content,
2379 entity: local_var_entity,
2380 };
2381 Err(Error::ResponseError(local_var_error))
2382 }
2383}
2384
2385pub async fn ciphers_id_restore_admin_put(
2386 configuration: &configuration::Configuration,
2387 id: &str,
2388) -> Result<models::CipherMiniResponseModel, Error<CiphersIdRestoreAdminPutError>> {
2389 let local_var_configuration = configuration;
2390
2391 let local_var_client = &local_var_configuration.client;
2392
2393 let local_var_uri_str = format!(
2394 "{}/ciphers/{id}/restore-admin",
2395 local_var_configuration.base_path,
2396 id = crate::apis::urlencode(id)
2397 );
2398 let mut local_var_req_builder =
2399 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2400
2401 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2402 local_var_req_builder =
2403 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2404 }
2405 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2406 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2407 };
2408
2409 let local_var_req = local_var_req_builder.build()?;
2410 let local_var_resp = local_var_client.execute(local_var_req).await?;
2411
2412 let local_var_status = local_var_resp.status();
2413 let local_var_content = local_var_resp.text().await?;
2414
2415 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2416 serde_json::from_str(&local_var_content).map_err(Error::from)
2417 } else {
2418 let local_var_entity: Option<CiphersIdRestoreAdminPutError> =
2419 serde_json::from_str(&local_var_content).ok();
2420 let local_var_error = ResponseContent {
2421 status: local_var_status,
2422 content: local_var_content,
2423 entity: local_var_entity,
2424 };
2425 Err(Error::ResponseError(local_var_error))
2426 }
2427}
2428
2429pub async fn ciphers_id_restore_put(
2430 configuration: &configuration::Configuration,
2431 id: uuid::Uuid,
2432) -> Result<models::CipherResponseModel, Error<CiphersIdRestorePutError>> {
2433 let local_var_configuration = configuration;
2434
2435 let local_var_client = &local_var_configuration.client;
2436
2437 let local_var_uri_str = format!(
2438 "{}/ciphers/{id}/restore",
2439 local_var_configuration.base_path,
2440 id = crate::apis::urlencode(id.to_string())
2441 );
2442 let mut local_var_req_builder =
2443 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2444
2445 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2446 local_var_req_builder =
2447 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2448 }
2449 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2450 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2451 };
2452
2453 let local_var_req = local_var_req_builder.build()?;
2454 let local_var_resp = local_var_client.execute(local_var_req).await?;
2455
2456 let local_var_status = local_var_resp.status();
2457 let local_var_content = local_var_resp.text().await?;
2458
2459 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2460 serde_json::from_str(&local_var_content).map_err(Error::from)
2461 } else {
2462 let local_var_entity: Option<CiphersIdRestorePutError> =
2463 serde_json::from_str(&local_var_content).ok();
2464 let local_var_error = ResponseContent {
2465 status: local_var_status,
2466 content: local_var_content,
2467 entity: local_var_entity,
2468 };
2469 Err(Error::ResponseError(local_var_error))
2470 }
2471}
2472
2473pub async fn ciphers_id_share_post(
2474 configuration: &configuration::Configuration,
2475 id: uuid::Uuid,
2476 cipher_share_request_model: Option<models::CipherShareRequestModel>,
2477) -> Result<models::CipherResponseModel, Error<CiphersIdSharePostError>> {
2478 let local_var_configuration = configuration;
2479
2480 let local_var_client = &local_var_configuration.client;
2481
2482 let local_var_uri_str = format!(
2483 "{}/ciphers/{id}/share",
2484 local_var_configuration.base_path,
2485 id = crate::apis::urlencode(id.to_string())
2486 );
2487 let mut local_var_req_builder =
2488 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2489
2490 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2491 local_var_req_builder =
2492 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2493 }
2494 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2495 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2496 };
2497 local_var_req_builder = local_var_req_builder.json(&cipher_share_request_model);
2498
2499 let local_var_req = local_var_req_builder.build()?;
2500 let local_var_resp = local_var_client.execute(local_var_req).await?;
2501
2502 let local_var_status = local_var_resp.status();
2503 let local_var_content = local_var_resp.text().await?;
2504
2505 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2506 serde_json::from_str(&local_var_content).map_err(Error::from)
2507 } else {
2508 let local_var_entity: Option<CiphersIdSharePostError> =
2509 serde_json::from_str(&local_var_content).ok();
2510 let local_var_error = ResponseContent {
2511 status: local_var_status,
2512 content: local_var_content,
2513 entity: local_var_entity,
2514 };
2515 Err(Error::ResponseError(local_var_error))
2516 }
2517}
2518
2519pub async fn ciphers_id_share_put(
2520 configuration: &configuration::Configuration,
2521 id: uuid::Uuid,
2522 cipher_share_request_model: Option<models::CipherShareRequestModel>,
2523) -> Result<models::CipherResponseModel, Error<CiphersIdSharePutError>> {
2524 let local_var_configuration = configuration;
2525
2526 let local_var_client = &local_var_configuration.client;
2527
2528 let local_var_uri_str = format!(
2529 "{}/ciphers/{id}/share",
2530 local_var_configuration.base_path,
2531 id = crate::apis::urlencode(id.to_string())
2532 );
2533 let mut local_var_req_builder =
2534 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2535
2536 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2537 local_var_req_builder =
2538 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2539 }
2540 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2541 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2542 };
2543 local_var_req_builder = local_var_req_builder.json(&cipher_share_request_model);
2544
2545 let local_var_req = local_var_req_builder.build()?;
2546 let local_var_resp = local_var_client.execute(local_var_req).await?;
2547
2548 let local_var_status = local_var_resp.status();
2549 let local_var_content = local_var_resp.text().await?;
2550
2551 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2552 serde_json::from_str(&local_var_content).map_err(Error::from)
2553 } else {
2554 let local_var_entity: Option<CiphersIdSharePutError> =
2555 serde_json::from_str(&local_var_content).ok();
2556 let local_var_error = ResponseContent {
2557 status: local_var_status,
2558 content: local_var_content,
2559 entity: local_var_entity,
2560 };
2561 Err(Error::ResponseError(local_var_error))
2562 }
2563}
2564
2565pub async fn ciphers_move_post(
2566 configuration: &configuration::Configuration,
2567 cipher_bulk_move_request_model: Option<models::CipherBulkMoveRequestModel>,
2568) -> Result<(), Error<CiphersMovePostError>> {
2569 let local_var_configuration = configuration;
2570
2571 let local_var_client = &local_var_configuration.client;
2572
2573 let local_var_uri_str = format!("{}/ciphers/move", local_var_configuration.base_path);
2574 let mut local_var_req_builder =
2575 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2576
2577 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2578 local_var_req_builder =
2579 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2580 }
2581 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2582 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2583 };
2584 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_move_request_model);
2585
2586 let local_var_req = local_var_req_builder.build()?;
2587 let local_var_resp = local_var_client.execute(local_var_req).await?;
2588
2589 let local_var_status = local_var_resp.status();
2590 let local_var_content = local_var_resp.text().await?;
2591
2592 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2593 Ok(())
2594 } else {
2595 let local_var_entity: Option<CiphersMovePostError> =
2596 serde_json::from_str(&local_var_content).ok();
2597 let local_var_error = ResponseContent {
2598 status: local_var_status,
2599 content: local_var_content,
2600 entity: local_var_entity,
2601 };
2602 Err(Error::ResponseError(local_var_error))
2603 }
2604}
2605
2606pub async fn ciphers_move_put(
2607 configuration: &configuration::Configuration,
2608 cipher_bulk_move_request_model: Option<models::CipherBulkMoveRequestModel>,
2609) -> Result<(), Error<CiphersMovePutError>> {
2610 let local_var_configuration = configuration;
2611
2612 let local_var_client = &local_var_configuration.client;
2613
2614 let local_var_uri_str = format!("{}/ciphers/move", local_var_configuration.base_path);
2615 let mut local_var_req_builder =
2616 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2617
2618 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2619 local_var_req_builder =
2620 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2621 }
2622 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2623 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2624 };
2625 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_move_request_model);
2626
2627 let local_var_req = local_var_req_builder.build()?;
2628 let local_var_resp = local_var_client.execute(local_var_req).await?;
2629
2630 let local_var_status = local_var_resp.status();
2631 let local_var_content = local_var_resp.text().await?;
2632
2633 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2634 Ok(())
2635 } else {
2636 let local_var_entity: Option<CiphersMovePutError> =
2637 serde_json::from_str(&local_var_content).ok();
2638 let local_var_error = ResponseContent {
2639 status: local_var_status,
2640 content: local_var_content,
2641 entity: local_var_entity,
2642 };
2643 Err(Error::ResponseError(local_var_error))
2644 }
2645}
2646
2647pub async fn ciphers_organization_details_assigned_get(
2648 configuration: &configuration::Configuration,
2649 organization_id: Option<uuid::Uuid>,
2650) -> Result<
2651 models::CipherDetailsResponseModelListResponseModel,
2652 Error<CiphersOrganizationDetailsAssignedGetError>,
2653> {
2654 let local_var_configuration = configuration;
2655
2656 let local_var_client = &local_var_configuration.client;
2657
2658 let local_var_uri_str = format!(
2659 "{}/ciphers/organization-details/assigned",
2660 local_var_configuration.base_path
2661 );
2662 let mut local_var_req_builder =
2663 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2664
2665 if let Some(ref local_var_str) = organization_id {
2666 local_var_req_builder =
2667 local_var_req_builder.query(&[("organizationId", &local_var_str.to_string())]);
2668 }
2669 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2670 local_var_req_builder =
2671 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2672 }
2673 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2674 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2675 };
2676
2677 let local_var_req = local_var_req_builder.build()?;
2678 let local_var_resp = local_var_client.execute(local_var_req).await?;
2679
2680 let local_var_status = local_var_resp.status();
2681 let local_var_content = local_var_resp.text().await?;
2682
2683 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2684 serde_json::from_str(&local_var_content).map_err(Error::from)
2685 } else {
2686 let local_var_entity: Option<CiphersOrganizationDetailsAssignedGetError> =
2687 serde_json::from_str(&local_var_content).ok();
2688 let local_var_error = ResponseContent {
2689 status: local_var_status,
2690 content: local_var_content,
2691 entity: local_var_entity,
2692 };
2693 Err(Error::ResponseError(local_var_error))
2694 }
2695}
2696
2697pub async fn ciphers_organization_details_get(
2698 configuration: &configuration::Configuration,
2699 organization_id: Option<uuid::Uuid>,
2700) -> Result<
2701 models::CipherMiniDetailsResponseModelListResponseModel,
2702 Error<CiphersOrganizationDetailsGetError>,
2703> {
2704 let local_var_configuration = configuration;
2705
2706 let local_var_client = &local_var_configuration.client;
2707
2708 let local_var_uri_str = format!(
2709 "{}/ciphers/organization-details",
2710 local_var_configuration.base_path
2711 );
2712 let mut local_var_req_builder =
2713 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2714
2715 if let Some(ref local_var_str) = organization_id {
2716 local_var_req_builder =
2717 local_var_req_builder.query(&[("organizationId", &local_var_str.to_string())]);
2718 }
2719 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2720 local_var_req_builder =
2721 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2722 }
2723 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2724 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2725 };
2726
2727 let local_var_req = local_var_req_builder.build()?;
2728 let local_var_resp = local_var_client.execute(local_var_req).await?;
2729
2730 let local_var_status = local_var_resp.status();
2731 let local_var_content = local_var_resp.text().await?;
2732
2733 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2734 serde_json::from_str(&local_var_content).map_err(Error::from)
2735 } else {
2736 let local_var_entity: Option<CiphersOrganizationDetailsGetError> =
2737 serde_json::from_str(&local_var_content).ok();
2738 let local_var_error = ResponseContent {
2739 status: local_var_status,
2740 content: local_var_content,
2741 entity: local_var_entity,
2742 };
2743 Err(Error::ResponseError(local_var_error))
2744 }
2745}
2746
2747pub async fn ciphers_post(
2748 configuration: &configuration::Configuration,
2749 cipher_request_model: Option<models::CipherRequestModel>,
2750) -> Result<models::CipherResponseModel, Error<CiphersPostError>> {
2751 let local_var_configuration = configuration;
2752
2753 let local_var_client = &local_var_configuration.client;
2754
2755 let local_var_uri_str = format!("{}/ciphers", local_var_configuration.base_path);
2756 let mut local_var_req_builder =
2757 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2758
2759 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2760 local_var_req_builder =
2761 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2762 }
2763 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2764 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2765 };
2766 local_var_req_builder = local_var_req_builder.json(&cipher_request_model);
2767
2768 let local_var_req = local_var_req_builder.build()?;
2769 let local_var_resp = local_var_client.execute(local_var_req).await?;
2770
2771 let local_var_status = local_var_resp.status();
2772 let local_var_content = local_var_resp.text().await?;
2773
2774 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2775 serde_json::from_str(&local_var_content).map_err(Error::from)
2776 } else {
2777 let local_var_entity: Option<CiphersPostError> =
2778 serde_json::from_str(&local_var_content).ok();
2779 let local_var_error = ResponseContent {
2780 status: local_var_status,
2781 content: local_var_content,
2782 entity: local_var_entity,
2783 };
2784 Err(Error::ResponseError(local_var_error))
2785 }
2786}
2787
2788pub async fn ciphers_purge_post(
2789 configuration: &configuration::Configuration,
2790 organization_id: Option<&str>,
2791 secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
2792) -> Result<(), Error<CiphersPurgePostError>> {
2793 let local_var_configuration = configuration;
2794
2795 let local_var_client = &local_var_configuration.client;
2796
2797 let local_var_uri_str = format!("{}/ciphers/purge", local_var_configuration.base_path);
2798 let mut local_var_req_builder =
2799 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2800
2801 if let Some(ref local_var_str) = organization_id {
2802 local_var_req_builder =
2803 local_var_req_builder.query(&[("organizationId", &local_var_str.to_string())]);
2804 }
2805 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2806 local_var_req_builder =
2807 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2808 }
2809 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2810 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2811 };
2812 local_var_req_builder = local_var_req_builder.json(&secret_verification_request_model);
2813
2814 let local_var_req = local_var_req_builder.build()?;
2815 let local_var_resp = local_var_client.execute(local_var_req).await?;
2816
2817 let local_var_status = local_var_resp.status();
2818 let local_var_content = local_var_resp.text().await?;
2819
2820 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2821 Ok(())
2822 } else {
2823 let local_var_entity: Option<CiphersPurgePostError> =
2824 serde_json::from_str(&local_var_content).ok();
2825 let local_var_error = ResponseContent {
2826 status: local_var_status,
2827 content: local_var_content,
2828 entity: local_var_entity,
2829 };
2830 Err(Error::ResponseError(local_var_error))
2831 }
2832}
2833
2834pub async fn ciphers_restore_admin_put(
2835 configuration: &configuration::Configuration,
2836 cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
2837) -> Result<models::CipherMiniResponseModelListResponseModel, Error<CiphersRestoreAdminPutError>> {
2838 let local_var_configuration = configuration;
2839
2840 let local_var_client = &local_var_configuration.client;
2841
2842 let local_var_uri_str = format!(
2843 "{}/ciphers/restore-admin",
2844 local_var_configuration.base_path
2845 );
2846 let mut local_var_req_builder =
2847 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2848
2849 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2850 local_var_req_builder =
2851 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2852 }
2853 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2854 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2855 };
2856 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_restore_request_model);
2857
2858 let local_var_req = local_var_req_builder.build()?;
2859 let local_var_resp = local_var_client.execute(local_var_req).await?;
2860
2861 let local_var_status = local_var_resp.status();
2862 let local_var_content = local_var_resp.text().await?;
2863
2864 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2865 serde_json::from_str(&local_var_content).map_err(Error::from)
2866 } else {
2867 let local_var_entity: Option<CiphersRestoreAdminPutError> =
2868 serde_json::from_str(&local_var_content).ok();
2869 let local_var_error = ResponseContent {
2870 status: local_var_status,
2871 content: local_var_content,
2872 entity: local_var_entity,
2873 };
2874 Err(Error::ResponseError(local_var_error))
2875 }
2876}
2877
2878pub async fn ciphers_restore_put(
2879 configuration: &configuration::Configuration,
2880 cipher_bulk_restore_request_model: Option<models::CipherBulkRestoreRequestModel>,
2881) -> Result<models::CipherMiniResponseModelListResponseModel, Error<CiphersRestorePutError>> {
2882 let local_var_configuration = configuration;
2883
2884 let local_var_client = &local_var_configuration.client;
2885
2886 let local_var_uri_str = format!("{}/ciphers/restore", local_var_configuration.base_path);
2887 let mut local_var_req_builder =
2888 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2889
2890 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2891 local_var_req_builder =
2892 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2893 }
2894 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2895 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2896 };
2897 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_restore_request_model);
2898
2899 let local_var_req = local_var_req_builder.build()?;
2900 let local_var_resp = local_var_client.execute(local_var_req).await?;
2901
2902 let local_var_status = local_var_resp.status();
2903 let local_var_content = local_var_resp.text().await?;
2904
2905 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2906 serde_json::from_str(&local_var_content).map_err(Error::from)
2907 } else {
2908 let local_var_entity: Option<CiphersRestorePutError> =
2909 serde_json::from_str(&local_var_content).ok();
2910 let local_var_error = ResponseContent {
2911 status: local_var_status,
2912 content: local_var_content,
2913 entity: local_var_entity,
2914 };
2915 Err(Error::ResponseError(local_var_error))
2916 }
2917}
2918
2919pub async fn ciphers_share_post(
2920 configuration: &configuration::Configuration,
2921 cipher_bulk_share_request_model: Option<models::CipherBulkShareRequestModel>,
2922) -> Result<(), Error<CiphersSharePostError>> {
2923 let local_var_configuration = configuration;
2924
2925 let local_var_client = &local_var_configuration.client;
2926
2927 let local_var_uri_str = format!("{}/ciphers/share", local_var_configuration.base_path);
2928 let mut local_var_req_builder =
2929 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2930
2931 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2932 local_var_req_builder =
2933 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2934 }
2935 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2936 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2937 };
2938 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_share_request_model);
2939
2940 let local_var_req = local_var_req_builder.build()?;
2941 let local_var_resp = local_var_client.execute(local_var_req).await?;
2942
2943 let local_var_status = local_var_resp.status();
2944 let local_var_content = local_var_resp.text().await?;
2945
2946 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2947 Ok(())
2948 } else {
2949 let local_var_entity: Option<CiphersSharePostError> =
2950 serde_json::from_str(&local_var_content).ok();
2951 let local_var_error = ResponseContent {
2952 status: local_var_status,
2953 content: local_var_content,
2954 entity: local_var_entity,
2955 };
2956 Err(Error::ResponseError(local_var_error))
2957 }
2958}
2959
2960pub async fn ciphers_share_put(
2961 configuration: &configuration::Configuration,
2962 cipher_bulk_share_request_model: Option<models::CipherBulkShareRequestModel>,
2963) -> Result<(), Error<CiphersSharePutError>> {
2964 let local_var_configuration = configuration;
2965
2966 let local_var_client = &local_var_configuration.client;
2967
2968 let local_var_uri_str = format!("{}/ciphers/share", local_var_configuration.base_path);
2969 let mut local_var_req_builder =
2970 local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2971
2972 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2973 local_var_req_builder =
2974 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2975 }
2976 if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
2977 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
2978 };
2979 local_var_req_builder = local_var_req_builder.json(&cipher_bulk_share_request_model);
2980
2981 let local_var_req = local_var_req_builder.build()?;
2982 let local_var_resp = local_var_client.execute(local_var_req).await?;
2983
2984 let local_var_status = local_var_resp.status();
2985 let local_var_content = local_var_resp.text().await?;
2986
2987 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2988 Ok(())
2989 } else {
2990 let local_var_entity: Option<CiphersSharePutError> =
2991 serde_json::from_str(&local_var_content).ok();
2992 let local_var_error = ResponseContent {
2993 status: local_var_status,
2994 content: local_var_content,
2995 entity: local_var_entity,
2996 };
2997 Err(Error::ResponseError(local_var_error))
2998 }
2999}