[SYNPY-1633] Add membership_status to Team model and Deprecate Old Method - #1235
Conversation
| Returns: | ||
| A dictionary of TeamMembershipStatus | ||
| """ | ||
| from synapseclient import Synapse | ||
|
|
||
| client = Synapse.get_client(synapse_client=synapse_client) | ||
| status = await get_membership_status( | ||
| user_id=user_id, team=team, synapse_client=client | ||
| ) | ||
| return status |
There was a problem hiding this comment.
Since users will call this, can we convert the response from the API call (https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/TeamMembershipStatus.html) into a Dataclass (Similar to what we did with TeamMembers
synapsePythonClient/synapseclient/models/team.py
Lines 23 to 56 in 04cfbe3
This will ensure that anyone calling this Method knows exactly what to expect from both the mkdocs page AND within the IDE via the hoverdocs.
BryanFauble
left a comment
There was a problem hiding this comment.
Swap to Dataclass for return from method for better user experience
BryanFauble
left a comment
There was a problem hiding this comment.
This is great! I had a few comments, but nothing that changes the functionality of what was proposed.
Problem:
This method here needs to be deprecated: synapsePythonClient/synapseclient/client.py at 02d3b38d2a0f043811637064f61ae8b537e4253b · Sage-Bionetworks/synapsePythonClient
Solution:
Added a new method called
get_user_membership_statusunder teamTesting: