Web Socket
==========

.. _WebSocketAddComment:

WebSocketAddComment
-------------------

.. code-block:: json

 message WebSocketAddComment {
  string tab_id = 1;
  Comment comment = 2;
 }

+-------------+-------------+------------------------------+
| Field       | Type        | Description                  |
+=============+=============+==============================+
| ``tab_id``  | ``string``  |                              |
+-------------+-------------+------------------------------+
| ``comment`` | ``Comment`` | See :ref:`Comment <Comment>` |
+-------------+-------------+------------------------------+

.. _WebSocketUpdateComment:

WebSocketUpdateComment
----------------------

.. code-block:: json

 message WebSocketUpdateComment {
  string tab_id = 1;
  Comment comment = 2;
 }

+-------------+-------------+------------------------------+
| Field       | Type        | Description                  |
+=============+=============+==============================+
| ``tab_id``  | ``string``  |                              |
+-------------+-------------+------------------------------+
| ``comment`` | ``Comment`` | See :ref:`Comment <Comment>` |
+-------------+-------------+------------------------------+

.. _WebSocketRemoveComment:

WebSocketRemoveComment
----------------------

.. code-block:: json

 message WebSocketRemoveComment {
  string tab_id = 1;
  string comment_id = 2;
 }

+----------------+------------+-------------+
| Field          | Type       | Description |
+================+============+=============+
| ``tab_id``     | ``string`` |             |
+----------------+------------+-------------+
| ``comment_id`` | ``string`` |             |
+----------------+------------+-------------+

.. _WebSocketCollectionUpdate:

WebSocketCollectionUpdate
-------------------------

.. code-block:: json

 message WebSocketCollectionUpdate {
  string tab_id = 1;
  optional string item_id = 2;
 }

+-------------+------------+---------------+
| Field       | Type       | Description   |
+=============+============+===============+
| ``tab_id``  | ``string`` |               |
+-------------+------------+---------------+
| ``item_id`` | ``string`` | **Optional.** |
+-------------+------------+---------------+

.. _WebSocketAdminChanged:

WebSocketAdminChanged
---------------------

.. code-block:: json

 message WebSocketAdminChanged {
  string tab_id = 1;
  string dataroom_id = 2;
  bool is_responsible_admin = 3;
 }

+--------------------------+------------+-------------+
| Field                    | Type       | Description |
+==========================+============+=============+
| ``tab_id``               | ``string`` |             |
+--------------------------+------------+-------------+
| ``dataroom_id``          | ``string`` |             |
+--------------------------+------------+-------------+
| ``is_responsible_admin`` | ``bool``   |             |
+--------------------------+------------+-------------+

.. _WebSocketGroupUpdated:

WebSocketGroupUpdated
---------------------

Data to update the user after changing groups or admin state

.. code-block:: json

 message WebSocketGroupUpdated {
  string tab_id = 1;
  string group_id = 2;
  bool is_admin = 3;
 }

+--------------+------------+-------------+
| Field        | Type       | Description |
+==============+============+=============+
| ``tab_id``   | ``string`` |             |
+--------------+------------+-------------+
| ``group_id`` | ``string`` |             |
+--------------+------------+-------------+
| ``is_admin`` | ``bool``   |             |
+--------------+------------+-------------+

.. _WebSocketGroupAdded:
  
WebSocketGroupAdded
-------------------

Data to tell a user changes about his state in a group

.. code-block:: json

 message WebSocketGroupAdded {
  string tab_id = 1;
  string group_id = 2;
  bool is_admin = 3;
  optional bool is_responsible_admin = 4;
 }

+--------------------------+------------+---------------+
| Field                    | Type       | Description   |
+==========================+============+===============+
| ``tab_id``               | ``string`` |               |
+--------------------------+------------+---------------+
| ``group_id``             | ``string`` |               |
+--------------------------+------------+---------------+
| ``is_admin``             | ``bool``   |               |
+--------------------------+------------+---------------+
| ``is_responsible_admin`` | ``bool``   | **Optional.** |
+--------------------------+------------+---------------+

.. _WebSocketGroupRemoved:

WebSocketGroupRemoved
---------------------

.. code-block:: json

 message WebSocketGroupRemoved {
  string tab_id = 1;
  string group_id = 2;
  bool is_admin = 3;
 }

