Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/evo-sdk-common/src/evo/workspaces/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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 = {
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand All @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down