From 597feee0080ea2f187d8e63d346398fb614e41de Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 1 Aug 2019 17:00:48 -0400 Subject: [PATCH] Add RemoveUser() --- team.go | 13 +++++++++++++ types.go | 1 + 2 files changed, 14 insertions(+) diff --git a/team.go b/team.go index 89a970b..519406c 100644 --- a/team.go +++ b/team.go @@ -43,6 +43,19 @@ func (t Team) AddUser(user, role string) (TeamAPI, error) { return r, err } +// RemoveUser removes a member from a team +func (t Team) RemoveUser(user string) (TeamAPI, error) { + m := TeamAPI{ + Params: &tParams{}, + } + m.Method = "remove-member" + m.Params.Options.Team = t.Name + m.Params.Options.Username = user + + r, err := teamAPIOut(t.keybase.Path, m) + return r, err +} + // AddReaders adds members to a team by username, and sets their roles to Reader func (t Team) AddReaders(users ...string) (TeamAPI, error) { m := TeamAPI{ diff --git a/types.go b/types.go index 697dddb..f681bdb 100644 --- a/types.go +++ b/types.go @@ -374,6 +374,7 @@ type tOptions struct { Team string `json:"team"` Emails []emails `json:"emails"` Usernames []usernames `json:"usernames"` + Username string `json:"username"` } type tParams struct { Options tOptions `json:"options"`