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