Managing Workspaces

Workspaces are created inside a Universe. Any number of Workspaces can be created.

A workspace has a set of suites that can be viewed by an admin user and an unlimited number of viewer users. Managing workspaces with Shimoku’s SDK goes as follows:

The s.workspaces module has the following methods:

  • get_workspace(uuid: Optional[str], name: Optional[str]) to retrieve workspace data.

  • create_workspace(name: str, create_default_roles: bool, theme: Optional[Dict]) to create a new workspace in your universe owned by the user owner_id and with name. Workspaces with names too similar will not be allowed.

  • update_workspace(uuid: Optional[str], name: Optional[str], new_name: Optional[str], theme: Optional[Dict]) to update the data of a workspace.

  • delete_workspace(uuid: Optional[str], name: Optional[str]) to retrieve workspace data.

  • get_workspace_menu_paths(uuid: Optional[str] = None, name: Optional[str] = None) to retrieve all the menu paths of a workspace.

  • get_workspace_menu_path_ids(uuid: Optional[str] = None, name: Optional[str] = None) to retrieve all the menu path ids of a workspace.

  • get_workspace_boards(uuid: Optional[str] = None, name: Optional[str] = None) to retrieve all the boards of a workspace.

  • delete_all_workspace_menu_paths(uuid: Optional[str], name: Optional[str]) to delete all menu paths in a workspace.

  • delete_all_workspace_boards(uuid: Optional[str], name: Optional[str]) to delete all boars in a workspace.

  • change_boards_order(uuid: Optional[str], name: Optional[str], boards: List[str]) to change the order of the boards.

  • change_menu_order(uuid: Optional[str], name: Optional[str], menu_order: List[Union[str, Tuple[str, List[str]]) to order the menu paths and it's sub-paths.

The Methods

1. Get workspace

workspace: Dict[str, Any] = s.workspaces.get_workspace(workspace_id)

That returns a dictionary such as:

workspace: Dict = {
  'id': 'f74gh9',  # workspace uuid
  'name': 'Ikea',  # workspace name
  'owner': '38c7f',  # user uuid
  'createdAt': '2021-01-01',
  'updatedAt '2021-09-24',
}

2. Get workspace menu paths

menu_paths: List[Dict[str, Any]] = \
s.workspaces.get_all_workspace_menu_paths(workspace_id)

That returns a dictionary such as:

menu_paths = [
  {
    'id': 'aaaa1'  # workspace uuid
    'owner': '38c7f',  # user uuid
    'createdAt': '2021-01-01',
    'updatedAt '2021-09-24',
    ...
  },
  {
    'id': 'bbbb1'  # workspace uuid
    'owner': '38c7f  # user uuid
    'createdAt': '2021-01-01',
    'updatedAt '2021-09-24',
     ...
  },
]

3. Get workspaces menu path ids

menu_path_ids: List[str] = \
s.workspaces.get_all_workspace_menu_path_ids(workspace_id)

That returns a dictionary such as:

# This workspace contains 3 menu paths
menu_path_ids = [
  'a19f1',  # a menu path UUID
  '920a0',  # another menu path UUID
  'c5d1d',  # another menu path UUID
]

Such as in:

4. Create workspace

workspace: Dict = s.workspaces.create_workspace(name)

That returns the workspace created:

workspace = {
  'id': 'f74gh9',  # workspace uuid
  'name': 'Ikea',  # workspace name
  'owner': '38c7f',  # user uuid
  'createdAt': '2021-01-01',
  'updatedAt '2021-09-24',
}

Last updated