Skip to main content

bitwarden_api_api/models/
master_password_unlock_data_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/// MasterPasswordUnlockDataRequestModel : Use this datatype when interfacing with requests to
16/// create a separation of concern. See Bit.Core.KeyManagement.Models.Data.MasterPasswordUnlockData
17/// to use for commands, queries, services.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct MasterPasswordUnlockDataRequestModel {
20    #[serde(rename = "kdf", alias = "Kdf")]
21    pub kdf: Box<models::KdfRequestModel>,
22    #[serde(rename = "masterKeyWrappedUserKey", alias = "MasterKeyWrappedUserKey")]
23    pub master_key_wrapped_user_key: String,
24    #[serde(rename = "salt", alias = "Salt")]
25    pub salt: String,
26    #[serde(
27        rename = "containedKeyId",
28        alias = "ContainedKeyId",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub contained_key_id: Option<String>,
32}
33
34impl MasterPasswordUnlockDataRequestModel {
35    /// Use this datatype when interfacing with requests to create a separation of concern. See
36    /// Bit.Core.KeyManagement.Models.Data.MasterPasswordUnlockData to use for commands, queries,
37    /// services.
38    pub fn new(
39        kdf: models::KdfRequestModel,
40        master_key_wrapped_user_key: String,
41        salt: String,
42    ) -> MasterPasswordUnlockDataRequestModel {
43        MasterPasswordUnlockDataRequestModel {
44            kdf: Box::new(kdf),
45            master_key_wrapped_user_key,
46            salt,
47            contained_key_id: None,
48        }
49    }
50}