Skip to main content

bitwarden_api_api/models/
rotate_user_account_keys_and_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RotateUserAccountKeysAndDataRequestModel {
17    #[serde(
18        rename = "oldMasterKeyAuthenticationHash",
19        alias = "OldMasterKeyAuthenticationHash"
20    )]
21    pub old_master_key_authentication_hash: Option<String>,
22    #[serde(rename = "accountUnlockData", alias = "AccountUnlockData")]
23    pub account_unlock_data: Box<models::UnlockDataRequestModel>,
24    #[serde(rename = "accountKeys", alias = "AccountKeys")]
25    pub account_keys: Box<models::AccountKeysRequestModel>,
26    #[serde(rename = "accountData", alias = "AccountData")]
27    pub account_data: Box<models::AccountDataRequestModel>,
28    #[serde(
29        rename = "newUserKeyId",
30        alias = "NewUserKeyId",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub new_user_key_id: Option<String>,
34}
35
36impl RotateUserAccountKeysAndDataRequestModel {
37    pub fn new(
38        old_master_key_authentication_hash: Option<String>,
39        account_unlock_data: models::UnlockDataRequestModel,
40        account_keys: models::AccountKeysRequestModel,
41        account_data: models::AccountDataRequestModel,
42    ) -> RotateUserAccountKeysAndDataRequestModel {
43        RotateUserAccountKeysAndDataRequestModel {
44            old_master_key_authentication_hash,
45            account_unlock_data: Box::new(account_unlock_data),
46            account_keys: Box::new(account_keys),
47            account_data: Box::new(account_data),
48            new_user_key_id: None,
49        }
50    }
51}