bpx_api_client/routes/
user.rs1use bpx_api_types::user::{RequestTwoFactorPayload, RequestTwoFactorResponse};
2
3use crate::{BpxClient, error::Result};
4
5#[doc(hidden)]
6pub const API_USER_2FA: &str = "/wapi/v1/user/2fa";
7
8impl BpxClient {
9 pub async fn request_two_factor(
14 &self,
15 payload: RequestTwoFactorPayload,
16 ) -> Result<RequestTwoFactorResponse> {
17 let endpoint = self.base_url.join(API_USER_2FA)?;
18 let res = self.post(endpoint, payload).await?;
19
20 let data: RequestTwoFactorResponse = res.json().await?;
21 Ok(data)
22 }
23}