class_docstr: The `Workspace` class is used to manage workspaces in Argilla. It provides
  methods to create new workspaces, add users to them, list the linked users,
  and delete users from the workspace. While it's not allowed to delete a workspace
  neither to update the workspace name.
  
  Args:
      name: the name of the workspace to be managed. Defaults to None.
      id: the ID of the workspace to be managed. Defaults to None.
  
  Attributes:
      _client: the `httpx.Client` initialized to interact with the Argilla API.
      id: the ID of the workspace.
      name: the name of the workspace.
      users: the list of users linked to the workspace. Defaults to None.
      inserted_at: the datetime when the workspace was created.
      updated_at: the datetime when the workspace was last updated.
  
  Examples:
      >>> from argilla import rg
      >>> workspace = rg.Workspace.from_name("my-workspace") # or `Workspace.from_id("...")`
      >>> workspace.add_user("my-user")
      >>> print(workspace.users)
      [UserModel(id='...', first_name='Luke', last_name="Skywalker', full_name='Luke Skywalker', username='my-user', role='annotator', workspaces=['my-workspace'], api_key='...', inserted_at=datetime.datetime(2021, 8, 31, 10, 0, 0), updated_at=datetime.datetime(2021, 8, 31, 10, 0, 0))]
      >>> workspace.delete_user("my-user")
      >>> print(workspace.users)
      []
class_docstr_tok: ["The","`","Workspace","`","class","is","used","to","manage","workspaces","in","Argilla",".","It","provides","methods","to","create","new","workspaces",",","add","users","to","them",",","list","the","linked","users",",","and","delete","users","from","the","workspace",".","While","it","'s","not","allowed","to","delete","a","workspace","neither","to","update","the","workspace","name",".","Args",":","name",":","the","name","of","the","workspace","to","be","managed",".","Defaults","to","None",".","id",":","the","ID","of","the","workspace","to","be","managed",".","Defaults","to","None",".","Attributes",":","_client",":","the","`","httpx.Client","`","initialized","to","interact","with","the","Argilla","API",".","id",":","the","ID","of","the","workspace",".","name",":","the","name","of","the","workspace",".","users",":","the","list","of","users","linked","to","the","workspace",".","Defaults","to","None",".","inserted_at",":","the","datetime","when","the","workspace","was","created",".","updated_at",":","the","datetime","when","the","workspace","was","last","updated",".","Examples",":",">",">",">","from","argilla","import","rg",">",">",">","workspace","=","rg.Workspace.from_name","(","``","my-workspace","''",")","#","or","`","Workspace.from_id","(","``","...","''",")","`",">",">",">","workspace.add_user","(","``","my-user","''",")",">",">",">","print","(","workspace.users",")","[","UserModel","(","id=","'","...","'",",","first_name='Luke","'",",","last_name=","''","Skywalker","'",",","full_name='Luke","Skywalker","'",",","username='my-user","'",",","role='annotator","'",",","workspaces=","[","'my-workspace","'","]",",","api_key=","'","...","'",",","inserted_at=datetime.datetime","(","2021",",","8",",","31",",","10",",","0",",","0",")",",","updated_at=datetime.datetime","(","2021",",","8",",","31",",","10",",","0",",","0",")",")","]",">",">",">","workspace.delete_user","(","``","my-user","''",")",">",">",">","print","(","workspace.users",")","[","]"]
docstr: Doesn't initialize the `Workspace`, as it needs to be instantiated via any of
  the following classmethods, as the Argilla API is required.
      - `Workspace.create` to create a new workspace in Argilla
      - `Workspace.from_name` to get an existing workspace from Argilla by its name
      - `Workspace.from_id` to get an existing workspace from Argilla by its ID
      - `Workspace.list` to list all the workspaces in Argilla
  
  Args:
      name: the name of the workspace to be managed. Defaults to None.
      id: the ID of the workspace to be managed. Defaults to None.
  
  Raises:
      Exception: if the `Workspace` is initialized via the `__init__` method.
docstr_tok: ["Does","n't","initialize","the","`","Workspace","`",",","as","it","needs","to","be","instantiated","via","any","of","the","following","classmethods",",","as","the","Argilla","API","is","required",".","-","`","Workspace.create","`","to","create","a","new","workspace","in","Argilla","-","`","Workspace.from_name","`","to","get","an","existing","workspace","from","Argilla","by","its","name","-","`","Workspace.from_id","`","to","get","an","existing","workspace","from","Argilla","by","its","ID","-","`","Workspace.list","`","to","list","all","the","workspaces","in","Argilla","Args",":","name",":","the","name","of","the","workspace","to","be","managed",".","Defaults","to","None",".","id",":","the","ID","of","the","workspace","to","be","managed",".","Defaults","to","None",".","Raises",":","Exception",":","if","the","`","Workspace","`","is","initialized","via","the","`","__init__","`","method","."]
code: def __init__(
      self,
      name: Optional[str] = None,
      *,
      id: Optional[Union[str, UUID]] = None,
  ) -> None:
      """Doesn't initialize the `Workspace`, as it needs to be instantiated via any of
      the following classmethods, as the Argilla API is required.
          - `Workspace.create` to create a new workspace in Argilla
          - `Workspace.from_name` to get an existing workspace from Argilla by its name
          - `Workspace.from_id` to get an existing workspace from Argilla by its ID
          - `Workspace.list` to list all the workspaces in Argilla
  
      Args:
          name: the name of the workspace to be managed. Defaults to None.
          id: the ID of the workspace to be managed. Defaults to None.
  
      Raises:
          Exception: if the `Workspace` is initialized via the `__init__` method.
      """
      error_msg = (
          "`Workspace` cannot be initialized via the `__init__` method, as it needs"
          " to send requests to the Argilla API, so it can just be instantiated via"
          " the following classmethods: `Workspace.create`, `Workspace.from_name`,"
          " `Workspace.from_id` and `Workspace.list`; note that it must exist in"
          " advance in Argilla."
      )
      if id is not None:
          error_msg += f" As the `id` argument is not None, you should use `Workspace.from_id('{id}')` instead."
      if name is not None:
          error_msg += f" As the `name` argument is not None, you should use `Workspace.from_name('{name}')` instead."
      raise Exception(error_msg)
  
imports: import warnings
  from datetime import datetime
  from typing import TYPE_CHECKING, Iterator, List, Optional, Union
  from uuid import UUID
  from argilla.client.sdk.commons.errors import AlreadyExistsApiError, BaseClientError, NotFoundApiError, ValidationApiError
  from argilla.client.sdk.users.models import UserRole
  from argilla.client.sdk.v1.workspaces import api
  from argilla.client.sdk.v1.workspaces.models import WorkspaceModel
  from argilla.client.sdk.workspaces import api
  from argilla.client.sdk.workspaces.models import WorkspaceModel
  from argilla.client.singleton import active_client
  from argilla.client.users import User
  from argilla.client.utils import allowed_for_roles
label_desc: Use image node_id 1 to create a new Workspace object  with example: obj = Workspace(name)