Source code for team_client

[docs]def add_team_member(project_id, email, role): """ Adds a new team member to a project. :table:Input parameters summary: +--------------+----------+-------+--------------------------------------+ | Field | Input | Type | Description | +==============+==========+=======+======================================+ | project_id | body | str | The ID of the project. | +--------------+----------+-------+--------------------------------------+ | email | body | str | The email of the team member. | +--------------+----------+-------+--------------------------------------+ | role | body | str | The role of the team member. | +--------------+----------+-------+--------------------------------------+ Sample Request Body .. code-block:: python from pprint import pprint from tensoract.client import Tensoract # Initialize Tensoract client team_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY") member = team_client.add_team_member(project_id="449354de1168469a8229f605", email="someone@email.com", role="annotator|reviewer|supervisor") pprint(member) :table:Response summary: +--------+---------------------------------------------------------+ | Field | Description | +========+=========================================================+ | status | The status of the operation | +--------+---------------------------------------------------------+ | message| A message indicating whether the user was added to the | | | project team. | +--------+---------------------------------------------------------+ Sample Response .. code-block:: python response = { "status": "success", "value": "workers updated"} """
[docs]def get_project_team_members(project_id): """ Get the members of a project team. :table:Input parameters summary: +--------------+----------+-------+--------------------------------------+ | Field | Input | Type | Description | +==============+==========+=======+======================================+ | project_id | body | str | The Id of the project. | +--------------+----------+-------+--------------------------------------+ Sample Request Body .. code-block:: python from pprint import pprint from tensoract.client import Tensoract # Initialize Tensoract client team_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY") team = team_client.get_project_team_members(project_id="449354de1168469a8229f605") pprint(team) :table:Response summary: +--------+---------------------------------------------------------+ | Field | Description | +========+=========================================================+ | email | email_id of the user | +--------+---------------------------------------------------------+ | role | role of user | +--------+---------------------------------------------------------+ Sample Response .. code-block:: python [ { "email": "q1@qc.com", "role": "reviewer" }, { "email": "1@an.com", "role": "annotator" } ] """
[docs]def remove_project_team_member(project_id, email): """ Remove a member from a project team. :table:Input parameters summary: +--------------+----------+-------+--------------------------------------+ | Field | Input | Type | Description | +==============+==========+=======+======================================+ | project_id | body | str | The Id of the project | +--------------+----------+-------+--------------------------------------+ | email | body | str | The email of the team member | +--------------+----------+-------+--------------------------------------+ Sample Request Body .. code-block:: python from pprint import pprint from tensoract.client import Tensoract # Initialize Tensoract client team_client = Tensoract(api_url="YOUR_API_URL",api_key="YOUR_API_KEY") team = team_client.remove_project_team_member(project_id="449354de1168469a8229f605", email="someone@email.com" ) :table:Response summary: +--------+----------------------------------------------------------------+ | Field | Description | +========+================================================================+ | status | The status of the operation | +--------+----------------------------------------------------------------+ | message| A message indicating whether the member was removed | | | from the project team. | +--------+----------------------------------------------------------------+ Sample Response .. code-block:: python { "status": "success", "message": "user deleted from project team" } """