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