Skip to main content

bitwarden_api_api/models/
organization_user.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/// OrganizationUser : An association table between one Bit.Core.Entities.User and one
16/// Bit.Core.AdminConsole.Entities.Organization, representing that user's membership in the
17/// organization. \"Member\" refers to the OrganizationUser object.
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct OrganizationUser {
20    /// A unique random identifier.
21    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<uuid::Uuid>,
23    /// The ID of the Organization that the user is a member of.
24    #[serde(
25        rename = "organizationId",
26        alias = "OrganizationId",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub organization_id: Option<uuid::Uuid>,
30    /// The ID of the User that is the member. This is NULL if the Status is Invited (or Invited
31    /// and then Revoked), because it is not linked to a specific User yet.
32    #[serde(
33        rename = "userId",
34        alias = "UserId",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub user_id: Option<uuid::Uuid>,
38    /// The email address of the user invited to the organization. This is NULL if the Status is
39    /// not Invited (or Invited and then Revoked), because in that case the OrganizationUser is
40    /// linked to a User and the email is stored on the User object.
41    #[serde(
42        rename = "email",
43        alias = "Email",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub email: Option<String>,
47    /// The Organization symmetric key encrypted with the User's public key. NULL if the user is
48    /// not in a Confirmed (or Confirmed and then Revoked) status.
49    #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
50    pub key: Option<String>,
51    /// The User's symmetric key encrypted with the Organization's public key. NULL if the
52    /// OrganizationUser is not enrolled in account recovery.
53    #[serde(
54        rename = "resetPasswordKey",
55        alias = "ResetPasswordKey",
56        skip_serializing_if = "Option::is_none"
57    )]
58    pub reset_password_key: Option<String>,
59    /// The V2 user key wrapped with the V1 user key, as JSON. Set during a V1 to V2 upgrade
60    /// rotation. An Organization admin reaches the V1 user key through account recovery, so the
61    /// admin can unwrap the V2 user key from this token and update
62    /// Bit.Core.Entities.OrganizationUser.ResetPasswordKey to it. NULL at all other times.
63    #[serde(
64        rename = "v2UpgradeToken",
65        alias = "V2UpgradeToken",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub v2_upgrade_token: Option<String>,
69    #[serde(
70        rename = "status",
71        alias = "Status",
72        skip_serializing_if = "Option::is_none"
73    )]
74    pub status: Option<models::OrganizationUserStatusType>,
75    #[serde(
76        rename = "statusNew",
77        alias = "StatusNew",
78        skip_serializing_if = "Option::is_none"
79    )]
80    pub status_new: Option<models::OrganizationUserStatusTypeNew>,
81    #[serde(
82        rename = "type",
83        alias = "R#type",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub r#type: Option<models::OrganizationUserType>,
87    /// An ID used to identify the OrganizationUser with an external directory service. Used by
88    /// Directory Connector and SCIM.
89    #[serde(
90        rename = "externalId",
91        alias = "ExternalId",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub external_id: Option<String>,
95    /// The date the OrganizationUser was created, i.e. when the User was first invited to the
96    /// Organization.
97    #[serde(
98        rename = "creationDate",
99        alias = "CreationDate",
100        skip_serializing_if = "Option::is_none"
101    )]
102    pub creation_date: Option<String>,
103    /// The last date the OrganizationUser entry was updated.
104    #[serde(
105        rename = "revisionDate",
106        alias = "RevisionDate",
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub revision_date: Option<String>,
110    /// A json blob representing the Bit.Core.Models.Data.Permissions of the OrganizationUser if
111    /// they are a Custom user role (i.e. the Bit.Core.Enums.OrganizationUserType is Custom). MAY
112    /// be NULL if they are not a custom user, but this is not guaranteed; do not use this to
113    /// determine their role.
114    #[serde(
115        rename = "permissions",
116        alias = "Permissions",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub permissions: Option<String>,
120    /// True if the User has access to Secrets Manager for this Organization, false otherwise.
121    #[serde(
122        rename = "accessSecretsManager",
123        alias = "AccessSecretsManager",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub access_secrets_manager: Option<bool>,
127    /// True if the User has access to Privileged Access Management for this Organization, false
128    /// otherwise.
129    #[serde(
130        rename = "accessPam",
131        alias = "AccessPam",
132        skip_serializing_if = "Option::is_none"
133    )]
134    pub access_pam: Option<bool>,
135    #[serde(
136        rename = "revocationReason",
137        alias = "RevocationReason",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub revocation_reason: Option<models::RevocationReason>,
141}
142
143impl OrganizationUser {
144    /// An association table between one Bit.Core.Entities.User and one
145    /// Bit.Core.AdminConsole.Entities.Organization, representing that user's membership in the
146    /// organization. \"Member\" refers to the OrganizationUser object.
147    pub fn new() -> OrganizationUser {
148        OrganizationUser {
149            id: None,
150            organization_id: None,
151            user_id: None,
152            email: None,
153            key: None,
154            reset_password_key: None,
155            v2_upgrade_token: None,
156            status: None,
157            status_new: None,
158            r#type: None,
159            external_id: None,
160            creation_date: None,
161            revision_date: None,
162            permissions: None,
163            access_secrets_manager: None,
164            access_pam: None,
165            revocation_reason: None,
166        }
167    }
168}