bitwarden_api_api/models/
web_authn_login_credential_create_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 WebAuthnLoginCredentialCreateRequestModel {
17    #[serde(rename = "deviceResponse", alias = "DeviceResponse")]
18    pub device_response: Box<models::AuthenticatorAttestationRawResponse>,
19    #[serde(rename = "name", alias = "Name")]
20    pub name: String,
21    #[serde(rename = "token", alias = "Token")]
22    pub token: String,
23    #[serde(rename = "supportsPrf", alias = "SupportsPrf")]
24    pub supports_prf: bool,
25    #[serde(
26        rename = "encryptedUserKey",
27        alias = "EncryptedUserKey",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub encrypted_user_key: Option<String>,
31    #[serde(
32        rename = "encryptedPublicKey",
33        alias = "EncryptedPublicKey",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub encrypted_public_key: Option<String>,
37    #[serde(
38        rename = "encryptedPrivateKey",
39        alias = "EncryptedPrivateKey",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub encrypted_private_key: Option<String>,
43}
44
45impl WebAuthnLoginCredentialCreateRequestModel {
46    pub fn new(
47        device_response: models::AuthenticatorAttestationRawResponse,
48        name: String,
49        token: String,
50        supports_prf: bool,
51    ) -> WebAuthnLoginCredentialCreateRequestModel {
52        WebAuthnLoginCredentialCreateRequestModel {
53            device_response: Box::new(device_response),
54            name,
55            token,
56            supports_prf,
57            encrypted_user_key: None,
58            encrypted_public_key: None,
59            encrypted_private_key: None,
60        }
61    }
62}