Browse Source

Add RemoveUser()

main
Sam 5 years ago
parent
commit
597feee008
  1. 13
      team.go
  2. 1
      types.go

13
team.go

@ -43,6 +43,19 @@ func (t Team) AddUser(user, role string) (TeamAPI, error) { @@ -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{

1
types.go

@ -374,6 +374,7 @@ type tOptions struct { @@ -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"`

Loading…
Cancel
Save