Skip to main content

workspaces

GitHub source

WorkspaceAPIClient

evo.workspaces.client.WorkspaceAPIClient

The Workspace Service API client.

from_context classmethod

from_context(context: IContext) -> WorkspaceAPIClient

Create a WorkspaceAPIClient from the given context.

The context must have a hub_url and org_id set.

Parameters:

NameTypeDescriptionDefault
contextIContextThe context to create the client from.required

Returns:

TypeDescription
WorkspaceAPIClientA WorkspaceAPIClient instance.

get_service_health async

get_service_health(check_type: HealthCheckType = HealthCheckType.FULL) -> ServiceHealth

Get the health of the workspace service.

Parameters:

NameTypeDescriptionDefault
check_typeHealthCheckTypeThe type of health check to perform.FULL

Returns:

TypeDescription
ServiceHealthA ServiceHealth object.

Raises:

TypeDescription
EvoAPIExceptionIf the API returns an unexpected status code.
ClientValueErrorIf the response is not a valid service health check response.

list_workspaces_summary async

list_workspaces_summary(
limit: int | None = None,
offset: int | None = None,
order_by: dict[WorkspaceOrderByEnum, OrderByOperatorEnum]
| dict[WorkspaceOrderByLiteral, OrderByOperatorLiteral]
| None = None,
filter_created_by: UUID | None = None,
created_at: str | None = None,
updated_at: str | None = None,
name: str | None = None,
deleted: bool | None = None,
filter_user_id: UUID | None = None,
) -> Page[BasicWorkspace]

Get an optionally paginated list of basic workspaces with optional filtering and sorting.

This method provides faster performance than list_workspaces() or list_all_workspaces() by returning BasicWorkspace objects with minimal data instead of full Workspace objects.

delete_workspace async

delete_workspace(workspace_id: UUID) -> None

Delete workspaces by workspace id.

Parameters:

NameTypeDescriptionDefault
workspace_idUUIDThe workspace id to delete.required

Returns:

TypeDescription
NoneAn empty response.

create_workspace async

create_workspace(
name: str,
bounding_box_coordinates: list[tuple[float, float]] | None = None,
default_coordinate_system: str | None = None,
description: str | None = None,
labels: list[str] | None = None,
) -> Workspace

Create a new workspace.

Parameters:

NameTypeDescriptionDefault
namestrThe name of the workspace.required
bounding_box_coordinateslist[tuple[float, float]] | NoneThe coordinates list corresponding to the bounding box of the workspace. The coordinates list should be in the format of [[longitude, latitude], [longitude, latitude], ...]None
default_coordinate_systemstr | NoneThe default coordinate system of the workspace.None
descriptionstr | NoneThe description of the workspace.None
labelslist[str] | NoneThe labels of the workspace.None

Returns:

TypeDescription
WorkspaceThe created workspace response.

update_workspace async

update_workspace(
workspace_id: UUID,
name: str | None = None,
bounding_box_coordinates: list[tuple[float, float]] | None = None,
default_coordinate_system: str | None = None,
description: str | None = None,
labels: list[str] | None = None,
) -> Workspace

Update an existing workspace.

Parameters:

NameTypeDescriptionDefault
workspace_idUUIDThe workspace id to update.required
namestr | NoneThe name of the workspace.None
bounding_box_coordinateslist[tuple[float, float]] | NoneThe coordinates list corresponding to the bounding box of the workspace. The coordinates list should be in the format of [[longitude, latitude], [longitude, latitude], ...]None
default_coordinate_systemstr | NoneThe default coordinate system of the workspace.None
descriptionstr | NoneThe description of the workspace.None
labelslist[str] | NoneThe labels of the workspace.None

Returns:

TypeDescription
WorkspaceThe updated workspace response.

list_instance_users async

list_instance_users(limit: int | None = None, offset: int | None = None) -> Page[InstanceUserWithEmail]

Returns a page of the list of instance users.

Parameters:

NameTypeDescriptionDefault
limitint | NoneThe maximum number of users to return.None
offsetint | NoneThe offset for pagination.None

Returns:

TypeDescription
Page[InstanceUserWithEmail]A page of instance users with email addresses.

add_users_to_instance async

add_users_to_instance(users: dict[str, list[UUID]]) -> AddedInstanceUsers

Adds users to the instance.

Parameters:

NameTypeDescriptionDefault
usersdict[str, list[UUID]]A dictionary mapping of user emails to their roles.required

Returns:

TypeDescription
AddedInstanceUsersA list of the users that were added and/or the invitations that were sent.

list_instance_user_invitations async

list_instance_user_invitations(limit: int | None = None, offset: int | None = None) -> Page[InstanceUserInvitation]

Returns a page of the list of instance user invitations.

Parameters:

NameTypeDescriptionDefault
limitint | NoneThe maximum number of invitations to return.None
offsetint | NoneThe offset for pagination.None

Returns:

TypeDescription
Page[InstanceUserInvitation]A page of instance user invitations.

delete_instance_user_invitation async

delete_instance_user_invitation(invitation_id: UUID) -> None

Deletes an instance user invitation.

Parameters:

NameTypeDescriptionDefault
invitation_idUUIDThe ID of the invitation to delete.required

list_instance_roles async

list_instance_roles() -> list[InstanceRoleWithPermissions]

Returns the list of roles available in the instance.

Returns:

TypeDescription
list[InstanceRoleWithPermissions]A list of instance user roles with their permissions.

remove_instance_user async

remove_instance_user(user_id: UUID) -> None

Removes a user from the instance.

Parameters:

NameTypeDescriptionDefault
user_idUUIDThe ID of the user to remove.required

update_instance_user_roles async

update_instance_user_roles(user_id: UUID, roles: list[UUID]) -> InstanceUser

Updates the roles of an instance user.

Parameters:

NameTypeDescriptionDefault
user_idUUIDThe ID of the user to update.required
roleslist[UUID]The new roles to assign to the user.required

Returns:

TypeDescription
InstanceUserThe updated instance user.

What is the reason for your feedback?