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