From c5e9dfe81917d074eb8b9053ad5be86274aa3333 Mon Sep 17 00:00:00 2001 From: Samiul Azam Date: Wed, 18 Feb 2026 12:28:51 -0700 Subject: [PATCH 1/3] new filters introduced --- .../src/evo/workspaces/client.py | 14 +++++++++ .../evo/workspaces/endpoints/api/admin_api.py | 24 +++++++++++++++ .../endpoints/api/workspaces_api.py | 30 +++++++++++++++++++ .../tests/workspaces/test_workspace_client.py | 8 ++--- 4 files changed, 72 insertions(+), 4 deletions(-) diff --git a/packages/evo-sdk-common/src/evo/workspaces/client.py b/packages/evo-sdk-common/src/evo/workspaces/client.py index f3923269..5c0c4aea 100644 --- a/packages/evo-sdk-common/src/evo/workspaces/client.py +++ b/packages/evo-sdk-common/src/evo/workspaces/client.py @@ -91,11 +91,13 @@ async def list_user_roles( self, workspace_id: UUID, filter_user_id: UUID | None = None, + user_id: UUID | None = None, ) -> list[User]: response = await self._workspaces_api.list_user_roles( org_id=str(self._org_id), workspace_id=str(workspace_id), filter_user_id=str(filter_user_id) if filter_user_id else None, + user_id=str(user_id) if user_id else None, ) return [parse.user_model(item) for item in response.results] @@ -145,11 +147,13 @@ async def list_workspaces( | dict[WorkspaceOrderByLiteral, OrderByOperatorLiteral] | None = None, filter_created_by: UUID | None = None, + 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, + user_id: UUID | None = None, ) -> Page[Workspace]: parsed_order_by = parse_order_by(order_by) # type: ignore if not offset: @@ -160,11 +164,13 @@ async def list_workspaces( offset=offset, order_by=parsed_order_by, filter_created_by=str(filter_created_by) if filter_created_by else None, + created_by=str(created_by) if created_by else None, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, filter_user_id=str(filter_user_id) if filter_user_id else None, + user_id=str(user_id) if user_id else None, ) return Page( @@ -180,11 +186,13 @@ async def list_all_workspaces( offset: int | None = None, order_by: dict[WorkspaceOrderByEnum, OrderByOperatorEnum] | None = None, filter_created_by: UUID | None = None, + 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, + user_id: UUID | None = None, ) -> list[Workspace]: workspaces: list[Workspace] = [] if offset is None: @@ -198,11 +206,13 @@ async def list_all_workspaces( offset=offset, order_by=order_by, filter_created_by=filter_created_by, + created_by=created_by, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, filter_user_id=filter_user_id, + user_id=user_id, ) workspaces += workspace_page.items() offset += limit @@ -219,11 +229,13 @@ async def list_workspaces_summary( | dict[WorkspaceOrderByLiteral, OrderByOperatorLiteral] | None = None, filter_created_by: UUID | None = None, + 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, + user_id: UUID | None = None, ) -> Page[BasicWorkspace]: """ Get an optionally paginated list of basic workspaces with optional filtering and sorting. @@ -239,11 +251,13 @@ async def list_workspaces_summary( offset=offset, order_by=parsed_order_by, filter_created_by=str(filter_created_by) if filter_created_by else None, + created_by=str(created_by) if created_by else None, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, filter_user_id=str(filter_user_id) if filter_user_id else None, + user_id=str(user_id) if user_id else None, ) return Page( diff --git a/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/admin_api.py b/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/admin_api.py index dd2f694d..c5baac07 100644 --- a/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/admin_api.py +++ b/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/admin_api.py @@ -456,6 +456,7 @@ async def list_user_roles_admin( workspace_id: str, org_id: str, filter_user_id: str | None = None, + user_id: str | None = None, additional_headers: dict[str, str] | None = None, request_timeout: int | float | tuple[int | float, int | float] | None = None, ) -> ListUserRoleResponse: # noqa: F405 @@ -472,6 +473,9 @@ async def list_user_roles_admin( :param filter_user_id: (optional) Filter to see the role of a specific user ID. Format: `uuid` Example: `'filter_user_id_example'` + :param user_id: (optional) Filter to see the role of a specific user ID. + Format: `uuid` + Example: `'user_id_example'` :param additional_headers: (optional) Additional headers to send with the request. :param request_timeout: (optional) Timeout setting for this request. If one number is provided, it will be the total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -499,6 +503,8 @@ async def list_user_roles_admin( _query_params = {} if filter_user_id is not None: _query_params["filter[user_id]"] = filter_user_id + if user_id is not None: + _query_params["user_id"] = user_id # Prepare the header parameters. _header_params = { @@ -534,6 +540,7 @@ async def list_user_workspaces_admin( sort: str | None = None, order_by: str | None = None, filter_created_by: str | None = None, + created_by: str | None = None, created_at: str | None = None, updated_at: str | None = None, filter_name: str | None = None, @@ -563,6 +570,9 @@ async def list_user_workspaces_admin( :param filter_created_by: (optional) Filter by workspace that a user has created, by user ID. Format: `uuid` Example: `'filter_created_by_example'` + :param created_by: (optional) Filter by workspace that a user has created, by user ID. + Format: `uuid` + Example: `'created_by_example'` :param created_at: (optional) Filter by the time workspace has created. Example: `'created_at_example'` :param updated_at: (optional) Filter by the latest time workspace was updated. @@ -608,6 +618,8 @@ async def list_user_workspaces_admin( _query_params["order_by"] = order_by if filter_created_by is not None: _query_params["filter[created_by]"] = filter_created_by + if created_by is not None: + _query_params["created_by"] = created_by if created_at is not None: _query_params["created_at"] = created_at if updated_at is not None: @@ -652,12 +664,14 @@ async def list_workspaces_admin( sort: str | None = None, order_by: str | None = None, filter_created_by: str | None = None, + created_by: str | None = None, created_at: str | None = None, updated_at: str | None = None, filter_name: str | None = None, name: str | None = None, deleted: bool | None = None, filter_user_id: str | None = None, + user_id: str | None = None, additional_headers: dict[str, str] | None = None, request_timeout: int | float | tuple[int | float, int | float] | None = None, ) -> ListWorkspacesResponse: # noqa: F405 @@ -679,6 +693,9 @@ async def list_workspaces_admin( :param filter_created_by: (optional) Filter by workspace that a user has created, by user ID. Format: `uuid` Example: `'filter_created_by_example'` + :param created_by: (optional) Filter by workspace that a user has created, by user ID. + Format: `uuid` + Example: `'created_by_example'` :param created_at: (optional) Filter by the time workspace has created. Example: `'created_at_example'` :param updated_at: (optional) Filter by the latest time workspace was updated. @@ -692,6 +709,9 @@ async def list_workspaces_admin( :param filter_user_id: (optional) Filter by workspaces that a user ID has access to. Format: `uuid` Example: `'filter_user_id_example'` + :param user_id: (optional) Filter by workspaces that a user ID has access to. + Format: `uuid` + Example: `'user_id_example'` :param additional_headers: (optional) Additional headers to send with the request. :param request_timeout: (optional) Timeout setting for this request. If one number is provided, it will be the total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -726,6 +746,8 @@ async def list_workspaces_admin( _query_params["order_by"] = order_by if filter_created_by is not None: _query_params["filter[created_by]"] = filter_created_by + if created_by is not None: + _query_params["created_by"] = created_by if created_at is not None: _query_params["created_at"] = created_at if updated_at is not None: @@ -738,6 +760,8 @@ async def list_workspaces_admin( _query_params["deleted"] = deleted if filter_user_id is not None: _query_params["filter[user_id]"] = filter_user_id + if user_id is not None: + _query_params["user_id"] = user_id # Prepare the header parameters. _header_params = { diff --git a/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/workspaces_api.py b/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/workspaces_api.py index e1271550..4f17b5f9 100644 --- a/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/workspaces_api.py +++ b/packages/evo-sdk-common/src/evo/workspaces/endpoints/api/workspaces_api.py @@ -459,6 +459,7 @@ async def list_user_roles( workspace_id: str, org_id: str, filter_user_id: str | None = None, + user_id: str | None = None, additional_headers: dict[str, str] | None = None, request_timeout: int | float | tuple[int | float, int | float] | None = None, ) -> ListUserRoleResponse: # noqa: F405 @@ -475,6 +476,9 @@ async def list_user_roles( :param filter_user_id: (optional) Filter to see the role of a specific user ID. Format: `uuid` Example: `'filter_user_id_example'` + :param user_id: (optional) Filter to see the role of a specific user ID. + Format: `uuid` + Example: `'user_id_example'` :param additional_headers: (optional) Additional headers to send with the request. :param request_timeout: (optional) Timeout setting for this request. If one number is provided, it will be the total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -502,6 +506,8 @@ async def list_user_roles( _query_params = {} if filter_user_id is not None: _query_params["filter[user_id]"] = filter_user_id + if user_id is not None: + _query_params["user_id"] = user_id # Prepare the header parameters. _header_params = { @@ -536,12 +542,14 @@ async def list_workspaces( sort: str | None = None, order_by: str | None = None, filter_created_by: str | None = None, + created_by: str | None = None, created_at: str | None = None, updated_at: str | None = None, filter_name: str | None = None, name: str | None = None, deleted: bool | None = None, filter_user_id: str | None = None, + user_id: str | None = None, additional_headers: dict[str, str] | None = None, request_timeout: int | float | tuple[int | float, int | float] | None = None, ) -> ListWorkspacesResponse: # noqa: F405 @@ -563,6 +571,9 @@ async def list_workspaces( :param filter_created_by: (optional) Filter by workspace that a user has created, by user ID. Format: `uuid` Example: `'filter_created_by_example'` + :param created_by: (optional) Filter by workspace that a user has created, by user ID. + Format: `uuid` + Example: `'created_by_example'` :param created_at: (optional) Filter by the time workspace has created. Example: `'created_at_example'` :param updated_at: (optional) Filter by the latest time workspace was updated. @@ -576,6 +587,9 @@ async def list_workspaces( :param filter_user_id: (optional) Filter by workspaces that a user ID has access to. Format: `uuid` Example: `'filter_user_id_example'` + :param user_id: (optional) Filter by workspaces that a user ID has access to. + Format: `uuid` + Example: `'user_id_example'` :param additional_headers: (optional) Additional headers to send with the request. :param request_timeout: (optional) Timeout setting for this request. If one number is provided, it will be the total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -610,6 +624,8 @@ async def list_workspaces( _query_params["order_by"] = order_by if filter_created_by is not None: _query_params["filter[created_by]"] = filter_created_by + if created_by is not None: + _query_params["created_by"] = created_by if created_at is not None: _query_params["created_at"] = created_at if updated_at is not None: @@ -622,6 +638,8 @@ async def list_workspaces( _query_params["deleted"] = deleted if filter_user_id is not None: _query_params["filter[user_id]"] = filter_user_id + if user_id is not None: + _query_params["user_id"] = user_id # Prepare the header parameters. _header_params = { @@ -656,12 +674,14 @@ async def list_workspaces_summary( sort: str | None = None, order_by: str | None = None, filter_created_by: str | None = None, + created_by: str | None = None, created_at: str | None = None, updated_at: str | None = None, filter_name: str | None = None, name: str | None = None, deleted: bool | None = None, filter_user_id: str | None = None, + user_id: str | None = None, additional_headers: dict[str, str] | None = None, request_timeout: int | float | tuple[int | float, int | float] | None = None, ) -> ListWorkspaceSummaryResponse: # noqa: F405 @@ -682,6 +702,9 @@ async def list_workspaces_summary( :param filter_created_by: (optional) Filter by workspace that a user has created, by user ID. Format: `uuid` Example: `'filter_created_by_example'` + :param created_by: (optional) Filter by workspace that a user has created, by user ID. + Format: `uuid` + Example: `'created_by_example'` :param created_at: (optional) Filter by the time workspace has created. Example: `'created_at_example'` :param updated_at: (optional) Filter by the latest time workspace was updated. @@ -695,6 +718,9 @@ async def list_workspaces_summary( :param filter_user_id: (optional) Filter by workspaces that a user ID has access to. Format: `uuid` Example: `'filter_user_id_example'` + :param user_id: (optional) Filter by workspaces that a user ID has access to. + Format: `uuid` + Example: `'user_id_example'` :param additional_headers: (optional) Additional headers to send with the request. :param request_timeout: (optional) Timeout setting for this request. If one number is provided, it will be the total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -729,6 +755,8 @@ async def list_workspaces_summary( _query_params["order_by"] = order_by if filter_created_by is not None: _query_params["filter[created_by]"] = filter_created_by + if created_by is not None: + _query_params["created_by"] = created_by if created_at is not None: _query_params["created_at"] = created_at if updated_at is not None: @@ -741,6 +769,8 @@ async def list_workspaces_summary( _query_params["deleted"] = deleted if filter_user_id is not None: _query_params["filter[user_id]"] = filter_user_id + if user_id is not None: + _query_params["user_id"] = user_id # Prepare the header parameters. _header_params = { diff --git a/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py b/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py index 2c7957dd..d73e17d5 100644 --- a/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py +++ b/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py @@ -437,19 +437,19 @@ async def test_list_workspaces_summary_all_args(self) -> None: offset=10, limit=20, order_by=order_by, - filter_created_by=USER_ID, + created_by=USER_ID, created_at=str(utc_datetime(2020, 1, 1)), updated_at=str(utc_datetime(2020, 1, 1)), name="Test Workspace A", deleted=False, - filter_user_id=USER_ID, + user_id=USER_ID, ) self.assert_request_made( method=RequestMethod.GET, path=f"{BASE_PATH}/workspaces/summary?" - f"limit=20&offset=10&order_by=asc%3Aname&filter%5Bcreated_by%5D=00000000-0000-0000-0000-000000000002&" + f"limit=20&offset=10&order_by=asc%3Aname&created_by=00000000-0000-0000-0000-000000000002&" f"created_at=2020-01-01+00%3A00%3A00%2B00%3A00&updated_at=2020-01-01+00%3A00%3A00%2B00%3A00&" - f"name=Test+Workspace+A&deleted=False&filter%5Buser_id%5D=00000000-0000-0000-0000-000000000002", + f"name=Test+Workspace+A&deleted=False&user_id=00000000-0000-0000-0000-000000000002", headers={"Accept": "application/json"}, ) self.assertEqual([], workspaces.items()) From cdf33a49954034498d9f884ed7d645e1607ca6b5 Mon Sep 17 00:00:00 2001 From: Samiul Azam Date: Wed, 18 Feb 2026 13:03:02 -0700 Subject: [PATCH 2/3] no changes in the client interface --- .../src/evo/workspaces/client.py | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/packages/evo-sdk-common/src/evo/workspaces/client.py b/packages/evo-sdk-common/src/evo/workspaces/client.py index 5c0c4aea..ee90f1d0 100644 --- a/packages/evo-sdk-common/src/evo/workspaces/client.py +++ b/packages/evo-sdk-common/src/evo/workspaces/client.py @@ -91,13 +91,11 @@ async def list_user_roles( self, workspace_id: UUID, filter_user_id: UUID | None = None, - user_id: UUID | None = None, ) -> list[User]: response = await self._workspaces_api.list_user_roles( org_id=str(self._org_id), workspace_id=str(workspace_id), - filter_user_id=str(filter_user_id) if filter_user_id else None, - user_id=str(user_id) if user_id else None, + user_id=str(filter_user_id) if filter_user_id else None, ) return [parse.user_model(item) for item in response.results] @@ -147,13 +145,11 @@ async def list_workspaces( | dict[WorkspaceOrderByLiteral, OrderByOperatorLiteral] | None = None, filter_created_by: UUID | None = None, - 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, - user_id: UUID | None = None, ) -> Page[Workspace]: parsed_order_by = parse_order_by(order_by) # type: ignore if not offset: @@ -163,14 +159,12 @@ async def list_workspaces( limit=limit, offset=offset, order_by=parsed_order_by, - filter_created_by=str(filter_created_by) if filter_created_by else None, - created_by=str(created_by) if created_by else None, + created_by=str(filter_created_by) if filter_created_by else None, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, - filter_user_id=str(filter_user_id) if filter_user_id else None, - user_id=str(user_id) if user_id else None, + user_id=str(filter_user_id) if filter_user_id else None, ) return Page( @@ -186,13 +180,11 @@ async def list_all_workspaces( offset: int | None = None, order_by: dict[WorkspaceOrderByEnum, OrderByOperatorEnum] | None = None, filter_created_by: UUID | None = None, - 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, - user_id: UUID | None = None, ) -> list[Workspace]: workspaces: list[Workspace] = [] if offset is None: @@ -206,13 +198,11 @@ async def list_all_workspaces( offset=offset, order_by=order_by, filter_created_by=filter_created_by, - created_by=created_by, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, filter_user_id=filter_user_id, - user_id=user_id, ) workspaces += workspace_page.items() offset += limit @@ -229,13 +219,11 @@ async def list_workspaces_summary( | dict[WorkspaceOrderByLiteral, OrderByOperatorLiteral] | None = None, filter_created_by: UUID | None = None, - 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, - user_id: UUID | None = None, ) -> Page[BasicWorkspace]: """ Get an optionally paginated list of basic workspaces with optional filtering and sorting. @@ -250,14 +238,12 @@ async def list_workspaces_summary( limit=limit, offset=offset, order_by=parsed_order_by, - filter_created_by=str(filter_created_by) if filter_created_by else None, - created_by=str(created_by) if created_by else None, + created_by=str(filter_created_by) if filter_created_by else None, created_at=created_at, updated_at=updated_at, name=name, deleted=deleted, - filter_user_id=str(filter_user_id) if filter_user_id else None, - user_id=str(user_id) if user_id else None, + user_id=str(filter_user_id) if filter_user_id else None, ) return Page( From 383dcab2ff410ffb5d8b737179370142a2c7b172 Mon Sep 17 00:00:00 2001 From: Samiul Azam Date: Wed, 18 Feb 2026 13:07:07 -0700 Subject: [PATCH 3/3] no changes in the client interface --- .../evo-sdk-common/tests/workspaces/test_workspace_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py b/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py index d73e17d5..ec8e1794 100644 --- a/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py +++ b/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py @@ -437,12 +437,12 @@ async def test_list_workspaces_summary_all_args(self) -> None: offset=10, limit=20, order_by=order_by, - created_by=USER_ID, + filter_created_by=USER_ID, created_at=str(utc_datetime(2020, 1, 1)), updated_at=str(utc_datetime(2020, 1, 1)), name="Test Workspace A", deleted=False, - user_id=USER_ID, + filter_user_id=USER_ID, ) self.assert_request_made( method=RequestMethod.GET,