bitwarden_api_api/apis/
ciphers_api.rs

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