User
====

.. _EPInfoEntry:
   
EPInfoEntry
-----------

Defines one entry for an enterprise account

.. code-block:: json

 message EpInfoEntry {
  string title = 1;
  string id = 2;
  bool is_admin = 3;
  bool is_user_admin = 4;
  bool admin_has_limited_rights = 5;
  optional AutoLogOff auto_logoff = 6;
  optional bool admin_can_access_contract_data = 7;
  optional bool is_external = 8;
 }

+------------------------------------+----------------+--------------------------------------------------+
| Field                              | Type           | Description                                      |
+====================================+================+==================================================+
| ``title``                          | ``string``     |                                                  |
+------------------------------------+----------------+--------------------------------------------------+
| ``id``                             | ``string``     |                                                  |
+------------------------------------+----------------+--------------------------------------------------+
| ``is_admin``                       | ``bool``       |                                                  |
+------------------------------------+----------------+--------------------------------------------------+
| ``is_user_admin``                  | ``bool``       |                                                  |
+------------------------------------+----------------+--------------------------------------------------+
| ``admin_has_limited_rights``       | ``bool``       |                                                  |
+------------------------------------+----------------+--------------------------------------------------+
| ``auto_logoff``                    | ``AutoLogOff`` | **Optional.** See :ref:`AutoLogOff <AutoLogOff>` |
+------------------------------------+----------------+--------------------------------------------------+
| ``admin_can_access_contract_data`` | ``bool``       | **Optional.**                                    |
+------------------------------------+----------------+--------------------------------------------------+
| ``is_external``                    | ``bool``       | **Optional.**                                    |
+------------------------------------+----------------+--------------------------------------------------+

.. _EpInfo:

EpInfo
------

Infos about enterprise accounts of user

.. code-block:: json

 message EpInfo {
  repeated EpInfoEntry entries = 1;
 }

+-------------+--------------------------+--------------------------------------+
| Field       | Type                     | Description                          |
+=============+==========================+======================================+
| ``entries`` | array of ``EpInfoEntry`` | See :ref:`EpInfoEntry <EpInfoEntry>` |
+-------------+--------------------------+--------------------------------------+

.. _NFSendAccountInfo:

NFSendAccountInfo
-----------------

Holds necessary information for one single invitation of the nf send product

.. code-block:: json
     
 message NFSendAccountInfo {
  bool is_admin = 1;
  string invited_by = 2;
  string contract_id = 3;
 }

+-----------------+------------+-------------+
| Field           | Type       | Description |
+=================+============+=============+
| ``is_admin``    | ``bool``   |             |
+-----------------+------------+-------------+
| ``invited_by``  | ``string`` |             |
+-----------------+------------+-------------+
| ``contract_id`` | ``string`` |             |
+-----------------+------------+-------------+

.. _NFSendInvitationInfo:

NFSendInvitationInfo
--------------------

Holds necessary information for nf send product

.. code-block:: json

 message NFSendInvitationInfo {
  repeated NFSendAccountInfo accounts = 1;
  string nfsend_id = 4;
 }

+---------------+-----------------------+--------------------------------------------------+
| Field         | Type                  | Description                                      |
+===============+=======================+==================================================+
| ``accounts``  | ``NFSendAccountInfo`` | See :ref:`NFSendAccountInfo <NFSendAccountInfo>` |
+---------------+-----------------------+--------------------------------------------------+
| ``nfsend_id`` | ``string``            |                                                  |
+---------------+-----------------------+--------------------------------------------------+

.. _NFSendInfo:

NFSendInfo
----------

Holds necessary information for nf send product

.. code-block:: json
 
 message NFSendInfo {
  bool is_admin = 1;
  optional bool can_be_set_as_admin = 2;
 }

+-------------------------+----------+---------------+
| Field                   | Type     | Description   |
+=========================+==========+===============+
| ``is_admin``            | ``bool`` |               |
+-------------------------+----------+---------------+
| ``can_be_set_as_admin`` | ``bool`` | **Optional.** |
+-------------------------+----------+---------------+

.. _User:

User
----

A single user.

- ``is_user_unconfirmed`` indicates whether the user hasn't yet confirmed the invitation to the data room.
  
  Note: in an E2EE DR, if this is set to FALSE, please also check ``is_pending_admin_confirmation`` before allowing the user into the DR. Only if that other one is set to FALSE can you allow the user to enter the DR, otherwise the user won't have a data room key, so they can't read/upload any file/comment/annotation.