+--------------------------+------------+---------------+
| Field                    | Type       | Description   |
+==========================+============+===============+
| ``tab_id``               | ``string`` |               |
+--------------------------+------------+---------------+
| ``group_id``             | ``string`` |               |
+--------------------------+------------+---------------+
| ``is_admin``             | ``bool``   |               |
+--------------------------+------------+---------------+


.. _WebSocketUserLogout:

WebSocketUserLogout
-------------------

.. code-block:: json

 message WebSocketUserLogout {
  string tab_id = 1;
 }

+--------------------------+------------+---------------+
| Field                    | Type       | Description   |
+==========================+============+===============+
| ``tab_id``               | ``string`` |               |
+--------------------------+------------+---------------+

.. _WebSocketDataroomSettingsChanged:

WebSocketDataroomSettingsChanged
--------------------------------

.. code-block:: json

 message WebSocketDataroomSettingsChanged {
  string tab_id = 1;
 }

+--------------------------+------------+---------------+
| Field                    | Type       | Description   |
+==========================+============+===============+
| ``tab_id``               | ``string`` |               |
+--------------------------+------------+---------------+

.. _WebSocketUserSettingsChanged:

WebSocketUserSettingsChanged
----------------------------

.. code-block:: json

 message WebSocketUserSettingsChanged {
  string tab_id = 1;
 }

+--------------------------+------------+---------------+
| Field                    | Type       | Description   |
+==========================+============+===============+
| ``tab_id``               | ``string`` |               |
+--------------------------+------------+---------------+

.. _WebSocketDataroomAdded:

WebSocketDataroomAdded
----------------------

.. code-block:: json

 message WebSocketDataroomAdded {
  string tab_id = 1;
  string dataroom_id = 2;
 }

+-----------------+------------+-------------+
| Field           | Type       | Description |
+=================+============+=============+
| ``tab_id``      | ``string`` |             |
+-----------------+------------+-------------+
| ``dataroom_id`` | ``string`` |             |
+-----------------+------------+-------------+

.. _WebSocketDataroomRemoved:

WebSocketDataroomRemoved
------------------------

.. code-block:: json

 message WebSocketDataroomRemoved {
  string tab_id = 1;
  string dataroom_id = 2;
 }

+-----------------+------------+-------------+
| Field           | Type       | Description |
+=================+============+=============+
| ``tab_id``      | ``string`` |             |
+-----------------+------------+-------------+
| ``dataroom_id`` | ``string`` |             |
+-----------------+------------+-------------+

.. _WebSocketUnreadCounter:

WebSocketUnreadCounter
----------------------

.. code-block:: json

 message WebSocketUnreadCounter {
  uint32 ticker = 1;
 }

+------------+------------+-------------+
| Field      | Type       | Description |
+============+============+=============+
| ``ticker`` | ``uint32`` |             |
+------------+------------+-------------+

.. _FilesAutoDeleted:

FilesAutoDeleted
----------------

.. code-block:: json

 message FilesAutoDeleted {
  Document data = 2;
  string path = 3;
  ItemType root_type = 4;
 }

+---------------+--------------+--------------------------------+
| Field         | Type         | Description                    |
+===============+==============+================================+
| ``data``      | ``Document`` | See :ref:`Document <Document>` |
+---------------+--------------+--------------------------------+
| ``path``      | ``string``   |                                |
+---------------+--------------+--------------------------------+
| ``root_type`` | ``ItemType`` | See :ref:`ItemType <ItemType>` |
+---------------+--------------+--------------------------------+

.. _WebsocketFilesAutoDeleted:

WebsocketFilesAutoDeleted
-------------------------

.. code-block:: json

 message WebsocketFilesAutoDeleted {
  string tab_id = 1;
  repeated FilesAutoDeleted items = 2;
 }

+------------+-------------------------------+------------------------------------------------+
| Field      | Type                          | Description                                    |
+============+===============================+================================================+
| ``tab_id`` | ``string``                    |                                                |
+------------+-------------------------------+------------------------------------------------+
| ``items``  | array of ``FilesAutoDeleted`` | See :ref:`FilesAutoDeleted <FilesAutoDeleted>` |
+------------+-------------------------------+------------------------------------------------+

