diff --git a/packages/evo-sdk-common/src/evo/workspaces/client.py b/packages/evo-sdk-common/src/evo/workspaces/client.py index f3923269..ee90f1d0 100644 --- a/packages/evo-sdk-common/src/evo/workspaces/client.py +++ b/packages/evo-sdk-common/src/evo/workspaces/client.py @@ -95,7 +95,7 @@ async def list_user_roles( 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(filter_user_id) if filter_user_id else None, ) return [parse.user_model(item) for item in response.results] @@ -159,12 +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(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(filter_user_id) if filter_user_id else None, ) return Page( @@ -238,12 +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(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(filter_user_id) if filter_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..ec8e1794 100644 --- a/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py +++ b/packages/evo-sdk-common/tests/workspaces/test_workspace_client.py @@ -447,9 +447,9 @@ async def test_list_workspaces_summary_all_args(self) -> None: 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())