Skip to main content

bitwarden_api_api/models/
organization_user_account_recovery_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/// OrganizationUserAccountRecoveryRequestModel : An organization membership's account recovery key,
16/// submitted during key rotation.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct OrganizationUserAccountRecoveryRequestModel {
19    #[serde(rename = "organizationId", alias = "OrganizationId")]
20    pub organization_id: uuid::Uuid,
21    /// The user key encapsulated by the organization's public key. NULL during a V1 to V2 upgrade
22    /// rotation, where an admin re-encapsulates it later from the upgrade token.
23    #[serde(
24        rename = "resetPasswordKey",
25        alias = "ResetPasswordKey",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub reset_password_key: Option<String>,
29}
30
31impl OrganizationUserAccountRecoveryRequestModel {
32    /// An organization membership's account recovery key, submitted during key rotation.
33    pub fn new(organization_id: uuid::Uuid) -> OrganizationUserAccountRecoveryRequestModel {
34        OrganizationUserAccountRecoveryRequestModel {
35            organization_id,
36            reset_password_key: None,
37        }
38    }
39}