Skip to main content

bitwarden_api_api/models/
two_factor_email_setup_request_model.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// TwoFactorEmailSetupRequestModel : Request body for the authenticated setup endpoint that sends a
16/// verification OTP to the user's chosen 2FA email address. Authenticated by a user-verification
17/// token minted earlier in the setup flow.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct TwoFactorEmailSetupRequestModel {
20    #[serde(rename = "email", alias = "Email")]
21    pub email: String,
22    /// User-verification token bound to `UserId + ProviderType`. Minted by the matching GET
23    /// endpoint and replayed on subsequent management calls so the user does not have to
24    /// re-verify.
25    #[serde(rename = "userVerificationToken", alias = "UserVerificationToken")]
26    pub user_verification_token: String,
27}
28
29impl TwoFactorEmailSetupRequestModel {
30    /// Request body for the authenticated setup endpoint that sends a verification OTP to the
31    /// user's chosen 2FA email address. Authenticated by a user-verification token minted earlier
32    /// in the setup flow.
33    pub fn new(email: String, user_verification_token: String) -> TwoFactorEmailSetupRequestModel {
34        TwoFactorEmailSetupRequestModel {
35            email,
36            user_verification_token,
37        }
38    }
39}