Skip to content

Commit

Permalink
[gitpod-protocol] add missing method in golang
Browse files Browse the repository at this point in the history
  • Loading branch information
mustard-mh committed Aug 24, 2022
1 parent ade5876 commit bd58d64
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
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.

0 comments on commit bd58d64

Please sign in to comment.