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")]
18    pub device_response: Box<models::AuthenticatorAttestationRawResponse>,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "token")]
22    pub token: String,
23    #[serde(rename = "supportsPrf")]
24    pub supports_prf: bool,
25    #[serde(rename = "encryptedUserKey", skip_serializing_if = "Option::is_none")]
26    pub encrypted_user_key: Option<String>,
27    #[serde(rename = "encryptedPublicKey", skip_serializing_if = "Option::is_none")]
28    pub encrypted_public_key: Option<String>,
29    #[serde(
30        rename = "encryptedPrivateKey",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub encrypted_private_key: Option<String>,
34}
35
36impl WebAuthnLoginCredentialCreateRequestModel {
37    pub fn new(
38        device_response: models::AuthenticatorAttestationRawResponse,
39        name: String,
40        token: String,
41        supports_prf: bool,
42    ) -> WebAuthnLoginCredentialCreateRequestModel {
43        WebAuthnLoginCredentialCreateRequestModel {
44            device_response: Box::new(device_response),
45            name,
46            token,
47            supports_prf,
48            encrypted_user_key: None,
49            encrypted_public_key: None,
50            encrypted_private_key: None,
51        }
52    }
53}