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    #[serde(
60        rename = "status",
61        alias = "Status",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub status: Option<models::OrganizationUserStatusType>,
65    #[serde(
66        rename = "statusNew",
67        alias = "StatusNew",
68        skip_serializing_if = "Option::is_none"
69    )]
70    pub status_new: Option<models::OrganizationUserStatusTypeNew>,
71    #[serde(
72        rename = "type",
73        alias = "R#type",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub r#type: Option<models::OrganizationUserType>,
77    /// An ID used to identify the OrganizationUser with an external directory service. Used by
78    /// Directory Connector and SCIM.
79    #[serde(
80        rename = "externalId",
81        alias = "ExternalId",
82        skip_serializing_if = "Option::is_none"
83    )]
84    pub external_id: Option<String>,
85    /// The date the OrganizationUser was created, i.e. when the User was first invited to the
86    /// Organization.
87    #[serde(
88        rename = "creationDate",
89        alias = "CreationDate",
90        skip_serializing_if = "Option::is_none"
91    )]
92    pub creation_date: Option<String>,
93    /// The last date the OrganizationUser entry was updated.
94    #[serde(
95        rename = "revisionDate",
96        alias = "RevisionDate",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub revision_date: Option<String>,
100    /// A json blob representing the Bit.Core.Models.Data.Permissions of the OrganizationUser if
101    /// they are a Custom user role (i.e. the Bit.Core.Enums.OrganizationUserType is Custom). MAY
102    /// be NULL if they are not a custom user, but this is not guaranteed; do not use this to
103    /// determine their role.
104    #[serde(
105        rename = "permissions",
106        alias = "Permissions",
107        skip_serializing_if = "Option::is_none"
108    )]
109    pub permissions: Option<String>,
110    /// True if the User has access to Secrets Manager for this Organization, false otherwise.
111    #[serde(
112        rename = "accessSecretsManager",
113        alias = "AccessSecretsManager",
114        skip_serializing_if = "Option::is_none"
115    )]
116    pub access_secrets_manager: Option<bool>,
117    #[serde(
118        rename = "revocationReason",
119        alias = "RevocationReason",
120        skip_serializing_if = "Option::is_none"
121    )]
122    pub revocation_reason: Option<models::RevocationReason>,
123}
124
125impl OrganizationUser {
126    /// An association table between one Bit.Core.Entities.User and one
127    /// Bit.Core.AdminConsole.Entities.Organization, representing that user's membership in the
128    /// organization. \"Member\" refers to the OrganizationUser object.
129    pub fn new() -> OrganizationUser {
130        OrganizationUser {
131            id: None,
132            organization_id: None,
133            user_id: None,
134            email: None,
135            key: None,
136            reset_password_key: None,
137            status: None,
138            status_new: None,
139            r#type: None,
140            external_id: None,
141            creation_date: None,
142            revision_date: None,
143            permissions: None,
144            access_secrets_manager: None,
145            revocation_reason: None,
146        }
147    }
148}