- ``is_pending_admin_confirmation`` is only set in E2EE data rooms when the user didn't have a keypair during the invitation process. Then, the user accepts by sending ``ACCEPT_PENDING_ADMIN_CONFIRMATION`` and then their status ``is_pending_admin_confirmation`` is set to true.
  
  NOTE: in an E2EE DR, if this one is set to TRUE, then the flag ``is_user_unconfirmed`` is set to false.

.. code-block:: json

 message User {
  string id = 1;
  string name = 2;
  optional string type = 3;

  optional string path = 4;

  optional string first_name = 5;
  optional string last_name = 6;
  optional string real_name = 7;
  string title = 8;
  optional string email = 9;
  optional string href = 10;
  optional uint32 logins = 11;
  optional google.protobuf.Timestamp last_login = 12;
  optional Language language = 13;
  optional Locale locale = 14;
  optional string timezone = 15;
  optional Salutation salutation = 16;
  optional bool is_user_inactive = 17;

  // Indicates whether the user hasn't yet confirmed the invitation
  // to the data room.
  // Note: in an E2EE DR, if this is set to FALSE, please also check
  // `is_pending_admin_confirmation` before allowing the user into the
  // DR. Only if that other one is set to FALSE can you allow the user
  // to enter the DR, otherwise the user won't have a data room key, so
  // they can't read/upload any file/comment/annotation.
  optional bool is_user_unconfirmed = 18;

  // What about this one?
  optional bool is_user_invited = 19;
  optional string phone_nr = 20;
  optional string mobile_phone_nr = 21;
  ItemType item_type = 30;
  optional EffectivePermission effective_permission = 31;
  // dataroom dependent
  optional google.protobuf.Timestamp restrict_access_from = 32;
  // dataroom dependent
  optional google.protobuf.Timestamp restrict_access_to = 33;
  optional DefaultVisibilityOption visibility = 34; // dataroom dependent
  optional string mountpoint = 35; // dataroom dependent
  optional string company = 36;
  optional string user_title = 37;
  optional string pkey = 38;
  optional string pubkey = 39;
  optional string pkey_backup = 40;

  // This is only set in E2EE data rooms when the user didn't have a
  // keypair during the invitation process. Then, the user accepts
  // by sending ...ACCEPT_PENDING_ADMIN_CONFIRMATION and then their status
  // `is_pending_admin_confirmation` is set to true.
  // NOTE: in an E2EE DR, if this one is set to TRUE, then
  // the flag `is_user_unconfirmed` is set to false.
  optional bool is_pending_admin_confirmation = 41;

  // Enterprise
  optional EpInfo enterprise_info = 42;
  optional DrInfo dataroom_info = 44;
  optional EpEmailVerificationInfo email_verification_info = 45;
  optional bool single_sign_on_enabled = 46;
  optional string single_sign_on_id = 51;
  optional bool single_sign_on_verification_required = 52;

  // OTHERS
  optional DisclaimerState disclaimer_state = 47; // dataroom dependent
  optional NFSendInvitationInfo nf_send_data = 48;
  optional NFSendInfo nf_send_info = 49;
  optional bool is_user_invitation_expired = 50;
  optional bool is_qa_admin = 60;
  optional bool is_qa_gatekeeper = 61;
 }

