bitwarden-api-api 3.0.0

Api bindings for the Bitwarden API.
Documentation
/*
 * Bitwarden Internal API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: latest
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::{Deserialize, Serialize};

use crate::models;

/// OrganizationUser : An association table between one Bit.Core.Entities.User and one
/// Bit.Core.AdminConsole.Entities.Organization, representing that user's membership in the
/// organization. \"Member\" refers to the OrganizationUser object.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrganizationUser {
    /// A unique random identifier.
    #[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
    pub id: Option<uuid::Uuid>,
    /// The ID of the Organization that the user is a member of.
    #[serde(
        rename = "organizationId",
        alias = "OrganizationId",
        skip_serializing_if = "Option::is_none"
    )]
    pub organization_id: Option<uuid::Uuid>,
    /// The ID of the User that is the member. This is NULL if the Status is Invited (or Invited
    /// and then Revoked), because it is not linked to a specific User yet.
    #[serde(
        rename = "userId",
        alias = "UserId",
        skip_serializing_if = "Option::is_none"
    )]
    pub user_id: Option<uuid::Uuid>,
    /// The email address of the user invited to the organization. This is NULL if the Status is
    /// not Invited (or Invited and then Revoked), because in that case the OrganizationUser is
    /// linked to a User and the email is stored on the User object.
    #[serde(
        rename = "email",
        alias = "Email",
        skip_serializing_if = "Option::is_none"
    )]
    pub email: Option<String>,
    /// The Organization symmetric key encrypted with the User's public key. NULL if the user is
    /// not in a Confirmed (or Confirmed and then Revoked) status.
    #[serde(rename = "key", alias = "Key", skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// The User's symmetric key encrypted with the Organization's public key. NULL if the
    /// OrganizationUser is not enrolled in account recovery.
    #[serde(
        rename = "resetPasswordKey",
        alias = "ResetPasswordKey",
        skip_serializing_if = "Option::is_none"
    )]
    pub reset_password_key: Option<String>,
    #[serde(
        rename = "status",
        alias = "Status",
        skip_serializing_if = "Option::is_none"
    )]
    pub status: Option<models::OrganizationUserStatusType>,
    #[serde(
        rename = "type",
        alias = "R#type",
        skip_serializing_if = "Option::is_none"
    )]
    pub r#type: Option<models::OrganizationUserType>,
    /// An ID used to identify the OrganizationUser with an external directory service. Used by
    /// Directory Connector and SCIM.
    #[serde(
        rename = "externalId",
        alias = "ExternalId",
        skip_serializing_if = "Option::is_none"
    )]
    pub external_id: Option<String>,
    /// The date the OrganizationUser was created, i.e. when the User was first invited to the
    /// Organization.
    #[serde(
        rename = "creationDate",
        alias = "CreationDate",
        skip_serializing_if = "Option::is_none"
    )]
    pub creation_date: Option<String>,
    /// The last date the OrganizationUser entry was updated.
    #[serde(
        rename = "revisionDate",
        alias = "RevisionDate",
        skip_serializing_if = "Option::is_none"
    )]
    pub revision_date: Option<String>,
    /// A json blob representing the Bit.Core.Models.Data.Permissions of the OrganizationUser if
    /// they are a Custom user role (i.e. the Bit.Core.Enums.OrganizationUserType is Custom). MAY
    /// be NULL if they are not a custom user, but this is not guaranteed; do not use this to
    /// determine their role.
    #[serde(
        rename = "permissions",
        alias = "Permissions",
        skip_serializing_if = "Option::is_none"
    )]
    pub permissions: Option<String>,
    /// True if the User has access to Secrets Manager for this Organization, false otherwise.
    #[serde(
        rename = "accessSecretsManager",
        alias = "AccessSecretsManager",
        skip_serializing_if = "Option::is_none"
    )]
    pub access_secrets_manager: Option<bool>,
    #[serde(
        rename = "revocationReason",
        alias = "RevocationReason",
        skip_serializing_if = "Option::is_none"
    )]
    pub revocation_reason: Option<models::RevocationReason>,
}

impl OrganizationUser {
    /// An association table between one Bit.Core.Entities.User and one
    /// Bit.Core.AdminConsole.Entities.Organization, representing that user's membership in the
    /// organization. \"Member\" refers to the OrganizationUser object.
    pub fn new() -> OrganizationUser {
        OrganizationUser {
            id: None,
            organization_id: None,
            user_id: None,
            email: None,
            key: None,
            reset_password_key: None,
            status: None,
            r#type: None,
            external_id: None,
            creation_date: None,
            revision_date: None,
            permissions: None,
            access_secrets_manager: None,
            revocation_reason: None,
        }
    }
}