Skip to content
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

[gitpod-protocol] add missing method in golang #12354

Merged
merged 1 commit into from
Aug 25, 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
23 changes: 23 additions & 0 deletions components/gitpod-protocol/go/gitpod-service.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type APIInterface interface {
GetLayout(ctx context.Context, workspaceID string) (res string, err error)
GuessGitTokenScopes(ctx context.Context, params *GuessGitTokenScopesParams) (res *GuessedGitTokenScopes, err error)
TrackEvent(ctx context.Context, event *RemoteTrackMessage) (err error)
GetSupportedWorkspaceClasses(ctx context.Context) (res []*SupportedWorkspaceClass, err error)

InstanceUpdates(ctx context.Context, instanceID string) (<-chan *WorkspaceInstance, error)
}
Expand Down Expand Up @@ -206,6 +207,8 @@ const (
FunctionGuessGitTokenScope FunctionName = "guessGitTokenScopes"
// FunctionTrackEvent is the name of the trackEvent function
FunctionTrackEvent FunctionName = "trackEvent"
// FunctionGetSupportedWorkspaceClasses is the name of the getSupportedWorkspaceClasses function
FunctionGetSupportedWorkspaceClasses FunctionName = "getSupportedWorkspaceClasses"

// FunctionOnInstanceUpdate is the name of the onInstanceUpdate callback function
FunctionOnInstanceUpdate = "onInstanceUpdate"
Expand Down Expand Up @@ -1434,6 +1437,16 @@ func (gp *APIoverJSONRPC) TrackEvent(ctx context.Context, params *RemoteTrackMes
return
}

func (gp *APIoverJSONRPC) GetSupportedWorkspaceClasses(ctx context.Context) (res []*SupportedWorkspaceClass, err error) {
if gp == nil {
err = errNotConnected
return
}
_params := []interface{}{}
err = gp.C.Call(ctx, "getSupportedWorkspaceClasses", _params, &res)
return
}

// PermissionName is the name of a permission
type PermissionName string

Expand Down Expand Up @@ -1937,6 +1950,16 @@ type GuessedGitTokenScopes struct {
Message string `json:"message,omitempty"`
}

// SupportedWorkspaceClass is the GetSupportedWorkspaceClasses message type
type SupportedWorkspaceClass struct {
ID string `json:"id,omitempty"`
Category string `json:"category,omitempty"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description,omitempty"`
Powerups int `json:"powerups,omitempty"`
IsDefault bool `json:"isDefault,omitempty"`
}

type RemoteTrackMessage struct {
Event string `json:"event,omitempty"`
Properties interface{} `json:"properties,omitempty"`
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.

1 change: 1 addition & 0 deletions components/server/src/workspace/workspace-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,7 @@ export class WorkspaceStarter {
"function:addSSHPublicKey",
"function:deleteSSHPublicKey",
"function:trackEvent",
"function:getSupportedWorkspaceClasses",

"resource:" +
ScopedResourceGuard.marshalResourceScope({
Expand Down