Skip to content

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

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. Stacked on the team role management PR.

  • Team.Members.Remove(ctx, userID, ...RequestOption) (*MessageResponse, error) sends DELETE /team/members/{userId} and removes a member from the team. It needs a team token. The Owner can't be removed; the 409 is a *ConflictError with the code (for example owner_protected). An empty user ID is rejected before a request.
  • Team.Members.List and Team.Members.Iterate already take *ListTeamMembersQuery, which now has FilterProjectID (filter[project_id]). It returns only the members who can access that project: members with access to all projects and members selected for it. An unknown project returns an empty list. Iterate keeps the filter on every page. This PR adds the tests and docs; no code change was needed.
  • This PR removes the pending list from the coverage test, so TestEveryOperationHasAMethod is strict again: every one of the 71 operations needs a method.
  • README: Remove in the Team API table, and the project filter with an example.

Usage

for member, err := range client.Team.Members.Iterate(ctx, &lettermint.ListTeamMembersQuery{FilterProjectID: "project-id"}) {
	if err != nil {
		return err
	}
	fmt.Println(member.Email)
}

_, err = client.Team.Members.Remove(ctx, "user-id")

Checks

Run on this branch (the top of the stack) with GOFLAGS=-buildvcs=false (worktree):

  • test -z "$(gofmt -l .)": passes
  • go vet ./...: passes
  • sh scripts/generate.sh --check: passes (generated files up to date; the header check that CI runs also passes)
  • go test -race -coverprofile=coverage.out ./...: passes (coverage 94.4%)
  • go build ./...: passes
  • go mod tidy && git diff --exit-code go.mod: no changes
  • go vet, go test -race and go build with Go 1.24.13, 1.26.4 and 1.27.1: pass
  • gorelease -base=v3.1.0: the changes of this stack are all compatible; the one incompatible change it reports (SendBatchMailRequest) is already on main (see the first PR). Against current main (gorelease -base=github.com/lettermint/lettermint-go/v3@8982ddb): only compatible changes.

Not run locally

  • The Codecov upload.

🤖 Generated with Claude Code

Add Team.Members.Remove to remove a non-Owner member from the team. The
member list (Team.Members.List and Iterate) takes FilterProjectID to
return only the members who can access a project.

The coverage test is strict again: every operation needs a method.

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