+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Field                                    | Type                          | Description                                                                                                          |
+==========================================+===============================+======================================================================================================================+
| ``id``                                   | ``string``                    |                                                                                                                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``name``                                 | ``string``                    |                                                                                                                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``type``                                 | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``path``                                 | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``first_name``                           | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``last_name``                            | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``real_name``                            | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``title``                                | ``string``                    |                                                                                                                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``email``                                | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``href``                                 | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``logins``                               | ``uint32``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``last_login``                           | ``google.protobuf.Timestamp`` | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``language``                             | ``Language``                  | **Optional.** See :ref:`Language <Language>`                                                                         |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``locale``                               | ``Locale``                    | **Optional.** See :ref:`Locale <Locale>`                                                                             |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``timezone``                             | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``salutation``                           | ``Salutation``                | **Optional.** See :ref:`Salutation <Salutation>`                                                                     |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_user_inactive``                     | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_user_unconfirmed``                  | ``bool``                      | **Optional.** Indicates whether the user hasn't yet confirmed the invitation to the data room.                       |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_user_invited``                      | ``bool``                      | **Optional.** ??                                                                                                     |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``phone_nr``                             | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``mobile_phone_nr``                      | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``item_type``                            | ``ItemType``                  | See :ref:`ItemType <ItemType>`                                                                                       |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``effective_permission``                 | ``EffectivePermission``       | **Optional.** See :ref:`EffectivePermission <EffectivePermission>`                                                   |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``restrict_access_from``                 | ``google.protobuf.Timestamp`` | **Optional.** Dataroom dependent.                                                                                    |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``restrict_access_to``                   | ``google.protobuf.Timestamp`` | **Optional.** Dataroom dependent.                                                                                    |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``visibility``                           | ``DefaultVisibilityOption``   | **Optional.** See :ref:`DefaultVisibilityOption <DefaultVisibilityOption>`. Dataroom dependent.                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``mountpoint``                           | ``string``                    | **Optional.** Dataroom dependent.                                                                                    |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``company``                              | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``user_title``                           | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``pkey``                                 | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``pubkey``                               | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``pkey_backup``                          | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_pending_admin_confirmation``        | ``bool``                      | **Optional.** This is only set in E2EE data rooms when the user didn't have a keypair during the invitation process. |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| **Enterprise**                                                                                                                                                                                  |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``enterprise_info``                      | ``EpInfo``                    | **Optional.** See :ref:`EpInfo <EpInfo>`                                                                             |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``dataroom_info``                        | ``DrInfo``                    | **Optional.** See :ref:`DrInfo <DrInfo>`                                                                             |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``email_verification_info``              | ``EpEmailVerificationInfo``   | **Optional.** See :ref:`EpEmailVerificationInfo <EpEmailVerificationInfo>`                                           |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``single_sign_on_enabled``               | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``single_sign_on_id``                    | ``string``                    | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``single_sign_on_verification_required`` | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| **Others**                                                                                                                                                                                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``disclaimer_state``                     | ``DisclaimerState``           | **Optional.** See :ref:`DisclaimerState <DisclaimerState>`. Dataroom dependent.                                      |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``nf_send_data``                         | ``NFSendInvitationInfo``      | **Optional.** See :ref:`NFSendInvitationInfo <NFSendInvitationInfo>`                                                 |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``nf_send_info``                         | ``NFSendInfo``                | **Optional.** See :ref:`NFSendInfo <NFSendInfo>`                                                                     |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_user_invitation_expired``           | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_qa_admin``                          | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+
| ``is_qa_gatekeeper``                     | ``bool``                      | **Optional.**                                                                                                        |
+------------------------------------------+-------------------------------+----------------------------------------------------------------------------------------------------------------------+

.. _UserLoginActivity:

UserLoginActivity
-----------------

Represents only entry of login activities (browser devices) of a user holding the last ip address, number of logins a.s.o

.. code-block:: json

 message UserLoginActivity {
  string id = 1;
  string name = 2;
  string title = 8;
  ItemType item_type = 9;
  google.protobuf.Timestamp creation_date = 10;
  google.protobuf.Timestamp modification_date = 11;
  uint32 logins = 12;
  string ip_address = 13;
  string location = 14;
  optional EffectivePermission effective_permission = 31;
 }

+--------------------------+-------------------------------+--------------------------------------------------------------------+
| Field                    | Type                          | Description                                                        |
+==========================+===============================+====================================================================+
| ``id``                   | ``string``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``name``                 | ``string``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``title``                | ``string``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``item_type``            | ``ItemType``                  | See :ref:`ItemType <ItemType>`                                     |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``creation_date``        | ``google.protobuf.Timestamp`` |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``modification_date``    | ``google.protobuf.Timestamp`` |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``logins``               | ``uint32``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``ip_address``           | ``string``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``location``             | ``string``                    |                                                                    |
+--------------------------+-------------------------------+--------------------------------------------------------------------+
| ``effective_permission`` | ``EffectivePermission``       | **Optional.** See :ref:`EffectivePermission <EffectivePermission>` |
+--------------------------+-------------------------------+--------------------------------------------------------------------+