Conversation
Add remove_user_from_team endpoint (POST /users/{email}/teams/remove).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ZachNo
reviewed
Aug 3, 2026
| self.assertEqual(GremlinAPIUsers.deactivate_user(**mock_users), mock_data) | ||
|
|
||
| @patch("requests.post") | ||
| def test_remove_user_from_team_with_decorator(self, mock_post) -> None: |
There was a problem hiding this comment.
np: even though mock_post is more correct naming, our other tests use mock_get no matter what lol
Collaborator
Author
There was a problem hiding this comment.
I'll switch this for consistency.
| if isinstance(team_ids, str): | ||
| team_ids = [team_ids] | ||
| endpoint: str = f"/users/{email}/teams/remove" | ||
| payload: dict = cls._payload(**{"headers": https_client.header(), "data": {"teamIds": team_ids}}) # type: ignore |
There was a problem hiding this comment.
I think we want to set the "body" field instead of the "data" field here, as the other modify endpoints set that instead. It will auto set the content type:
gremlin-python/gremlinapi/http_clients.py
Line 119 in da36d5e
Collaborator
Author
There was a problem hiding this comment.
body forces application/json, and this new endpoint uses application/x-www-form-urlencoded.
Co-authored-by: Phil Gebhardt <gebhardt.phil@gmail.com>
Validate team_ids explicitly instead of a generic JSON body check, and send it via form-encoded data so requests sets Content-Type correctly.
philgebhardt
approved these changes
Aug 3, 2026
ZachNo
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add remove_user_from_team endpoint (POST /users/{email}/teams/remove).
Allows removing a user from multiple teams with a single method for cleaner API interactions.