Skip to main content

bitwarden_api_api/models/
rotate_user_keys_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 RotateUserKeysRequestModel {
17    #[serde(
18        rename = "wrappedAccountCryptographicState",
19        alias = "WrappedAccountCryptographicState"
20    )]
21    pub wrapped_account_cryptographic_state:
22        Box<models::WrappedAccountCryptographicStateRequestModel>,
23    #[serde(rename = "unlockData", alias = "UnlockData")]
24    pub unlock_data: Box<models::CommonUnlockDataRequestModel>,
25    #[serde(rename = "accountData", alias = "AccountData")]
26    pub account_data: Box<models::AccountDataRequestModel>,
27    #[serde(rename = "unlockMethodData", alias = "UnlockMethodData")]
28    pub unlock_method_data: Box<models::UnlockMethodRequestModel>,
29    #[serde(
30        rename = "newUserKeyId",
31        alias = "NewUserKeyId",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub new_user_key_id: Option<String>,
35}
36
37impl RotateUserKeysRequestModel {
38    pub fn new(
39        wrapped_account_cryptographic_state: models::WrappedAccountCryptographicStateRequestModel,
40        unlock_data: models::CommonUnlockDataRequestModel,
41        account_data: models::AccountDataRequestModel,
42        unlock_method_data: models::UnlockMethodRequestModel,
43    ) -> RotateUserKeysRequestModel {
44        RotateUserKeysRequestModel {
45            wrapped_account_cryptographic_state: Box::new(wrapped_account_cryptographic_state),
46            unlock_data: Box::new(unlock_data),
47            account_data: Box::new(account_data),
48            unlock_method_data: Box::new(unlock_method_data),
49            new_user_key_id: None,
50        }
51    }
52}