Skip to content

Fix project_id type #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
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
8 changes: 4 additions & 4 deletions mergin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,14 +1328,14 @@ def remove_workspace_member(self, workspace_id: int, user_id: int):
"""
self.delete(f"v2/workspaces/{workspace_id}/members/{user_id}")

def list_project_collaborators(self, project_id: int) -> List[dict]:
def list_project_collaborators(self, project_id: str) -> List[dict]:
"""
Get a list of project collaborators
"""
project_collaborators = self.get(f"v2/projects/{project_id}/collaborators")
return json.load(project_collaborators)

def add_project_collaborator(self, project_id: int, user: str, project_role: ProjectRole) -> dict:
def add_project_collaborator(self, project_id: str, user: str, project_role: ProjectRole) -> dict:
"""
Add a user to project collaborators and grant them a project role.
Fails if user is already a member of the project.
Expand All @@ -1346,7 +1346,7 @@ def add_project_collaborator(self, project_id: int, user: str, project_role: Pro
project_collaborator = self.post(f"v2/projects/{project_id}/collaborators", params, json_headers)
return json.load(project_collaborator)

def update_project_collaborator(self, project_id: int, user_id: int, project_role: ProjectRole) -> dict:
def update_project_collaborator(self, project_id: str, user_id: int, project_role: ProjectRole) -> dict:
"""
Update project role of the existing project collaborator.
Fails if user is not a member of the project yet.
Expand All @@ -1355,7 +1355,7 @@ def update_project_collaborator(self, project_id: int, user_id: int, project_rol
project_collaborator = self.patch(f"v2/projects/{project_id}/collaborators/{user_id}", params, json_headers)
return json.load(project_collaborator)

def remove_project_collaborator(self, project_id: int, user_id: int):
def remove_project_collaborator(self, project_id: str, user_id: int):
"""
Remove a user from project collaborators
"""
Expand Down