Skip to content

[gitpod-protocol] Add support for getTeams to golang client #14300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type APIInterface interface {
TrackEvent(ctx context.Context, event *RemoteTrackMessage) (err error)
GetSupportedWorkspaceClasses(ctx context.Context) (res []*SupportedWorkspaceClass, err error)

GetTeams(ctx context.Context) ([]*Team, error)
CreateTeam(ctx context.Context, teamName string) (*Team, error)
GetTeamMembers(ctx context.Context, teamID string) ([]*TeamMemberInfo, error)
JoinTeam(ctx context.Context, teamID string) (*Team, error)
Expand Down Expand Up @@ -209,6 +210,8 @@ const (
// FunctionGetSupportedWorkspaceClasses is the name of the getSupportedWorkspaceClasses function
FunctionGetSupportedWorkspaceClasses FunctionName = "getSupportedWorkspaceClasses"

// FunctionGetTeams is the name of the getTeams function
FunctionGetTeams FunctionName = "getTeams"
// FunctionCreateTeam is the name of the createTeam function
FunctionCreateTeam FunctionName = "createTeam"
// FunctionJoinTeam is the name of the joinTeam function
Expand Down Expand Up @@ -1396,6 +1399,16 @@ func (gp *APIoverJSONRPC) GetSupportedWorkspaceClasses(ctx context.Context) (res
return
}

func (gp *APIoverJSONRPC) GetTeams(ctx context.Context) (res []*Team, err error) {
if gp == nil {
err = errNotConnected
return
}
_params := []interface{}{}
err = gp.C.Call(ctx, string(FunctionGetTeams), _params, &res)
return
}

func (gp *APIoverJSONRPC) CreateTeam(ctx context.Context, teamName string) (res *Team, err error) {
if gp == nil {
err = errNotConnected
Expand Down
15 changes: 15 additions & 0 deletions components/gitpod-protocol/go/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.