Skip to content

feat: add team member removal and a project filter for the member list - #42

Merged
bjarn merged 1 commit into
feat/team-rolesfrom
feat/team-member-removal
Oct 21, 2026
Merged

bjarn merged 1 commit into
feat/team-rolesfrom
feat/team-member-removal

Conversation

@bjarn

@bjarn bjarn commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What changed

Non-breaking. Adds team member removal and documents the new project filter on the member list. Stacked on the team role management PR.

  • team.members.remove(user_id) removes a non-Owner member from the team and returns a MessageResponse. It uses the team token and sends no Idempotency-Key header. A 409 raises ConflictError with the error code (for example owner_protected). Empty or .. user IDs raise LettermintConfigError before any request.
  • team.members.list() and team.members.iterate() already take the generated ListTeamMembersQuery, so the new filter[project_id] works without a code change: {"filter": {"project_id": ...}} returns only the members who can access that project (members with access to all projects plus members selected for it). Tests cover it on list and on every page of iterate.
  • This PR removes the pending list from the coverage test, so tests/test_surface.py is strict again: every generated operation must be reachable from both clients.

Usage

for member in lettermint.team.members.iterate({"filter": {"project_id": "project-id"}}):
    print(member["email"])

lettermint.team.members.remove("user-id")

Checks

Run locally at the top of the stack:

  • python -m ruff check src tests scripts: all checks passed
  • python -m ruff format --check src tests scripts: 28 files already formatted
  • python -m mypy: no issues in 35 source files
  • python scripts/unasync.py --check: up to date
  • python scripts/generate.py --check: the generated files match the pinned spec, and the headers check that CI runs passes
  • python -m pytest tests/ -q on Python 3.10, 3.11, 3.12, 3.13 and 3.14: 305 passed on each
  • python -m build, python -m twine check --strict dist/*: passed; the wheel installs in a clean venv and the smoke import passes

Not run locally

Nothing.

🤖 Generated with Claude Code

- New team.members.remove(user_id) removes a non-Owner member from the
  team and returns a MessageResponse. It uses the team token and sends
  no Idempotency-Key header. A 409 raises ConflictError with the error
  code.
- team.members.list() and team.members.iterate() pass the new
  filter[project_id] query, which returns only the members who can
  access that project: members with access to all projects and members
  selected for it.
- Remove the pending list, so the coverage test checks every operation
  again.
- Document both in the README and test the request, the token, the user
  ID checks, the 409 and the filter on every page.

Co-Authored-By: Claude <noreply@anthropic.com>
@bjarn
bjarn requested a review from a team as a code owner October 20, 2026 20:47
@bjarn
bjarn added this pull request to stack #43 October 20, 2026 20:47
@bjarn
bjarn merged commit d3b18cd into main Oct 21, 2026
7 checks passed
@bjarn
bjarn deleted the feat/team-member-removal branch October 21, 2026 16:10
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.

2 participants