bitwarden_api_api/apis/
accounts_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 [`accounts_api_key_post`]
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum AccountsApiKeyPostError {
21    UnknownValue(serde_json::Value),
22}
23
24/// struct for typed errors of method [`accounts_avatar_post`]
25#[derive(Debug, Clone, Serialize, Deserialize)]
26#[serde(untagged)]
27pub enum AccountsAvatarPostError {
28    UnknownValue(serde_json::Value),
29}
30
31/// struct for typed errors of method [`accounts_avatar_put`]
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(untagged)]
34pub enum AccountsAvatarPutError {
35    UnknownValue(serde_json::Value),
36}
37
38/// struct for typed errors of method [`accounts_cancel_post`]
39#[derive(Debug, Clone, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum AccountsCancelPostError {
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`accounts_delete`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum AccountsDeleteError {
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`accounts_delete_post`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum AccountsDeletePostError {
56    UnknownValue(serde_json::Value),
57}
58
59/// struct for typed errors of method [`accounts_delete_recover_post`]
60#[derive(Debug, Clone, Serialize, Deserialize)]
61#[serde(untagged)]
62pub enum AccountsDeleteRecoverPostError {
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`accounts_delete_recover_token_post`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum AccountsDeleteRecoverTokenPostError {
70    UnknownValue(serde_json::Value),
71}
72
73/// struct for typed errors of method [`accounts_email_post`]
74#[derive(Debug, Clone, Serialize, Deserialize)]
75#[serde(untagged)]
76pub enum AccountsEmailPostError {
77    UnknownValue(serde_json::Value),
78}
79
80/// struct for typed errors of method [`accounts_email_token_post`]
81#[derive(Debug, Clone, Serialize, Deserialize)]
82#[serde(untagged)]
83pub enum AccountsEmailTokenPostError {
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`accounts_kdf_post`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum AccountsKdfPostError {
91    UnknownValue(serde_json::Value),
92}
93
94/// struct for typed errors of method [`accounts_keys_get`]
95#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(untagged)]
97pub enum AccountsKeysGetError {
98    UnknownValue(serde_json::Value),
99}
100
101/// struct for typed errors of method [`accounts_keys_post`]
102#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(untagged)]
104pub enum AccountsKeysPostError {
105    UnknownValue(serde_json::Value),
106}
107
108/// struct for typed errors of method [`accounts_license_post`]
109#[derive(Debug, Clone, Serialize, Deserialize)]
110#[serde(untagged)]
111pub enum AccountsLicensePostError {
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`accounts_organizations_get`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum AccountsOrganizationsGetError {
119    UnknownValue(serde_json::Value),
120}
121
122/// struct for typed errors of method [`accounts_password_hint_post`]
123#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum AccountsPasswordHintPostError {
126    UnknownValue(serde_json::Value),
127}
128
129/// struct for typed errors of method [`accounts_password_post`]
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(untagged)]
132pub enum AccountsPasswordPostError {
133    UnknownValue(serde_json::Value),
134}
135
136/// struct for typed errors of method [`accounts_payment_post`]
137#[derive(Debug, Clone, Serialize, Deserialize)]
138#[serde(untagged)]
139pub enum AccountsPaymentPostError {
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`accounts_premium_post`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum AccountsPremiumPostError {
147    UnknownValue(serde_json::Value),
148}
149
150/// struct for typed errors of method [`accounts_profile_get`]
151#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum AccountsProfileGetError {
154    UnknownValue(serde_json::Value),
155}
156
157/// struct for typed errors of method [`accounts_profile_post`]
158#[derive(Debug, Clone, Serialize, Deserialize)]
159#[serde(untagged)]
160pub enum AccountsProfilePostError {
161    UnknownValue(serde_json::Value),
162}
163
164/// struct for typed errors of method [`accounts_profile_put`]
165#[derive(Debug, Clone, Serialize, Deserialize)]
166#[serde(untagged)]
167pub enum AccountsProfilePutError {
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`accounts_reinstate_premium_post`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum AccountsReinstatePremiumPostError {
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`accounts_request_otp_post`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum AccountsRequestOtpPostError {
182    UnknownValue(serde_json::Value),
183}
184
185/// struct for typed errors of method [`accounts_resend_new_device_otp_post`]
186#[derive(Debug, Clone, Serialize, Deserialize)]
187#[serde(untagged)]
188pub enum AccountsResendNewDeviceOtpPostError {
189    UnknownValue(serde_json::Value),
190}
191
192/// struct for typed errors of method [`accounts_revision_date_get`]
193#[derive(Debug, Clone, Serialize, Deserialize)]
194#[serde(untagged)]
195pub enum AccountsRevisionDateGetError {
196    UnknownValue(serde_json::Value),
197}
198
199/// struct for typed errors of method [`accounts_rotate_api_key_post`]
200#[derive(Debug, Clone, Serialize, Deserialize)]
201#[serde(untagged)]
202pub enum AccountsRotateApiKeyPostError {
203    UnknownValue(serde_json::Value),
204}
205
206/// struct for typed errors of method [`accounts_security_stamp_post`]
207#[derive(Debug, Clone, Serialize, Deserialize)]
208#[serde(untagged)]
209pub enum AccountsSecurityStampPostError {
210    UnknownValue(serde_json::Value),
211}
212
213/// struct for typed errors of method [`accounts_set_password_post`]
214#[derive(Debug, Clone, Serialize, Deserialize)]
215#[serde(untagged)]
216pub enum AccountsSetPasswordPostError {
217    UnknownValue(serde_json::Value),
218}
219
220/// struct for typed errors of method [`accounts_sso_organization_id_delete`]
221#[derive(Debug, Clone, Serialize, Deserialize)]
222#[serde(untagged)]
223pub enum AccountsSsoOrganizationIdDeleteError {
224    UnknownValue(serde_json::Value),
225}
226
227/// struct for typed errors of method [`accounts_sso_user_identifier_get`]
228#[derive(Debug, Clone, Serialize, Deserialize)]
229#[serde(untagged)]
230pub enum AccountsSsoUserIdentifierGetError {
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`accounts_storage_post`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum AccountsStoragePostError {
238    UnknownValue(serde_json::Value),
239}
240
241/// struct for typed errors of method [`accounts_subscription_get`]
242#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum AccountsSubscriptionGetError {
245    UnknownValue(serde_json::Value),
246}
247
248/// struct for typed errors of method [`accounts_tax_get`]
249#[derive(Debug, Clone, Serialize, Deserialize)]
250#[serde(untagged)]
251pub enum AccountsTaxGetError {
252    UnknownValue(serde_json::Value),
253}
254
255/// struct for typed errors of method [`accounts_tax_put`]
256#[derive(Debug, Clone, Serialize, Deserialize)]
257#[serde(untagged)]
258pub enum AccountsTaxPutError {
259    UnknownValue(serde_json::Value),
260}
261
262/// struct for typed errors of method [`accounts_update_tde_offboarding_password_put`]
263#[derive(Debug, Clone, Serialize, Deserialize)]
264#[serde(untagged)]
265pub enum AccountsUpdateTdeOffboardingPasswordPutError {
266    UnknownValue(serde_json::Value),
267}
268
269/// struct for typed errors of method [`accounts_update_temp_password_put`]
270#[derive(Debug, Clone, Serialize, Deserialize)]
271#[serde(untagged)]
272pub enum AccountsUpdateTempPasswordPutError {
273    UnknownValue(serde_json::Value),
274}
275
276/// struct for typed errors of method [`accounts_verify_devices_post`]
277#[derive(Debug, Clone, Serialize, Deserialize)]
278#[serde(untagged)]
279pub enum AccountsVerifyDevicesPostError {
280    UnknownValue(serde_json::Value),
281}
282
283/// struct for typed errors of method [`accounts_verify_devices_put`]
284#[derive(Debug, Clone, Serialize, Deserialize)]
285#[serde(untagged)]
286pub enum AccountsVerifyDevicesPutError {
287    UnknownValue(serde_json::Value),
288}
289
290/// struct for typed errors of method [`accounts_verify_email_post`]
291#[derive(Debug, Clone, Serialize, Deserialize)]
292#[serde(untagged)]
293pub enum AccountsVerifyEmailPostError {
294    UnknownValue(serde_json::Value),
295}
296
297/// struct for typed errors of method [`accounts_verify_email_token_post`]
298#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum AccountsVerifyEmailTokenPostError {
301    UnknownValue(serde_json::Value),
302}
303
304/// struct for typed errors of method [`accounts_verify_otp_post`]
305#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum AccountsVerifyOtpPostError {
308    UnknownValue(serde_json::Value),
309}
310
311/// struct for typed errors of method [`accounts_verify_password_post`]
312#[derive(Debug, Clone, Serialize, Deserialize)]
313#[serde(untagged)]
314pub enum AccountsVerifyPasswordPostError {
315    UnknownValue(serde_json::Value),
316}
317
318pub async fn accounts_api_key_post(
319    configuration: &configuration::Configuration,
320    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
321) -> Result<models::ApiKeyResponseModel, Error<AccountsApiKeyPostError>> {
322    // add a prefix to parameters to efficiently prevent name collisions
323    let p_secret_verification_request_model = secret_verification_request_model;
324
325    let uri_str = format!("{}/accounts/api-key", configuration.base_path);
326    let mut req_builder = configuration
327        .client
328        .request(reqwest::Method::POST, &uri_str);
329
330    if let Some(ref user_agent) = configuration.user_agent {
331        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
332    }
333    if let Some(ref token) = configuration.oauth_access_token {
334        req_builder = req_builder.bearer_auth(token.to_owned());
335    };
336    req_builder = req_builder.json(&p_secret_verification_request_model);
337
338    let req = req_builder.build()?;
339    let resp = configuration.client.execute(req).await?;
340
341    let status = resp.status();
342    let content_type = resp
343        .headers()
344        .get("content-type")
345        .and_then(|v| v.to_str().ok())
346        .unwrap_or("application/octet-stream");
347    let content_type = super::ContentType::from(content_type);
348
349    if !status.is_client_error() && !status.is_server_error() {
350        let content = resp.text().await?;
351        match content_type {
352            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
353            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))),
354            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::ApiKeyResponseModel`")))),
355        }
356    } else {
357        let content = resp.text().await?;
358        let entity: Option<AccountsApiKeyPostError> = serde_json::from_str(&content).ok();
359        Err(Error::ResponseError(ResponseContent {
360            status,
361            content,
362            entity,
363        }))
364    }
365}
366
367pub async fn accounts_avatar_post(
368    configuration: &configuration::Configuration,
369    update_avatar_request_model: Option<models::UpdateAvatarRequestModel>,
370) -> Result<models::ProfileResponseModel, Error<AccountsAvatarPostError>> {
371    // add a prefix to parameters to efficiently prevent name collisions
372    let p_update_avatar_request_model = update_avatar_request_model;
373
374    let uri_str = format!("{}/accounts/avatar", configuration.base_path);
375    let mut req_builder = configuration
376        .client
377        .request(reqwest::Method::POST, &uri_str);
378
379    if let Some(ref user_agent) = configuration.user_agent {
380        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
381    }
382    if let Some(ref token) = configuration.oauth_access_token {
383        req_builder = req_builder.bearer_auth(token.to_owned());
384    };
385    req_builder = req_builder.json(&p_update_avatar_request_model);
386
387    let req = req_builder.build()?;
388    let resp = configuration.client.execute(req).await?;
389
390    let status = resp.status();
391    let content_type = resp
392        .headers()
393        .get("content-type")
394        .and_then(|v| v.to_str().ok())
395        .unwrap_or("application/octet-stream");
396    let content_type = super::ContentType::from(content_type);
397
398    if !status.is_client_error() && !status.is_server_error() {
399        let content = resp.text().await?;
400        match content_type {
401            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
402            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))),
403            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::ProfileResponseModel`")))),
404        }
405    } else {
406        let content = resp.text().await?;
407        let entity: Option<AccountsAvatarPostError> = serde_json::from_str(&content).ok();
408        Err(Error::ResponseError(ResponseContent {
409            status,
410            content,
411            entity,
412        }))
413    }
414}
415
416pub async fn accounts_avatar_put(
417    configuration: &configuration::Configuration,
418    update_avatar_request_model: Option<models::UpdateAvatarRequestModel>,
419) -> Result<models::ProfileResponseModel, Error<AccountsAvatarPutError>> {
420    // add a prefix to parameters to efficiently prevent name collisions
421    let p_update_avatar_request_model = update_avatar_request_model;
422
423    let uri_str = format!("{}/accounts/avatar", configuration.base_path);
424    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
425
426    if let Some(ref user_agent) = configuration.user_agent {
427        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
428    }
429    if let Some(ref token) = configuration.oauth_access_token {
430        req_builder = req_builder.bearer_auth(token.to_owned());
431    };
432    req_builder = req_builder.json(&p_update_avatar_request_model);
433
434    let req = req_builder.build()?;
435    let resp = configuration.client.execute(req).await?;
436
437    let status = resp.status();
438    let content_type = resp
439        .headers()
440        .get("content-type")
441        .and_then(|v| v.to_str().ok())
442        .unwrap_or("application/octet-stream");
443    let content_type = super::ContentType::from(content_type);
444
445    if !status.is_client_error() && !status.is_server_error() {
446        let content = resp.text().await?;
447        match content_type {
448            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
449            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))),
450            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::ProfileResponseModel`")))),
451        }
452    } else {
453        let content = resp.text().await?;
454        let entity: Option<AccountsAvatarPutError> = serde_json::from_str(&content).ok();
455        Err(Error::ResponseError(ResponseContent {
456            status,
457            content,
458            entity,
459        }))
460    }
461}
462
463pub async fn accounts_cancel_post(
464    configuration: &configuration::Configuration,
465    subscription_cancellation_request_model: Option<models::SubscriptionCancellationRequestModel>,
466) -> Result<(), Error<AccountsCancelPostError>> {
467    // add a prefix to parameters to efficiently prevent name collisions
468    let p_subscription_cancellation_request_model = subscription_cancellation_request_model;
469
470    let uri_str = format!("{}/accounts/cancel", configuration.base_path);
471    let mut req_builder = configuration
472        .client
473        .request(reqwest::Method::POST, &uri_str);
474
475    if let Some(ref user_agent) = configuration.user_agent {
476        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
477    }
478    if let Some(ref token) = configuration.oauth_access_token {
479        req_builder = req_builder.bearer_auth(token.to_owned());
480    };
481    req_builder = req_builder.json(&p_subscription_cancellation_request_model);
482
483    let req = req_builder.build()?;
484    let resp = configuration.client.execute(req).await?;
485
486    let status = resp.status();
487
488    if !status.is_client_error() && !status.is_server_error() {
489        Ok(())
490    } else {
491        let content = resp.text().await?;
492        let entity: Option<AccountsCancelPostError> = serde_json::from_str(&content).ok();
493        Err(Error::ResponseError(ResponseContent {
494            status,
495            content,
496            entity,
497        }))
498    }
499}
500
501pub async fn accounts_delete(
502    configuration: &configuration::Configuration,
503    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
504) -> Result<(), Error<AccountsDeleteError>> {
505    // add a prefix to parameters to efficiently prevent name collisions
506    let p_secret_verification_request_model = secret_verification_request_model;
507
508    let uri_str = format!("{}/accounts", configuration.base_path);
509    let mut req_builder = configuration
510        .client
511        .request(reqwest::Method::DELETE, &uri_str);
512
513    if let Some(ref user_agent) = configuration.user_agent {
514        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
515    }
516    if let Some(ref token) = configuration.oauth_access_token {
517        req_builder = req_builder.bearer_auth(token.to_owned());
518    };
519    req_builder = req_builder.json(&p_secret_verification_request_model);
520
521    let req = req_builder.build()?;
522    let resp = configuration.client.execute(req).await?;
523
524    let status = resp.status();
525
526    if !status.is_client_error() && !status.is_server_error() {
527        Ok(())
528    } else {
529        let content = resp.text().await?;
530        let entity: Option<AccountsDeleteError> = serde_json::from_str(&content).ok();
531        Err(Error::ResponseError(ResponseContent {
532            status,
533            content,
534            entity,
535        }))
536    }
537}
538
539pub async fn accounts_delete_post(
540    configuration: &configuration::Configuration,
541    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
542) -> Result<(), Error<AccountsDeletePostError>> {
543    // add a prefix to parameters to efficiently prevent name collisions
544    let p_secret_verification_request_model = secret_verification_request_model;
545
546    let uri_str = format!("{}/accounts/delete", configuration.base_path);
547    let mut req_builder = configuration
548        .client
549        .request(reqwest::Method::POST, &uri_str);
550
551    if let Some(ref user_agent) = configuration.user_agent {
552        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
553    }
554    if let Some(ref token) = configuration.oauth_access_token {
555        req_builder = req_builder.bearer_auth(token.to_owned());
556    };
557    req_builder = req_builder.json(&p_secret_verification_request_model);
558
559    let req = req_builder.build()?;
560    let resp = configuration.client.execute(req).await?;
561
562    let status = resp.status();
563
564    if !status.is_client_error() && !status.is_server_error() {
565        Ok(())
566    } else {
567        let content = resp.text().await?;
568        let entity: Option<AccountsDeletePostError> = serde_json::from_str(&content).ok();
569        Err(Error::ResponseError(ResponseContent {
570            status,
571            content,
572            entity,
573        }))
574    }
575}
576
577pub async fn accounts_delete_recover_post(
578    configuration: &configuration::Configuration,
579    delete_recover_request_model: Option<models::DeleteRecoverRequestModel>,
580) -> Result<(), Error<AccountsDeleteRecoverPostError>> {
581    // add a prefix to parameters to efficiently prevent name collisions
582    let p_delete_recover_request_model = delete_recover_request_model;
583
584    let uri_str = format!("{}/accounts/delete-recover", configuration.base_path);
585    let mut req_builder = configuration
586        .client
587        .request(reqwest::Method::POST, &uri_str);
588
589    if let Some(ref user_agent) = configuration.user_agent {
590        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
591    }
592    if let Some(ref token) = configuration.oauth_access_token {
593        req_builder = req_builder.bearer_auth(token.to_owned());
594    };
595    req_builder = req_builder.json(&p_delete_recover_request_model);
596
597    let req = req_builder.build()?;
598    let resp = configuration.client.execute(req).await?;
599
600    let status = resp.status();
601
602    if !status.is_client_error() && !status.is_server_error() {
603        Ok(())
604    } else {
605        let content = resp.text().await?;
606        let entity: Option<AccountsDeleteRecoverPostError> = serde_json::from_str(&content).ok();
607        Err(Error::ResponseError(ResponseContent {
608            status,
609            content,
610            entity,
611        }))
612    }
613}
614
615pub async fn accounts_delete_recover_token_post(
616    configuration: &configuration::Configuration,
617    verify_delete_recover_request_model: Option<models::VerifyDeleteRecoverRequestModel>,
618) -> Result<(), Error<AccountsDeleteRecoverTokenPostError>> {
619    // add a prefix to parameters to efficiently prevent name collisions
620    let p_verify_delete_recover_request_model = verify_delete_recover_request_model;
621
622    let uri_str = format!("{}/accounts/delete-recover-token", configuration.base_path);
623    let mut req_builder = configuration
624        .client
625        .request(reqwest::Method::POST, &uri_str);
626
627    if let Some(ref user_agent) = configuration.user_agent {
628        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
629    }
630    if let Some(ref token) = configuration.oauth_access_token {
631        req_builder = req_builder.bearer_auth(token.to_owned());
632    };
633    req_builder = req_builder.json(&p_verify_delete_recover_request_model);
634
635    let req = req_builder.build()?;
636    let resp = configuration.client.execute(req).await?;
637
638    let status = resp.status();
639
640    if !status.is_client_error() && !status.is_server_error() {
641        Ok(())
642    } else {
643        let content = resp.text().await?;
644        let entity: Option<AccountsDeleteRecoverTokenPostError> =
645            serde_json::from_str(&content).ok();
646        Err(Error::ResponseError(ResponseContent {
647            status,
648            content,
649            entity,
650        }))
651    }
652}
653
654pub async fn accounts_email_post(
655    configuration: &configuration::Configuration,
656    email_request_model: Option<models::EmailRequestModel>,
657) -> Result<(), Error<AccountsEmailPostError>> {
658    // add a prefix to parameters to efficiently prevent name collisions
659    let p_email_request_model = email_request_model;
660
661    let uri_str = format!("{}/accounts/email", configuration.base_path);
662    let mut req_builder = configuration
663        .client
664        .request(reqwest::Method::POST, &uri_str);
665
666    if let Some(ref user_agent) = configuration.user_agent {
667        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
668    }
669    if let Some(ref token) = configuration.oauth_access_token {
670        req_builder = req_builder.bearer_auth(token.to_owned());
671    };
672    req_builder = req_builder.json(&p_email_request_model);
673
674    let req = req_builder.build()?;
675    let resp = configuration.client.execute(req).await?;
676
677    let status = resp.status();
678
679    if !status.is_client_error() && !status.is_server_error() {
680        Ok(())
681    } else {
682        let content = resp.text().await?;
683        let entity: Option<AccountsEmailPostError> = serde_json::from_str(&content).ok();
684        Err(Error::ResponseError(ResponseContent {
685            status,
686            content,
687            entity,
688        }))
689    }
690}
691
692pub async fn accounts_email_token_post(
693    configuration: &configuration::Configuration,
694    email_token_request_model: Option<models::EmailTokenRequestModel>,
695) -> Result<(), Error<AccountsEmailTokenPostError>> {
696    // add a prefix to parameters to efficiently prevent name collisions
697    let p_email_token_request_model = email_token_request_model;
698
699    let uri_str = format!("{}/accounts/email-token", configuration.base_path);
700    let mut req_builder = configuration
701        .client
702        .request(reqwest::Method::POST, &uri_str);
703
704    if let Some(ref user_agent) = configuration.user_agent {
705        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
706    }
707    if let Some(ref token) = configuration.oauth_access_token {
708        req_builder = req_builder.bearer_auth(token.to_owned());
709    };
710    req_builder = req_builder.json(&p_email_token_request_model);
711
712    let req = req_builder.build()?;
713    let resp = configuration.client.execute(req).await?;
714
715    let status = resp.status();
716
717    if !status.is_client_error() && !status.is_server_error() {
718        Ok(())
719    } else {
720        let content = resp.text().await?;
721        let entity: Option<AccountsEmailTokenPostError> = serde_json::from_str(&content).ok();
722        Err(Error::ResponseError(ResponseContent {
723            status,
724            content,
725            entity,
726        }))
727    }
728}
729
730pub async fn accounts_kdf_post(
731    configuration: &configuration::Configuration,
732    kdf_request_model: Option<models::KdfRequestModel>,
733) -> Result<(), Error<AccountsKdfPostError>> {
734    // add a prefix to parameters to efficiently prevent name collisions
735    let p_kdf_request_model = kdf_request_model;
736
737    let uri_str = format!("{}/accounts/kdf", configuration.base_path);
738    let mut req_builder = configuration
739        .client
740        .request(reqwest::Method::POST, &uri_str);
741
742    if let Some(ref user_agent) = configuration.user_agent {
743        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
744    }
745    if let Some(ref token) = configuration.oauth_access_token {
746        req_builder = req_builder.bearer_auth(token.to_owned());
747    };
748    req_builder = req_builder.json(&p_kdf_request_model);
749
750    let req = req_builder.build()?;
751    let resp = configuration.client.execute(req).await?;
752
753    let status = resp.status();
754
755    if !status.is_client_error() && !status.is_server_error() {
756        Ok(())
757    } else {
758        let content = resp.text().await?;
759        let entity: Option<AccountsKdfPostError> = serde_json::from_str(&content).ok();
760        Err(Error::ResponseError(ResponseContent {
761            status,
762            content,
763            entity,
764        }))
765    }
766}
767
768pub async fn accounts_keys_get(
769    configuration: &configuration::Configuration,
770) -> Result<models::KeysResponseModel, Error<AccountsKeysGetError>> {
771    let uri_str = format!("{}/accounts/keys", configuration.base_path);
772    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
773
774    if let Some(ref user_agent) = configuration.user_agent {
775        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
776    }
777    if let Some(ref token) = configuration.oauth_access_token {
778        req_builder = req_builder.bearer_auth(token.to_owned());
779    };
780
781    let req = req_builder.build()?;
782    let resp = configuration.client.execute(req).await?;
783
784    let status = resp.status();
785    let content_type = resp
786        .headers()
787        .get("content-type")
788        .and_then(|v| v.to_str().ok())
789        .unwrap_or("application/octet-stream");
790    let content_type = super::ContentType::from(content_type);
791
792    if !status.is_client_error() && !status.is_server_error() {
793        let content = resp.text().await?;
794        match content_type {
795            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
796            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`"))),
797            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::KeysResponseModel`")))),
798        }
799    } else {
800        let content = resp.text().await?;
801        let entity: Option<AccountsKeysGetError> = serde_json::from_str(&content).ok();
802        Err(Error::ResponseError(ResponseContent {
803            status,
804            content,
805            entity,
806        }))
807    }
808}
809
810pub async fn accounts_keys_post(
811    configuration: &configuration::Configuration,
812    keys_request_model: Option<models::KeysRequestModel>,
813) -> Result<models::KeysResponseModel, Error<AccountsKeysPostError>> {
814    // add a prefix to parameters to efficiently prevent name collisions
815    let p_keys_request_model = keys_request_model;
816
817    let uri_str = format!("{}/accounts/keys", configuration.base_path);
818    let mut req_builder = configuration
819        .client
820        .request(reqwest::Method::POST, &uri_str);
821
822    if let Some(ref user_agent) = configuration.user_agent {
823        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
824    }
825    if let Some(ref token) = configuration.oauth_access_token {
826        req_builder = req_builder.bearer_auth(token.to_owned());
827    };
828    req_builder = req_builder.json(&p_keys_request_model);
829
830    let req = req_builder.build()?;
831    let resp = configuration.client.execute(req).await?;
832
833    let status = resp.status();
834    let content_type = resp
835        .headers()
836        .get("content-type")
837        .and_then(|v| v.to_str().ok())
838        .unwrap_or("application/octet-stream");
839    let content_type = super::ContentType::from(content_type);
840
841    if !status.is_client_error() && !status.is_server_error() {
842        let content = resp.text().await?;
843        match content_type {
844            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
845            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KeysResponseModel`"))),
846            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::KeysResponseModel`")))),
847        }
848    } else {
849        let content = resp.text().await?;
850        let entity: Option<AccountsKeysPostError> = serde_json::from_str(&content).ok();
851        Err(Error::ResponseError(ResponseContent {
852            status,
853            content,
854            entity,
855        }))
856    }
857}
858
859pub async fn accounts_license_post(
860    configuration: &configuration::Configuration,
861    license: std::path::PathBuf,
862) -> Result<(), Error<AccountsLicensePostError>> {
863    // add a prefix to parameters to efficiently prevent name collisions
864    let p_license = license;
865
866    let uri_str = format!("{}/accounts/license", configuration.base_path);
867    let mut req_builder = configuration
868        .client
869        .request(reqwest::Method::POST, &uri_str);
870
871    if let Some(ref user_agent) = configuration.user_agent {
872        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
873    }
874    if let Some(ref token) = configuration.oauth_access_token {
875        req_builder = req_builder.bearer_auth(token.to_owned());
876    };
877    let mut multipart_form = reqwest::multipart::Form::new();
878    // TODO: support file upload for 'license' parameter
879    req_builder = req_builder.multipart(multipart_form);
880
881    let req = req_builder.build()?;
882    let resp = configuration.client.execute(req).await?;
883
884    let status = resp.status();
885
886    if !status.is_client_error() && !status.is_server_error() {
887        Ok(())
888    } else {
889        let content = resp.text().await?;
890        let entity: Option<AccountsLicensePostError> = serde_json::from_str(&content).ok();
891        Err(Error::ResponseError(ResponseContent {
892            status,
893            content,
894            entity,
895        }))
896    }
897}
898
899pub async fn accounts_organizations_get(
900    configuration: &configuration::Configuration,
901) -> Result<
902    models::ProfileOrganizationResponseModelListResponseModel,
903    Error<AccountsOrganizationsGetError>,
904> {
905    let uri_str = format!("{}/accounts/organizations", configuration.base_path);
906    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
907
908    if let Some(ref user_agent) = configuration.user_agent {
909        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
910    }
911    if let Some(ref token) = configuration.oauth_access_token {
912        req_builder = req_builder.bearer_auth(token.to_owned());
913    };
914
915    let req = req_builder.build()?;
916    let resp = configuration.client.execute(req).await?;
917
918    let status = resp.status();
919    let content_type = resp
920        .headers()
921        .get("content-type")
922        .and_then(|v| v.to_str().ok())
923        .unwrap_or("application/octet-stream");
924    let content_type = super::ContentType::from(content_type);
925
926    if !status.is_client_error() && !status.is_server_error() {
927        let content = resp.text().await?;
928        match content_type {
929            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
930            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`"))),
931            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::ProfileOrganizationResponseModelListResponseModel`")))),
932        }
933    } else {
934        let content = resp.text().await?;
935        let entity: Option<AccountsOrganizationsGetError> = serde_json::from_str(&content).ok();
936        Err(Error::ResponseError(ResponseContent {
937            status,
938            content,
939            entity,
940        }))
941    }
942}
943
944pub async fn accounts_password_hint_post(
945    configuration: &configuration::Configuration,
946    password_hint_request_model: Option<models::PasswordHintRequestModel>,
947) -> Result<(), Error<AccountsPasswordHintPostError>> {
948    // add a prefix to parameters to efficiently prevent name collisions
949    let p_password_hint_request_model = password_hint_request_model;
950
951    let uri_str = format!("{}/accounts/password-hint", configuration.base_path);
952    let mut req_builder = configuration
953        .client
954        .request(reqwest::Method::POST, &uri_str);
955
956    if let Some(ref user_agent) = configuration.user_agent {
957        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
958    }
959    if let Some(ref token) = configuration.oauth_access_token {
960        req_builder = req_builder.bearer_auth(token.to_owned());
961    };
962    req_builder = req_builder.json(&p_password_hint_request_model);
963
964    let req = req_builder.build()?;
965    let resp = configuration.client.execute(req).await?;
966
967    let status = resp.status();
968
969    if !status.is_client_error() && !status.is_server_error() {
970        Ok(())
971    } else {
972        let content = resp.text().await?;
973        let entity: Option<AccountsPasswordHintPostError> = serde_json::from_str(&content).ok();
974        Err(Error::ResponseError(ResponseContent {
975            status,
976            content,
977            entity,
978        }))
979    }
980}
981
982pub async fn accounts_password_post(
983    configuration: &configuration::Configuration,
984    password_request_model: Option<models::PasswordRequestModel>,
985) -> Result<(), Error<AccountsPasswordPostError>> {
986    // add a prefix to parameters to efficiently prevent name collisions
987    let p_password_request_model = password_request_model;
988
989    let uri_str = format!("{}/accounts/password", configuration.base_path);
990    let mut req_builder = configuration
991        .client
992        .request(reqwest::Method::POST, &uri_str);
993
994    if let Some(ref user_agent) = configuration.user_agent {
995        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
996    }
997    if let Some(ref token) = configuration.oauth_access_token {
998        req_builder = req_builder.bearer_auth(token.to_owned());
999    };
1000    req_builder = req_builder.json(&p_password_request_model);
1001
1002    let req = req_builder.build()?;
1003    let resp = configuration.client.execute(req).await?;
1004
1005    let status = resp.status();
1006
1007    if !status.is_client_error() && !status.is_server_error() {
1008        Ok(())
1009    } else {
1010        let content = resp.text().await?;
1011        let entity: Option<AccountsPasswordPostError> = serde_json::from_str(&content).ok();
1012        Err(Error::ResponseError(ResponseContent {
1013            status,
1014            content,
1015            entity,
1016        }))
1017    }
1018}
1019
1020pub async fn accounts_payment_post(
1021    configuration: &configuration::Configuration,
1022    payment_request_model: Option<models::PaymentRequestModel>,
1023) -> Result<(), Error<AccountsPaymentPostError>> {
1024    // add a prefix to parameters to efficiently prevent name collisions
1025    let p_payment_request_model = payment_request_model;
1026
1027    let uri_str = format!("{}/accounts/payment", configuration.base_path);
1028    let mut req_builder = configuration
1029        .client
1030        .request(reqwest::Method::POST, &uri_str);
1031
1032    if let Some(ref user_agent) = configuration.user_agent {
1033        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1034    }
1035    if let Some(ref token) = configuration.oauth_access_token {
1036        req_builder = req_builder.bearer_auth(token.to_owned());
1037    };
1038    req_builder = req_builder.json(&p_payment_request_model);
1039
1040    let req = req_builder.build()?;
1041    let resp = configuration.client.execute(req).await?;
1042
1043    let status = resp.status();
1044
1045    if !status.is_client_error() && !status.is_server_error() {
1046        Ok(())
1047    } else {
1048        let content = resp.text().await?;
1049        let entity: Option<AccountsPaymentPostError> = serde_json::from_str(&content).ok();
1050        Err(Error::ResponseError(ResponseContent {
1051            status,
1052            content,
1053            entity,
1054        }))
1055    }
1056}
1057
1058pub async fn accounts_premium_post(
1059    configuration: &configuration::Configuration,
1060    payment_method_type: models::PaymentMethodType,
1061    payment_token: Option<&str>,
1062    additional_storage_gb: Option<i32>,
1063    country: Option<&str>,
1064    postal_code: Option<&str>,
1065    license: Option<std::path::PathBuf>,
1066) -> Result<models::PaymentResponseModel, Error<AccountsPremiumPostError>> {
1067    // add a prefix to parameters to efficiently prevent name collisions
1068    let p_payment_method_type = payment_method_type;
1069    let p_payment_token = payment_token;
1070    let p_additional_storage_gb = additional_storage_gb;
1071    let p_country = country;
1072    let p_postal_code = postal_code;
1073    let p_license = license;
1074
1075    let uri_str = format!("{}/accounts/premium", configuration.base_path);
1076    let mut req_builder = configuration
1077        .client
1078        .request(reqwest::Method::POST, &uri_str);
1079
1080    req_builder = req_builder.query(&[("paymentMethodType", &p_payment_method_type.to_string())]);
1081    if let Some(ref param_value) = p_payment_token {
1082        req_builder = req_builder.query(&[("paymentToken", &param_value.to_string())]);
1083    }
1084    if let Some(ref param_value) = p_additional_storage_gb {
1085        req_builder = req_builder.query(&[("additionalStorageGb", &param_value.to_string())]);
1086    }
1087    if let Some(ref param_value) = p_country {
1088        req_builder = req_builder.query(&[("country", &param_value.to_string())]);
1089    }
1090    if let Some(ref param_value) = p_postal_code {
1091        req_builder = req_builder.query(&[("postalCode", &param_value.to_string())]);
1092    }
1093    if let Some(ref user_agent) = configuration.user_agent {
1094        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1095    }
1096    if let Some(ref token) = configuration.oauth_access_token {
1097        req_builder = req_builder.bearer_auth(token.to_owned());
1098    };
1099    let mut multipart_form = reqwest::multipart::Form::new();
1100    // TODO: support file upload for 'license' parameter
1101    req_builder = req_builder.multipart(multipart_form);
1102
1103    let req = req_builder.build()?;
1104    let resp = configuration.client.execute(req).await?;
1105
1106    let status = resp.status();
1107    let content_type = resp
1108        .headers()
1109        .get("content-type")
1110        .and_then(|v| v.to_str().ok())
1111        .unwrap_or("application/octet-stream");
1112    let content_type = super::ContentType::from(content_type);
1113
1114    if !status.is_client_error() && !status.is_server_error() {
1115        let content = resp.text().await?;
1116        match content_type {
1117            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1118            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))),
1119            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::PaymentResponseModel`")))),
1120        }
1121    } else {
1122        let content = resp.text().await?;
1123        let entity: Option<AccountsPremiumPostError> = serde_json::from_str(&content).ok();
1124        Err(Error::ResponseError(ResponseContent {
1125            status,
1126            content,
1127            entity,
1128        }))
1129    }
1130}
1131
1132pub async fn accounts_profile_get(
1133    configuration: &configuration::Configuration,
1134) -> Result<models::ProfileResponseModel, Error<AccountsProfileGetError>> {
1135    let uri_str = format!("{}/accounts/profile", configuration.base_path);
1136    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1137
1138    if let Some(ref user_agent) = configuration.user_agent {
1139        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1140    }
1141    if let Some(ref token) = configuration.oauth_access_token {
1142        req_builder = req_builder.bearer_auth(token.to_owned());
1143    };
1144
1145    let req = req_builder.build()?;
1146    let resp = configuration.client.execute(req).await?;
1147
1148    let status = resp.status();
1149    let content_type = resp
1150        .headers()
1151        .get("content-type")
1152        .and_then(|v| v.to_str().ok())
1153        .unwrap_or("application/octet-stream");
1154    let content_type = super::ContentType::from(content_type);
1155
1156    if !status.is_client_error() && !status.is_server_error() {
1157        let content = resp.text().await?;
1158        match content_type {
1159            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1160            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))),
1161            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::ProfileResponseModel`")))),
1162        }
1163    } else {
1164        let content = resp.text().await?;
1165        let entity: Option<AccountsProfileGetError> = serde_json::from_str(&content).ok();
1166        Err(Error::ResponseError(ResponseContent {
1167            status,
1168            content,
1169            entity,
1170        }))
1171    }
1172}
1173
1174pub async fn accounts_profile_post(
1175    configuration: &configuration::Configuration,
1176    update_profile_request_model: Option<models::UpdateProfileRequestModel>,
1177) -> Result<models::ProfileResponseModel, Error<AccountsProfilePostError>> {
1178    // add a prefix to parameters to efficiently prevent name collisions
1179    let p_update_profile_request_model = update_profile_request_model;
1180
1181    let uri_str = format!("{}/accounts/profile", configuration.base_path);
1182    let mut req_builder = configuration
1183        .client
1184        .request(reqwest::Method::POST, &uri_str);
1185
1186    if let Some(ref user_agent) = configuration.user_agent {
1187        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1188    }
1189    if let Some(ref token) = configuration.oauth_access_token {
1190        req_builder = req_builder.bearer_auth(token.to_owned());
1191    };
1192    req_builder = req_builder.json(&p_update_profile_request_model);
1193
1194    let req = req_builder.build()?;
1195    let resp = configuration.client.execute(req).await?;
1196
1197    let status = resp.status();
1198    let content_type = resp
1199        .headers()
1200        .get("content-type")
1201        .and_then(|v| v.to_str().ok())
1202        .unwrap_or("application/octet-stream");
1203    let content_type = super::ContentType::from(content_type);
1204
1205    if !status.is_client_error() && !status.is_server_error() {
1206        let content = resp.text().await?;
1207        match content_type {
1208            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1209            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))),
1210            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::ProfileResponseModel`")))),
1211        }
1212    } else {
1213        let content = resp.text().await?;
1214        let entity: Option<AccountsProfilePostError> = serde_json::from_str(&content).ok();
1215        Err(Error::ResponseError(ResponseContent {
1216            status,
1217            content,
1218            entity,
1219        }))
1220    }
1221}
1222
1223pub async fn accounts_profile_put(
1224    configuration: &configuration::Configuration,
1225    update_profile_request_model: Option<models::UpdateProfileRequestModel>,
1226) -> Result<models::ProfileResponseModel, Error<AccountsProfilePutError>> {
1227    // add a prefix to parameters to efficiently prevent name collisions
1228    let p_update_profile_request_model = update_profile_request_model;
1229
1230    let uri_str = format!("{}/accounts/profile", configuration.base_path);
1231    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1232
1233    if let Some(ref user_agent) = configuration.user_agent {
1234        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1235    }
1236    if let Some(ref token) = configuration.oauth_access_token {
1237        req_builder = req_builder.bearer_auth(token.to_owned());
1238    };
1239    req_builder = req_builder.json(&p_update_profile_request_model);
1240
1241    let req = req_builder.build()?;
1242    let resp = configuration.client.execute(req).await?;
1243
1244    let status = resp.status();
1245    let content_type = resp
1246        .headers()
1247        .get("content-type")
1248        .and_then(|v| v.to_str().ok())
1249        .unwrap_or("application/octet-stream");
1250    let content_type = super::ContentType::from(content_type);
1251
1252    if !status.is_client_error() && !status.is_server_error() {
1253        let content = resp.text().await?;
1254        match content_type {
1255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1256            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponseModel`"))),
1257            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::ProfileResponseModel`")))),
1258        }
1259    } else {
1260        let content = resp.text().await?;
1261        let entity: Option<AccountsProfilePutError> = serde_json::from_str(&content).ok();
1262        Err(Error::ResponseError(ResponseContent {
1263            status,
1264            content,
1265            entity,
1266        }))
1267    }
1268}
1269
1270pub async fn accounts_reinstate_premium_post(
1271    configuration: &configuration::Configuration,
1272) -> Result<(), Error<AccountsReinstatePremiumPostError>> {
1273    let uri_str = format!("{}/accounts/reinstate-premium", configuration.base_path);
1274    let mut req_builder = configuration
1275        .client
1276        .request(reqwest::Method::POST, &uri_str);
1277
1278    if let Some(ref user_agent) = configuration.user_agent {
1279        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1280    }
1281    if let Some(ref token) = configuration.oauth_access_token {
1282        req_builder = req_builder.bearer_auth(token.to_owned());
1283    };
1284
1285    let req = req_builder.build()?;
1286    let resp = configuration.client.execute(req).await?;
1287
1288    let status = resp.status();
1289
1290    if !status.is_client_error() && !status.is_server_error() {
1291        Ok(())
1292    } else {
1293        let content = resp.text().await?;
1294        let entity: Option<AccountsReinstatePremiumPostError> = serde_json::from_str(&content).ok();
1295        Err(Error::ResponseError(ResponseContent {
1296            status,
1297            content,
1298            entity,
1299        }))
1300    }
1301}
1302
1303pub async fn accounts_request_otp_post(
1304    configuration: &configuration::Configuration,
1305) -> Result<(), Error<AccountsRequestOtpPostError>> {
1306    let uri_str = format!("{}/accounts/request-otp", configuration.base_path);
1307    let mut req_builder = configuration
1308        .client
1309        .request(reqwest::Method::POST, &uri_str);
1310
1311    if let Some(ref user_agent) = configuration.user_agent {
1312        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1313    }
1314    if let Some(ref token) = configuration.oauth_access_token {
1315        req_builder = req_builder.bearer_auth(token.to_owned());
1316    };
1317
1318    let req = req_builder.build()?;
1319    let resp = configuration.client.execute(req).await?;
1320
1321    let status = resp.status();
1322
1323    if !status.is_client_error() && !status.is_server_error() {
1324        Ok(())
1325    } else {
1326        let content = resp.text().await?;
1327        let entity: Option<AccountsRequestOtpPostError> = serde_json::from_str(&content).ok();
1328        Err(Error::ResponseError(ResponseContent {
1329            status,
1330            content,
1331            entity,
1332        }))
1333    }
1334}
1335
1336pub async fn accounts_resend_new_device_otp_post(
1337    configuration: &configuration::Configuration,
1338    unauthenticated_secret_verification_request_model: Option<
1339        models::UnauthenticatedSecretVerificationRequestModel,
1340    >,
1341) -> Result<(), Error<AccountsResendNewDeviceOtpPostError>> {
1342    // add a prefix to parameters to efficiently prevent name collisions
1343    let p_unauthenticated_secret_verification_request_model =
1344        unauthenticated_secret_verification_request_model;
1345
1346    let uri_str = format!("{}/accounts/resend-new-device-otp", configuration.base_path);
1347    let mut req_builder = configuration
1348        .client
1349        .request(reqwest::Method::POST, &uri_str);
1350
1351    if let Some(ref user_agent) = configuration.user_agent {
1352        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1353    }
1354    if let Some(ref token) = configuration.oauth_access_token {
1355        req_builder = req_builder.bearer_auth(token.to_owned());
1356    };
1357    req_builder = req_builder.json(&p_unauthenticated_secret_verification_request_model);
1358
1359    let req = req_builder.build()?;
1360    let resp = configuration.client.execute(req).await?;
1361
1362    let status = resp.status();
1363
1364    if !status.is_client_error() && !status.is_server_error() {
1365        Ok(())
1366    } else {
1367        let content = resp.text().await?;
1368        let entity: Option<AccountsResendNewDeviceOtpPostError> =
1369            serde_json::from_str(&content).ok();
1370        Err(Error::ResponseError(ResponseContent {
1371            status,
1372            content,
1373            entity,
1374        }))
1375    }
1376}
1377
1378pub async fn accounts_revision_date_get(
1379    configuration: &configuration::Configuration,
1380) -> Result<i64, Error<AccountsRevisionDateGetError>> {
1381    let uri_str = format!("{}/accounts/revision-date", configuration.base_path);
1382    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1383
1384    if let Some(ref user_agent) = configuration.user_agent {
1385        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1386    }
1387    if let Some(ref token) = configuration.oauth_access_token {
1388        req_builder = req_builder.bearer_auth(token.to_owned());
1389    };
1390
1391    let req = req_builder.build()?;
1392    let resp = configuration.client.execute(req).await?;
1393
1394    let status = resp.status();
1395    let content_type = resp
1396        .headers()
1397        .get("content-type")
1398        .and_then(|v| v.to_str().ok())
1399        .unwrap_or("application/octet-stream");
1400    let content_type = super::ContentType::from(content_type);
1401
1402    if !status.is_client_error() && !status.is_server_error() {
1403        let content = resp.text().await?;
1404        match content_type {
1405            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1406            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `i64`"))),
1407            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `i64`")))),
1408        }
1409    } else {
1410        let content = resp.text().await?;
1411        let entity: Option<AccountsRevisionDateGetError> = serde_json::from_str(&content).ok();
1412        Err(Error::ResponseError(ResponseContent {
1413            status,
1414            content,
1415            entity,
1416        }))
1417    }
1418}
1419
1420pub async fn accounts_rotate_api_key_post(
1421    configuration: &configuration::Configuration,
1422    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
1423) -> Result<models::ApiKeyResponseModel, Error<AccountsRotateApiKeyPostError>> {
1424    // add a prefix to parameters to efficiently prevent name collisions
1425    let p_secret_verification_request_model = secret_verification_request_model;
1426
1427    let uri_str = format!("{}/accounts/rotate-api-key", configuration.base_path);
1428    let mut req_builder = configuration
1429        .client
1430        .request(reqwest::Method::POST, &uri_str);
1431
1432    if let Some(ref user_agent) = configuration.user_agent {
1433        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1434    }
1435    if let Some(ref token) = configuration.oauth_access_token {
1436        req_builder = req_builder.bearer_auth(token.to_owned());
1437    };
1438    req_builder = req_builder.json(&p_secret_verification_request_model);
1439
1440    let req = req_builder.build()?;
1441    let resp = configuration.client.execute(req).await?;
1442
1443    let status = resp.status();
1444    let content_type = resp
1445        .headers()
1446        .get("content-type")
1447        .and_then(|v| v.to_str().ok())
1448        .unwrap_or("application/octet-stream");
1449    let content_type = super::ContentType::from(content_type);
1450
1451    if !status.is_client_error() && !status.is_server_error() {
1452        let content = resp.text().await?;
1453        match content_type {
1454            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1455            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))),
1456            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::ApiKeyResponseModel`")))),
1457        }
1458    } else {
1459        let content = resp.text().await?;
1460        let entity: Option<AccountsRotateApiKeyPostError> = serde_json::from_str(&content).ok();
1461        Err(Error::ResponseError(ResponseContent {
1462            status,
1463            content,
1464            entity,
1465        }))
1466    }
1467}
1468
1469pub async fn accounts_security_stamp_post(
1470    configuration: &configuration::Configuration,
1471    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
1472) -> Result<(), Error<AccountsSecurityStampPostError>> {
1473    // add a prefix to parameters to efficiently prevent name collisions
1474    let p_secret_verification_request_model = secret_verification_request_model;
1475
1476    let uri_str = format!("{}/accounts/security-stamp", configuration.base_path);
1477    let mut req_builder = configuration
1478        .client
1479        .request(reqwest::Method::POST, &uri_str);
1480
1481    if let Some(ref user_agent) = configuration.user_agent {
1482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1483    }
1484    if let Some(ref token) = configuration.oauth_access_token {
1485        req_builder = req_builder.bearer_auth(token.to_owned());
1486    };
1487    req_builder = req_builder.json(&p_secret_verification_request_model);
1488
1489    let req = req_builder.build()?;
1490    let resp = configuration.client.execute(req).await?;
1491
1492    let status = resp.status();
1493
1494    if !status.is_client_error() && !status.is_server_error() {
1495        Ok(())
1496    } else {
1497        let content = resp.text().await?;
1498        let entity: Option<AccountsSecurityStampPostError> = serde_json::from_str(&content).ok();
1499        Err(Error::ResponseError(ResponseContent {
1500            status,
1501            content,
1502            entity,
1503        }))
1504    }
1505}
1506
1507pub async fn accounts_set_password_post(
1508    configuration: &configuration::Configuration,
1509    set_password_request_model: Option<models::SetPasswordRequestModel>,
1510) -> Result<(), Error<AccountsSetPasswordPostError>> {
1511    // add a prefix to parameters to efficiently prevent name collisions
1512    let p_set_password_request_model = set_password_request_model;
1513
1514    let uri_str = format!("{}/accounts/set-password", configuration.base_path);
1515    let mut req_builder = configuration
1516        .client
1517        .request(reqwest::Method::POST, &uri_str);
1518
1519    if let Some(ref user_agent) = configuration.user_agent {
1520        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1521    }
1522    if let Some(ref token) = configuration.oauth_access_token {
1523        req_builder = req_builder.bearer_auth(token.to_owned());
1524    };
1525    req_builder = req_builder.json(&p_set_password_request_model);
1526
1527    let req = req_builder.build()?;
1528    let resp = configuration.client.execute(req).await?;
1529
1530    let status = resp.status();
1531
1532    if !status.is_client_error() && !status.is_server_error() {
1533        Ok(())
1534    } else {
1535        let content = resp.text().await?;
1536        let entity: Option<AccountsSetPasswordPostError> = serde_json::from_str(&content).ok();
1537        Err(Error::ResponseError(ResponseContent {
1538            status,
1539            content,
1540            entity,
1541        }))
1542    }
1543}
1544
1545pub async fn accounts_sso_organization_id_delete(
1546    configuration: &configuration::Configuration,
1547    organization_id: &str,
1548) -> Result<(), Error<AccountsSsoOrganizationIdDeleteError>> {
1549    // add a prefix to parameters to efficiently prevent name collisions
1550    let p_organization_id = organization_id;
1551
1552    let uri_str = format!(
1553        "{}/accounts/sso/{organizationId}",
1554        configuration.base_path,
1555        organizationId = crate::apis::urlencode(p_organization_id)
1556    );
1557    let mut req_builder = configuration
1558        .client
1559        .request(reqwest::Method::DELETE, &uri_str);
1560
1561    if let Some(ref user_agent) = configuration.user_agent {
1562        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1563    }
1564    if let Some(ref token) = configuration.oauth_access_token {
1565        req_builder = req_builder.bearer_auth(token.to_owned());
1566    };
1567
1568    let req = req_builder.build()?;
1569    let resp = configuration.client.execute(req).await?;
1570
1571    let status = resp.status();
1572
1573    if !status.is_client_error() && !status.is_server_error() {
1574        Ok(())
1575    } else {
1576        let content = resp.text().await?;
1577        let entity: Option<AccountsSsoOrganizationIdDeleteError> =
1578            serde_json::from_str(&content).ok();
1579        Err(Error::ResponseError(ResponseContent {
1580            status,
1581            content,
1582            entity,
1583        }))
1584    }
1585}
1586
1587pub async fn accounts_sso_user_identifier_get(
1588    configuration: &configuration::Configuration,
1589) -> Result<String, Error<AccountsSsoUserIdentifierGetError>> {
1590    let uri_str = format!("{}/accounts/sso/user-identifier", configuration.base_path);
1591    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1592
1593    if let Some(ref user_agent) = configuration.user_agent {
1594        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1595    }
1596    if let Some(ref token) = configuration.oauth_access_token {
1597        req_builder = req_builder.bearer_auth(token.to_owned());
1598    };
1599
1600    let req = req_builder.build()?;
1601    let resp = configuration.client.execute(req).await?;
1602
1603    let status = resp.status();
1604    let content_type = resp
1605        .headers()
1606        .get("content-type")
1607        .and_then(|v| v.to_str().ok())
1608        .unwrap_or("application/octet-stream");
1609    let content_type = super::ContentType::from(content_type);
1610
1611    if !status.is_client_error() && !status.is_server_error() {
1612        let content = resp.text().await?;
1613        match content_type {
1614            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1615            ContentType::Text => return Ok(content),
1616            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))),
1617        }
1618    } else {
1619        let content = resp.text().await?;
1620        let entity: Option<AccountsSsoUserIdentifierGetError> = serde_json::from_str(&content).ok();
1621        Err(Error::ResponseError(ResponseContent {
1622            status,
1623            content,
1624            entity,
1625        }))
1626    }
1627}
1628
1629pub async fn accounts_storage_post(
1630    configuration: &configuration::Configuration,
1631    storage_request_model: Option<models::StorageRequestModel>,
1632) -> Result<models::PaymentResponseModel, Error<AccountsStoragePostError>> {
1633    // add a prefix to parameters to efficiently prevent name collisions
1634    let p_storage_request_model = storage_request_model;
1635
1636    let uri_str = format!("{}/accounts/storage", configuration.base_path);
1637    let mut req_builder = configuration
1638        .client
1639        .request(reqwest::Method::POST, &uri_str);
1640
1641    if let Some(ref user_agent) = configuration.user_agent {
1642        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1643    }
1644    if let Some(ref token) = configuration.oauth_access_token {
1645        req_builder = req_builder.bearer_auth(token.to_owned());
1646    };
1647    req_builder = req_builder.json(&p_storage_request_model);
1648
1649    let req = req_builder.build()?;
1650    let resp = configuration.client.execute(req).await?;
1651
1652    let status = resp.status();
1653    let content_type = resp
1654        .headers()
1655        .get("content-type")
1656        .and_then(|v| v.to_str().ok())
1657        .unwrap_or("application/octet-stream");
1658    let content_type = super::ContentType::from(content_type);
1659
1660    if !status.is_client_error() && !status.is_server_error() {
1661        let content = resp.text().await?;
1662        match content_type {
1663            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1664            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))),
1665            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::PaymentResponseModel`")))),
1666        }
1667    } else {
1668        let content = resp.text().await?;
1669        let entity: Option<AccountsStoragePostError> = serde_json::from_str(&content).ok();
1670        Err(Error::ResponseError(ResponseContent {
1671            status,
1672            content,
1673            entity,
1674        }))
1675    }
1676}
1677
1678pub async fn accounts_subscription_get(
1679    configuration: &configuration::Configuration,
1680) -> Result<models::SubscriptionResponseModel, Error<AccountsSubscriptionGetError>> {
1681    let uri_str = format!("{}/accounts/subscription", configuration.base_path);
1682    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1683
1684    if let Some(ref user_agent) = configuration.user_agent {
1685        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1686    }
1687    if let Some(ref token) = configuration.oauth_access_token {
1688        req_builder = req_builder.bearer_auth(token.to_owned());
1689    };
1690
1691    let req = req_builder.build()?;
1692    let resp = configuration.client.execute(req).await?;
1693
1694    let status = resp.status();
1695    let content_type = resp
1696        .headers()
1697        .get("content-type")
1698        .and_then(|v| v.to_str().ok())
1699        .unwrap_or("application/octet-stream");
1700    let content_type = super::ContentType::from(content_type);
1701
1702    if !status.is_client_error() && !status.is_server_error() {
1703        let content = resp.text().await?;
1704        match content_type {
1705            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1706            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SubscriptionResponseModel`"))),
1707            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::SubscriptionResponseModel`")))),
1708        }
1709    } else {
1710        let content = resp.text().await?;
1711        let entity: Option<AccountsSubscriptionGetError> = serde_json::from_str(&content).ok();
1712        Err(Error::ResponseError(ResponseContent {
1713            status,
1714            content,
1715            entity,
1716        }))
1717    }
1718}
1719
1720pub async fn accounts_tax_get(
1721    configuration: &configuration::Configuration,
1722) -> Result<models::TaxInfoResponseModel, Error<AccountsTaxGetError>> {
1723    let uri_str = format!("{}/accounts/tax", configuration.base_path);
1724    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1725
1726    if let Some(ref user_agent) = configuration.user_agent {
1727        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1728    }
1729    if let Some(ref token) = configuration.oauth_access_token {
1730        req_builder = req_builder.bearer_auth(token.to_owned());
1731    };
1732
1733    let req = req_builder.build()?;
1734    let resp = configuration.client.execute(req).await?;
1735
1736    let status = resp.status();
1737    let content_type = resp
1738        .headers()
1739        .get("content-type")
1740        .and_then(|v| v.to_str().ok())
1741        .unwrap_or("application/octet-stream");
1742    let content_type = super::ContentType::from(content_type);
1743
1744    if !status.is_client_error() && !status.is_server_error() {
1745        let content = resp.text().await?;
1746        match content_type {
1747            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1748            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`"))),
1749            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::TaxInfoResponseModel`")))),
1750        }
1751    } else {
1752        let content = resp.text().await?;
1753        let entity: Option<AccountsTaxGetError> = serde_json::from_str(&content).ok();
1754        Err(Error::ResponseError(ResponseContent {
1755            status,
1756            content,
1757            entity,
1758        }))
1759    }
1760}
1761
1762pub async fn accounts_tax_put(
1763    configuration: &configuration::Configuration,
1764    tax_info_update_request_model: Option<models::TaxInfoUpdateRequestModel>,
1765) -> Result<(), Error<AccountsTaxPutError>> {
1766    // add a prefix to parameters to efficiently prevent name collisions
1767    let p_tax_info_update_request_model = tax_info_update_request_model;
1768
1769    let uri_str = format!("{}/accounts/tax", configuration.base_path);
1770    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1771
1772    if let Some(ref user_agent) = configuration.user_agent {
1773        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1774    }
1775    if let Some(ref token) = configuration.oauth_access_token {
1776        req_builder = req_builder.bearer_auth(token.to_owned());
1777    };
1778    req_builder = req_builder.json(&p_tax_info_update_request_model);
1779
1780    let req = req_builder.build()?;
1781    let resp = configuration.client.execute(req).await?;
1782
1783    let status = resp.status();
1784
1785    if !status.is_client_error() && !status.is_server_error() {
1786        Ok(())
1787    } else {
1788        let content = resp.text().await?;
1789        let entity: Option<AccountsTaxPutError> = serde_json::from_str(&content).ok();
1790        Err(Error::ResponseError(ResponseContent {
1791            status,
1792            content,
1793            entity,
1794        }))
1795    }
1796}
1797
1798pub async fn accounts_update_tde_offboarding_password_put(
1799    configuration: &configuration::Configuration,
1800    update_tde_offboarding_password_request_model: Option<
1801        models::UpdateTdeOffboardingPasswordRequestModel,
1802    >,
1803) -> Result<(), Error<AccountsUpdateTdeOffboardingPasswordPutError>> {
1804    // add a prefix to parameters to efficiently prevent name collisions
1805    let p_update_tde_offboarding_password_request_model =
1806        update_tde_offboarding_password_request_model;
1807
1808    let uri_str = format!(
1809        "{}/accounts/update-tde-offboarding-password",
1810        configuration.base_path
1811    );
1812    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1813
1814    if let Some(ref user_agent) = configuration.user_agent {
1815        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1816    }
1817    if let Some(ref token) = configuration.oauth_access_token {
1818        req_builder = req_builder.bearer_auth(token.to_owned());
1819    };
1820    req_builder = req_builder.json(&p_update_tde_offboarding_password_request_model);
1821
1822    let req = req_builder.build()?;
1823    let resp = configuration.client.execute(req).await?;
1824
1825    let status = resp.status();
1826
1827    if !status.is_client_error() && !status.is_server_error() {
1828        Ok(())
1829    } else {
1830        let content = resp.text().await?;
1831        let entity: Option<AccountsUpdateTdeOffboardingPasswordPutError> =
1832            serde_json::from_str(&content).ok();
1833        Err(Error::ResponseError(ResponseContent {
1834            status,
1835            content,
1836            entity,
1837        }))
1838    }
1839}
1840
1841pub async fn accounts_update_temp_password_put(
1842    configuration: &configuration::Configuration,
1843    update_temp_password_request_model: Option<models::UpdateTempPasswordRequestModel>,
1844) -> Result<(), Error<AccountsUpdateTempPasswordPutError>> {
1845    // add a prefix to parameters to efficiently prevent name collisions
1846    let p_update_temp_password_request_model = update_temp_password_request_model;
1847
1848    let uri_str = format!("{}/accounts/update-temp-password", configuration.base_path);
1849    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1850
1851    if let Some(ref user_agent) = configuration.user_agent {
1852        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1853    }
1854    if let Some(ref token) = configuration.oauth_access_token {
1855        req_builder = req_builder.bearer_auth(token.to_owned());
1856    };
1857    req_builder = req_builder.json(&p_update_temp_password_request_model);
1858
1859    let req = req_builder.build()?;
1860    let resp = configuration.client.execute(req).await?;
1861
1862    let status = resp.status();
1863
1864    if !status.is_client_error() && !status.is_server_error() {
1865        Ok(())
1866    } else {
1867        let content = resp.text().await?;
1868        let entity: Option<AccountsUpdateTempPasswordPutError> =
1869            serde_json::from_str(&content).ok();
1870        Err(Error::ResponseError(ResponseContent {
1871            status,
1872            content,
1873            entity,
1874        }))
1875    }
1876}
1877
1878pub async fn accounts_verify_devices_post(
1879    configuration: &configuration::Configuration,
1880    set_verify_devices_request_model: Option<models::SetVerifyDevicesRequestModel>,
1881) -> Result<(), Error<AccountsVerifyDevicesPostError>> {
1882    // add a prefix to parameters to efficiently prevent name collisions
1883    let p_set_verify_devices_request_model = set_verify_devices_request_model;
1884
1885    let uri_str = format!("{}/accounts/verify-devices", configuration.base_path);
1886    let mut req_builder = configuration
1887        .client
1888        .request(reqwest::Method::POST, &uri_str);
1889
1890    if let Some(ref user_agent) = configuration.user_agent {
1891        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1892    }
1893    if let Some(ref token) = configuration.oauth_access_token {
1894        req_builder = req_builder.bearer_auth(token.to_owned());
1895    };
1896    req_builder = req_builder.json(&p_set_verify_devices_request_model);
1897
1898    let req = req_builder.build()?;
1899    let resp = configuration.client.execute(req).await?;
1900
1901    let status = resp.status();
1902
1903    if !status.is_client_error() && !status.is_server_error() {
1904        Ok(())
1905    } else {
1906        let content = resp.text().await?;
1907        let entity: Option<AccountsVerifyDevicesPostError> = serde_json::from_str(&content).ok();
1908        Err(Error::ResponseError(ResponseContent {
1909            status,
1910            content,
1911            entity,
1912        }))
1913    }
1914}
1915
1916pub async fn accounts_verify_devices_put(
1917    configuration: &configuration::Configuration,
1918    set_verify_devices_request_model: Option<models::SetVerifyDevicesRequestModel>,
1919) -> Result<(), Error<AccountsVerifyDevicesPutError>> {
1920    // add a prefix to parameters to efficiently prevent name collisions
1921    let p_set_verify_devices_request_model = set_verify_devices_request_model;
1922
1923    let uri_str = format!("{}/accounts/verify-devices", configuration.base_path);
1924    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1925
1926    if let Some(ref user_agent) = configuration.user_agent {
1927        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1928    }
1929    if let Some(ref token) = configuration.oauth_access_token {
1930        req_builder = req_builder.bearer_auth(token.to_owned());
1931    };
1932    req_builder = req_builder.json(&p_set_verify_devices_request_model);
1933
1934    let req = req_builder.build()?;
1935    let resp = configuration.client.execute(req).await?;
1936
1937    let status = resp.status();
1938
1939    if !status.is_client_error() && !status.is_server_error() {
1940        Ok(())
1941    } else {
1942        let content = resp.text().await?;
1943        let entity: Option<AccountsVerifyDevicesPutError> = serde_json::from_str(&content).ok();
1944        Err(Error::ResponseError(ResponseContent {
1945            status,
1946            content,
1947            entity,
1948        }))
1949    }
1950}
1951
1952pub async fn accounts_verify_email_post(
1953    configuration: &configuration::Configuration,
1954) -> Result<(), Error<AccountsVerifyEmailPostError>> {
1955    let uri_str = format!("{}/accounts/verify-email", configuration.base_path);
1956    let mut req_builder = configuration
1957        .client
1958        .request(reqwest::Method::POST, &uri_str);
1959
1960    if let Some(ref user_agent) = configuration.user_agent {
1961        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1962    }
1963    if let Some(ref token) = configuration.oauth_access_token {
1964        req_builder = req_builder.bearer_auth(token.to_owned());
1965    };
1966
1967    let req = req_builder.build()?;
1968    let resp = configuration.client.execute(req).await?;
1969
1970    let status = resp.status();
1971
1972    if !status.is_client_error() && !status.is_server_error() {
1973        Ok(())
1974    } else {
1975        let content = resp.text().await?;
1976        let entity: Option<AccountsVerifyEmailPostError> = serde_json::from_str(&content).ok();
1977        Err(Error::ResponseError(ResponseContent {
1978            status,
1979            content,
1980            entity,
1981        }))
1982    }
1983}
1984
1985pub async fn accounts_verify_email_token_post(
1986    configuration: &configuration::Configuration,
1987    verify_email_request_model: Option<models::VerifyEmailRequestModel>,
1988) -> Result<(), Error<AccountsVerifyEmailTokenPostError>> {
1989    // add a prefix to parameters to efficiently prevent name collisions
1990    let p_verify_email_request_model = verify_email_request_model;
1991
1992    let uri_str = format!("{}/accounts/verify-email-token", configuration.base_path);
1993    let mut req_builder = configuration
1994        .client
1995        .request(reqwest::Method::POST, &uri_str);
1996
1997    if let Some(ref user_agent) = configuration.user_agent {
1998        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1999    }
2000    if let Some(ref token) = configuration.oauth_access_token {
2001        req_builder = req_builder.bearer_auth(token.to_owned());
2002    };
2003    req_builder = req_builder.json(&p_verify_email_request_model);
2004
2005    let req = req_builder.build()?;
2006    let resp = configuration.client.execute(req).await?;
2007
2008    let status = resp.status();
2009
2010    if !status.is_client_error() && !status.is_server_error() {
2011        Ok(())
2012    } else {
2013        let content = resp.text().await?;
2014        let entity: Option<AccountsVerifyEmailTokenPostError> = serde_json::from_str(&content).ok();
2015        Err(Error::ResponseError(ResponseContent {
2016            status,
2017            content,
2018            entity,
2019        }))
2020    }
2021}
2022
2023pub async fn accounts_verify_otp_post(
2024    configuration: &configuration::Configuration,
2025    verify_otp_request_model: Option<models::VerifyOtpRequestModel>,
2026) -> Result<(), Error<AccountsVerifyOtpPostError>> {
2027    // add a prefix to parameters to efficiently prevent name collisions
2028    let p_verify_otp_request_model = verify_otp_request_model;
2029
2030    let uri_str = format!("{}/accounts/verify-otp", configuration.base_path);
2031    let mut req_builder = configuration
2032        .client
2033        .request(reqwest::Method::POST, &uri_str);
2034
2035    if let Some(ref user_agent) = configuration.user_agent {
2036        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2037    }
2038    if let Some(ref token) = configuration.oauth_access_token {
2039        req_builder = req_builder.bearer_auth(token.to_owned());
2040    };
2041    req_builder = req_builder.json(&p_verify_otp_request_model);
2042
2043    let req = req_builder.build()?;
2044    let resp = configuration.client.execute(req).await?;
2045
2046    let status = resp.status();
2047
2048    if !status.is_client_error() && !status.is_server_error() {
2049        Ok(())
2050    } else {
2051        let content = resp.text().await?;
2052        let entity: Option<AccountsVerifyOtpPostError> = serde_json::from_str(&content).ok();
2053        Err(Error::ResponseError(ResponseContent {
2054            status,
2055            content,
2056            entity,
2057        }))
2058    }
2059}
2060
2061pub async fn accounts_verify_password_post(
2062    configuration: &configuration::Configuration,
2063    secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
2064) -> Result<models::MasterPasswordPolicyResponseModel, Error<AccountsVerifyPasswordPostError>> {
2065    // add a prefix to parameters to efficiently prevent name collisions
2066    let p_secret_verification_request_model = secret_verification_request_model;
2067
2068    let uri_str = format!("{}/accounts/verify-password", configuration.base_path);
2069    let mut req_builder = configuration
2070        .client
2071        .request(reqwest::Method::POST, &uri_str);
2072
2073    if let Some(ref user_agent) = configuration.user_agent {
2074        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2075    }
2076    if let Some(ref token) = configuration.oauth_access_token {
2077        req_builder = req_builder.bearer_auth(token.to_owned());
2078    };
2079    req_builder = req_builder.json(&p_secret_verification_request_model);
2080
2081    let req = req_builder.build()?;
2082    let resp = configuration.client.execute(req).await?;
2083
2084    let status = resp.status();
2085    let content_type = resp
2086        .headers()
2087        .get("content-type")
2088        .and_then(|v| v.to_str().ok())
2089        .unwrap_or("application/octet-stream");
2090    let content_type = super::ContentType::from(content_type);
2091
2092    if !status.is_client_error() && !status.is_server_error() {
2093        let content = resp.text().await?;
2094        match content_type {
2095            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2096            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MasterPasswordPolicyResponseModel`"))),
2097            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::MasterPasswordPolicyResponseModel`")))),
2098        }
2099    } else {
2100        let content = resp.text().await?;
2101        let entity: Option<AccountsVerifyPasswordPostError> = serde_json::from_str(&content).ok();
2102        Err(Error::ResponseError(ResponseContent {
2103            status,
2104            content,
2105            entity,
2106        }))
2107    }
2108}