Skip to content

Release 0.20.0 - #96

Merged
sewhyte merged 5 commits into
mainfrom
sw/0.20.0
Aug 3, 2026
Merged

Release 0.20.0#96
sewhyte merged 5 commits into
mainfrom
sw/0.20.0

Conversation

@sewhyte

@sewhyte sewhyte commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

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.

Add remove_user_from_team endpoint (POST /users/{email}/teams/remove).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sewhyte
sewhyte requested a review from philgebhardt July 14, 2026 16:45
@sewhyte
sewhyte requested a review from ZachNo August 3, 2026 17:56
Comment thread tests/test_users.py Outdated
self.assertEqual(GremlinAPIUsers.deactivate_user(**mock_users), mock_data)

@patch("requests.post")
def test_remove_user_from_team_with_decorator(self, mock_post) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np: even though mock_post is more correct naming, our other tests use mock_get no matter what lol

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll switch this for consistency.

Comment thread gremlinapi/users.py
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

kwargs["headers"]["Content-Type"] = "application/json"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

body forces application/json, and this new endpoint uses application/x-www-form-urlencoded.

@philgebhardt philgebhardt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment

Comment thread gremlinapi/users.py Outdated
sewhyte and others added 2 commits August 3, 2026 13:26
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.
@sewhyte
sewhyte merged commit 6f52665 into main Aug 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants