Skip to main content

bitwarden_api_api/models/
organization_user_pending_v2_upgrade_response_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/// OrganizationUserPendingV2UpgradeResponseModel : A membership whose account recovery key still
16/// wraps the member's V1 user key.
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct OrganizationUserPendingV2UpgradeResponseModel {
19    #[serde(
20        rename = "object",
21        alias = "Object",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub object: Option<String>,
25    #[serde(rename = "organizationUserId", alias = "OrganizationUserId")]
26    pub organization_user_id: uuid::Uuid,
27    /// The key id of the member's current user key. Return it unchanged with the re-wrapped key.
28    #[serde(rename = "userKeyId", alias = "UserKeyId")]
29    pub user_key_id: String,
30    /// The member's V1 user key wrapped with the organization's public key.
31    #[serde(rename = "accountRecoveryKey", alias = "AccountRecoveryKey")]
32    pub account_recovery_key: String,
33    #[serde(
34        rename = "v2UpgradeToken",
35        alias = "V2UpgradeToken",
36        skip_serializing_if = "Option::is_none"
37    )]
38    pub v2_upgrade_token: Option<Box<models::V2UpgradeTokenResponseModel>>,
39}
40
41impl OrganizationUserPendingV2UpgradeResponseModel {
42    /// A membership whose account recovery key still wraps the member's V1 user key.
43    pub fn new(
44        organization_user_id: uuid::Uuid,
45        user_key_id: String,
46        account_recovery_key: String,
47    ) -> OrganizationUserPendingV2UpgradeResponseModel {
48        OrganizationUserPendingV2UpgradeResponseModel {
49            object: None,
50            organization_user_id,
51            user_key_id,
52            account_recovery_key,
53            v2_upgrade_token: None,
54        }
55    }
56}