Skip to main content

bitwarden_api_api/models/
two_factor_web_authn_update_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TwoFactorWebAuthnUpdateRequestModel {
17    #[serde(rename = "id", alias = "Id")]
18    pub id: i32,
19    /// User-verification token bound to `UserId + ProviderType`. Minted by the matching GET
20    /// endpoint and replayed on subsequent management calls so the user does not have to
21    /// re-verify.
22    #[serde(rename = "userVerificationToken", alias = "UserVerificationToken")]
23    pub user_verification_token: String,
24    #[serde(rename = "deviceResponse", alias = "DeviceResponse")]
25    pub device_response: Box<models::AuthenticatorAttestationRawResponse>,
26    #[serde(
27        rename = "name",
28        alias = "Name",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub name: Option<String>,
32}
33
34impl TwoFactorWebAuthnUpdateRequestModel {
35    pub fn new(
36        id: i32,
37        user_verification_token: String,
38        device_response: models::AuthenticatorAttestationRawResponse,
39    ) -> TwoFactorWebAuthnUpdateRequestModel {
40        TwoFactorWebAuthnUpdateRequestModel {
41            id,
42            user_verification_token,
43            device_response: Box::new(device_response),
44            name: None,
45        }
46    }
47}