Path: blob/main/components/gitpod-protocol/go/gitpod-service.go
2498 views
// Copyright (c) 2020 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34//go:generate ./generate-mock.sh56package protocol78import (9"context"10"encoding/json"11"errors"12"fmt"13"io"14"net/http"15"sync"16"time"1718"github.com/sourcegraph/jsonrpc2"1920"github.com/sirupsen/logrus"21)2223// APIInterface wraps the24type APIInterface interface {25io.Closer2627GetOwnerToken(ctx context.Context, workspaceID string) (res string, err error)28AdminBlockUser(ctx context.Context, req *AdminBlockUserRequest) (err error)29GetLoggedInUser(ctx context.Context) (res *User, err error)30UpdateLoggedInUser(ctx context.Context, user *User) (res *User, err error)31GetAuthProviders(ctx context.Context) (res []*AuthProviderInfo, err error)32GetOwnAuthProviders(ctx context.Context) (res []*AuthProviderEntry, err error)33UpdateOwnAuthProvider(ctx context.Context, params *UpdateOwnAuthProviderParams) (err error)34DeleteOwnAuthProvider(ctx context.Context, params *DeleteOwnAuthProviderParams) (err error)35GetConfiguration(ctx context.Context) (res *Configuration, err error)36GetGitpodTokenScopes(ctx context.Context, tokenHash string) (res []string, err error)37GetToken(ctx context.Context, query *GetTokenSearchOptions) (res *Token, err error)38DeleteAccount(ctx context.Context) (err error)39GetClientRegion(ctx context.Context) (res string, err error)40GetWorkspaces(ctx context.Context, options *GetWorkspacesOptions) (res []*WorkspaceInfo, err error)41GetWorkspaceOwner(ctx context.Context, workspaceID string) (res *UserInfo, err error)42GetWorkspaceUsers(ctx context.Context, workspaceID string) (res []*WorkspaceInstanceUser, err error)43GetWorkspace(ctx context.Context, id string) (res *WorkspaceInfo, err error)44GetIDEOptions(ctx context.Context) (res *IDEOptions, err error)45IsWorkspaceOwner(ctx context.Context, workspaceID string) (res bool, err error)46CreateWorkspace(ctx context.Context, options *CreateWorkspaceOptions) (res *WorkspaceCreationResult, err error)47StartWorkspace(ctx context.Context, id string, options *StartWorkspaceOptions) (res *StartWorkspaceResult, err error)48StopWorkspace(ctx context.Context, id string) (err error)49DeleteWorkspace(ctx context.Context, id string) (err error)50SetWorkspaceDescription(ctx context.Context, id string, desc string) (err error)51ControlAdmission(ctx context.Context, id string, level *AdmissionLevel) (err error)52UpdateWorkspaceUserPin(ctx context.Context, id string, action *PinAction) (err error)53SendHeartBeat(ctx context.Context, options *SendHeartBeatOptions) (err error)54WatchWorkspaceImageBuildLogs(ctx context.Context, workspaceID string) (err error)55IsPrebuildDone(ctx context.Context, pwsid string) (res bool, err error)56SetWorkspaceTimeout(ctx context.Context, workspaceID string, duration time.Duration) (res *SetWorkspaceTimeoutResult, err error)57GetWorkspaceTimeout(ctx context.Context, workspaceID string) (res *GetWorkspaceTimeoutResult, err error)58GetOpenPorts(ctx context.Context, workspaceID string) (res []*WorkspaceInstancePort, err error)59OpenPort(ctx context.Context, workspaceID string, port *WorkspaceInstancePort) (res *WorkspaceInstancePort, err error)60ClosePort(ctx context.Context, workspaceID string, port float32) (err error)61UpdateGitStatus(ctx context.Context, workspaceID string, status *WorkspaceInstanceRepoStatus) (err error)62GetWorkspaceEnvVars(ctx context.Context, workspaceID string) (res []*EnvVar, err error)63SetEnvVar(ctx context.Context, variable *UserEnvVarValue) (err error)64DeleteEnvVar(ctx context.Context, variable *UserEnvVarValue) (err error)65HasSSHPublicKey(ctx context.Context) (res bool, err error)66GetSSHPublicKeys(ctx context.Context) (res []*UserSSHPublicKeyValue, err error)67AddSSHPublicKey(ctx context.Context, value *SSHPublicKeyValue) (res *UserSSHPublicKeyValue, err error)68DeleteSSHPublicKey(ctx context.Context, id string) (err error)69GetGitpodTokens(ctx context.Context) (res []*APIToken, err error)70GenerateNewGitpodToken(ctx context.Context, options *GenerateNewGitpodTokenOptions) (res string, err error)71DeleteGitpodToken(ctx context.Context, tokenHash string) (err error)72RegisterGithubApp(ctx context.Context, installationID string) (err error)73TakeSnapshot(ctx context.Context, options *TakeSnapshotOptions) (res string, err error)74WaitForSnapshot(ctx context.Context, snapshotId string) (err error)75GetSnapshots(ctx context.Context, workspaceID string) (res []*string, err error)76GuessGitTokenScopes(ctx context.Context, params *GuessGitTokenScopesParams) (res *GuessedGitTokenScopes, err error)77TrackEvent(ctx context.Context, event *RemoteTrackMessage) (err error)78GetSupportedWorkspaceClasses(ctx context.Context) (res []*SupportedWorkspaceClass, err error)7980// Teams81GetTeam(ctx context.Context, teamID string) (*Team, error)82GetTeams(ctx context.Context) ([]*Team, error)83CreateTeam(ctx context.Context, teamName string) (*Team, error)84DeleteTeam(ctx context.Context, teamID string) error85GetTeamMembers(ctx context.Context, teamID string) ([]*TeamMemberInfo, error)86JoinTeam(ctx context.Context, teamID string) (*Team, error)87GetGenericInvite(ctx context.Context, teamID string) (*TeamMembershipInvite, error)88ResetGenericInvite(ctx context.Context, teamID string) (*TeamMembershipInvite, error)89SetTeamMemberRole(ctx context.Context, teamID, userID string, role TeamMemberRole) error90RemoveTeamMember(ctx context.Context, teamID, userID string) error9192// Organization93GetOrgSettings(ctx context.Context, orgID string) (*OrganizationSettings, error)9495GetDefaultWorkspaceImage(ctx context.Context, params *GetDefaultWorkspaceImageParams) (res *GetDefaultWorkspaceImageResult, err error)9697// Projects98CreateProject(ctx context.Context, options *CreateProjectOptions) (*Project, error)99DeleteProject(ctx context.Context, projectID string) error100GetTeamProjects(ctx context.Context, teamID string) ([]*Project, error)101102WorkspaceUpdates(ctx context.Context, workspaceID string) (<-chan *WorkspaceInstance, error)103104// GetIDToken doesn't actually do anything, it just authorises105GetIDToken(ctx context.Context) (err error)106}107108// FunctionName is the name of an RPC function109type FunctionName string110111const (112// FunctionGetOwnerToken is the name of the getOwnerToken function113FunctionGetOwnerToken FunctionName = "getOwnerToken"114// FunctionAdminBlockUser is the name of the adminBlockUser function115FunctionAdminBlockUser FunctionName = "adminBlockUser"116// FunctionGetLoggedInUser is the name of the getLoggedInUser function117FunctionGetLoggedInUser FunctionName = "getLoggedInUser"118// FunctionUpdateLoggedInUser is the name of the updateLoggedInUser function119FunctionUpdateLoggedInUser FunctionName = "updateLoggedInUser"120// FunctionGetAuthProviders is the name of the getAuthProviders function121FunctionGetAuthProviders FunctionName = "getAuthProviders"122// FunctionGetOwnAuthProviders is the name of the getOwnAuthProviders function123FunctionGetOwnAuthProviders FunctionName = "getOwnAuthProviders"124// FunctionUpdateOwnAuthProvider is the name of the updateOwnAuthProvider function125FunctionUpdateOwnAuthProvider FunctionName = "updateOwnAuthProvider"126// FunctionDeleteOwnAuthProvider is the name of the deleteOwnAuthProvider function127FunctionDeleteOwnAuthProvider FunctionName = "deleteOwnAuthProvider"128// FunctionGetConfiguration is the name of the getConfiguration function129FunctionGetConfiguration FunctionName = "getConfiguration"130// FunctionGetGitpodTokenScopes is the name of the GetGitpodTokenScopes function131FunctionGetGitpodTokenScopes FunctionName = "getGitpodTokenScopes"132// FunctionGetToken is the name of the getToken function133FunctionGetToken FunctionName = "getToken"134// FunctionDeleteAccount is the name of the deleteAccount function135FunctionDeleteAccount FunctionName = "deleteAccount"136// FunctionGetClientRegion is the name of the getClientRegion function137FunctionGetClientRegion FunctionName = "getClientRegion"138// FunctionGetWorkspaces is the name of the getWorkspaces function139FunctionGetWorkspaces FunctionName = "getWorkspaces"140// FunctionGetWorkspaceOwner is the name of the getWorkspaceOwner function141FunctionGetWorkspaceOwner FunctionName = "getWorkspaceOwner"142// FunctionGetWorkspaceUsers is the name of the getWorkspaceUsers function143FunctionGetWorkspaceUsers FunctionName = "getWorkspaceUsers"144// FunctionGetWorkspace is the name of the getWorkspace function145FunctionGetWorkspace FunctionName = "getWorkspace"146// FunctionGetIDEOptions is the name of the getIDEOptions function147FunctionGetIDEOptions FunctionName = "getIDEOptions"148// FunctionIsWorkspaceOwner is the name of the isWorkspaceOwner function149FunctionIsWorkspaceOwner FunctionName = "isWorkspaceOwner"150// FunctionCreateWorkspace is the name of the createWorkspace function151FunctionCreateWorkspace FunctionName = "createWorkspace"152// FunctionStartWorkspace is the name of the startWorkspace function153FunctionStartWorkspace FunctionName = "startWorkspace"154// FunctionStopWorkspace is the name of the stopWorkspace function155FunctionStopWorkspace FunctionName = "stopWorkspace"156// FunctionDeleteWorkspace is the name of the deleteWorkspace function157FunctionDeleteWorkspace FunctionName = "deleteWorkspace"158// FunctionSetWorkspaceDescription is the name of the setWorkspaceDescription function159FunctionSetWorkspaceDescription FunctionName = "setWorkspaceDescription"160// FunctionControlAdmission is the name of the controlAdmission function161FunctionControlAdmission FunctionName = "controlAdmission"162// FunctionUpdateWorkspaceUserPin is the name of the updateWorkspaceUserPin function163FunctionUpdateWorkspaceUserPin FunctionName = "updateWorkspaceUserPin"164// FunctionSendHeartBeat is the name of the sendHeartBeat function165FunctionSendHeartBeat FunctionName = "sendHeartBeat"166// FunctionWatchWorkspaceImageBuildLogs is the name of the watchWorkspaceImageBuildLogs function167FunctionWatchWorkspaceImageBuildLogs FunctionName = "watchWorkspaceImageBuildLogs"168// FunctionIsPrebuildDone is the name of the isPrebuildDone function169FunctionIsPrebuildDone FunctionName = "isPrebuildDone"170// FunctionSetWorkspaceTimeout is the name of the setWorkspaceTimeout function171FunctionSetWorkspaceTimeout FunctionName = "setWorkspaceTimeout"172// FunctionGetWorkspaceTimeout is the name of the getWorkspaceTimeout function173FunctionGetWorkspaceTimeout FunctionName = "getWorkspaceTimeout"174// FunctionGetOpenPorts is the name of the getOpenPorts function175FunctionGetOpenPorts FunctionName = "getOpenPorts"176// FunctionOpenPort is the name of the openPort function177FunctionOpenPort FunctionName = "openPort"178// FunctionClosePort is the name of the closePort function179FunctionClosePort FunctionName = "closePort"180// FunctionSetEnvVar is the name of the setEnvVar function181FunctionSetEnvVar FunctionName = "setEnvVar"182// FunctionDeleteEnvVar is the name of the deleteEnvVar function183FunctionDeleteEnvVar FunctionName = "deleteEnvVar"184// FunctionHasSSHPublicKey is the name of the hasSSHPublicKey function185FunctionHasSSHPublicKey FunctionName = "hasSSHPublicKey"186// FunctionGetSSHPublicKeys is the name of the getSSHPublicKeys function187FunctionGetSSHPublicKeys FunctionName = "getSSHPublicKeys"188// FunctionAddSSHPublicKey is the name of the addSSHPublicKey function189FunctionAddSSHPublicKey FunctionName = "addSSHPublicKey"190// FunctionDeleteSSHPublicKey is the name of the deleteSSHPublicKey function191FunctionDeleteSSHPublicKey FunctionName = "deleteSSHPublicKey"192// FunctionGetGitpodTokens is the name of the getGitpodTokens function193FunctionGetGitpodTokens FunctionName = "getGitpodTokens"194// FunctionGenerateNewGitpodToken is the name of the generateNewGitpodToken function195FunctionGenerateNewGitpodToken FunctionName = "generateNewGitpodToken"196// FunctionDeleteGitpodToken is the name of the deleteGitpodToken function197FunctionDeleteGitpodToken FunctionName = "deleteGitpodToken"198// FunctionRegisterGithubApp is the name of the registerGithubApp function199FunctionRegisterGithubApp FunctionName = "registerGithubApp"200// FunctionTakeSnapshot is the name of the takeSnapshot function201FunctionTakeSnapshot FunctionName = "takeSnapshot"202// FunctionGetSnapshots is the name of the getSnapshots function203FunctionGetSnapshots FunctionName = "getSnapshots"204// FunctionGuessGitTokenScopes is the name of the guessGitTokenScopes function205FunctionGuessGitTokenScope FunctionName = "guessGitTokenScopes"206// FunctionTrackEvent is the name of the trackEvent function207FunctionTrackEvent FunctionName = "trackEvent"208// FunctionGetSupportedWorkspaceClasses is the name of the getSupportedWorkspaceClasses function209FunctionGetSupportedWorkspaceClasses FunctionName = "getSupportedWorkspaceClasses"210211// Teams212// FunctionGetTeam is the name of the getTeam function213FunctionGetTeam FunctionName = "getTeam"214// FunctionGetTeams is the name of the getTeams function215FunctionGetTeams FunctionName = "getTeams"216// FunctionCreateTeam is the name of the createTeam function217FunctionCreateTeam FunctionName = "createTeam"218// FunctionJoinTeam is the name of the joinTeam function219FunctionJoinTeam FunctionName = "joinTeam"220// FunctionGetTeamMembers is the name of the getTeamMembers function221FunctionGetTeamMembers FunctionName = "getTeamMembers"222// FunctionGetGenericInvite is the name of the getGenericInvite function223FunctionGetGenericInvite FunctionName = "getGenericInvite"224// FunctionResetGenericInvite is the name of the resetGenericInvite function225FunctionResetGenericInvite FunctionName = "resetGenericInvite"226// FunctionSetTeamMemberRole is the name of the setTeamMemberRole function227FunctionSetTeamMemberRole FunctionName = "setTeamMemberRole"228// FunctionRemoveTeamMember is the name of the removeTeamMember function229FunctionRemoveTeamMember FunctionName = "removeTeamMember"230// FunctionDeleteTeam is the name of the deleteTeam function231FunctionDeleteTeam FunctionName = "deleteTeam"232233// Organizations234// FunctionGetOrgSettings is the name of the getOrgSettings function235FunctionGetOrgSettings FunctionName = "getOrgSettings"236237// FunctionGetDefaultWorkspaceImage is the name of the getDefaultWorkspaceImage function238FunctionGetDefaultWorkspaceImage FunctionName = "getDefaultWorkspaceImage"239240// Projects241FunctionCreateProject FunctionName = "createProject"242FunctionDeleteProject FunctionName = "deleteProject"243FunctionGetTeamProjects FunctionName = "getTeamProjects"244245// FunctionOnInstanceUpdate is the name of the onInstanceUpdate callback function246FunctionOnInstanceUpdate = "onInstanceUpdate"247248FunctionGetIDToken FunctionName = "getIDToken"249)250251var errNotConnected = errors.New("not connected to Gitpod server")252253// ConnectToServerOpts configures the server connection254type ConnectToServerOpts struct {255Context context.Context256Token string257Cookie string258Origin string259Log *logrus.Entry260ReconnectionHandler func()261CloseHandler func(error)262ExtraHeaders map[string]string263}264265// ConnectToServer establishes a new websocket connection to the server266func ConnectToServer(endpoint string, opts ConnectToServerOpts) (*APIoverJSONRPC, error) {267if opts.Context == nil {268opts.Context = context.Background()269}270271reqHeader := http.Header{}272reqHeader.Set("Origin", opts.Origin)273274for k, v := range opts.ExtraHeaders {275reqHeader.Set(k, v)276}277if opts.Token != "" {278reqHeader.Set("Authorization", "Bearer "+opts.Token)279}280281if opts.Cookie != "" {282reqHeader.Set("Cookie", opts.Cookie)283}284285ws := NewReconnectingWebsocket(endpoint, reqHeader, opts.Log)286ws.ReconnectionHandler = opts.ReconnectionHandler287go func() {288err := ws.Dial(opts.Context)289if opts.CloseHandler != nil {290opts.CloseHandler(err)291}292}()293294var res APIoverJSONRPC295res.log = opts.Log296res.C = jsonrpc2.NewConn(opts.Context, ws, jsonrpc2.HandlerWithError(res.handler))297return &res, nil298}299300// APIoverJSONRPC makes JSON RPC calls to the Gitpod server is the APIoverJSONRPC message type301type APIoverJSONRPC struct {302C jsonrpc2.JSONRPC2303log *logrus.Entry304305mu sync.RWMutex306workspaceSubs map[string]map[chan *WorkspaceInstance]struct{}307}308309// Close closes the connection310func (gp *APIoverJSONRPC) Close() (err error) {311if gp == nil {312err = errNotConnected313return314}315e1 := gp.C.Close()316if e1 != nil {317return e1318}319return nil320}321322// WorkspaceUpdates subscribes to workspace instance updates until the context is canceled323func (gp *APIoverJSONRPC) WorkspaceUpdates(ctx context.Context, workspaceID string) (<-chan *WorkspaceInstance, error) {324if gp == nil {325return nil, errNotConnected326}327chn := make(chan *WorkspaceInstance)328329gp.mu.Lock()330if gp.workspaceSubs == nil {331gp.workspaceSubs = make(map[string]map[chan *WorkspaceInstance]struct{})332}333if sub, ok := gp.workspaceSubs[workspaceID]; ok {334sub[chn] = struct{}{}335} else {336gp.workspaceSubs[workspaceID] = map[chan *WorkspaceInstance]struct{}{chn: {}}337}338gp.mu.Unlock()339340go func() {341<-ctx.Done()342343gp.mu.Lock()344delete(gp.workspaceSubs[workspaceID], chn)345close(chn)346gp.mu.Unlock()347}()348349return chn, nil350}351352func (gp *APIoverJSONRPC) handler(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) (result interface{}, err error) {353if gp == nil {354err = errNotConnected355return356}357if req.Method != FunctionOnInstanceUpdate {358return359}360361var instance WorkspaceInstance362err = json.Unmarshal(*req.Params, &instance)363if err != nil {364gp.log.WithError(err).WithField("raw", string(*req.Params)).Error("cannot unmarshal instance update")365return366}367368gp.mu.RLock()369defer gp.mu.RUnlock()370for chn := range gp.workspaceSubs[instance.WorkspaceID] {371select {372case chn <- &instance:373default:374}375}376for chn := range gp.workspaceSubs[""] {377select {378case chn <- &instance:379default:380}381}382383return384}385386func (gp *APIoverJSONRPC) GetOwnerToken(ctx context.Context, workspaceID string) (res string, err error) {387if gp == nil {388err = errNotConnected389return390}391var _params []interface{}392_params = append(_params, workspaceID)393394var _result string395err = gp.C.Call(ctx, "getOwnerToken", _params, &_result)396if err != nil {397return "", err398}399res = _result400return401}402403// AdminBlockUser calls adminBlockUser on the server404func (gp *APIoverJSONRPC) AdminBlockUser(ctx context.Context, message *AdminBlockUserRequest) (err error) {405if gp == nil {406err = errNotConnected407return408}409var _params []interface{}410_params = append(_params, message)411412var _result interface{}413err = gp.C.Call(ctx, "adminBlockUser", _params, &_result)414if err != nil {415return err416}417return418}419420// AdminVerifyUser calls adminVerifyUser on the server421func (gp *APIoverJSONRPC) AdminVerifyUser(ctx context.Context, userId string) (err error) {422if gp == nil {423err = errNotConnected424return425}426var _params []interface{}427_params = append(_params, userId)428429var _result interface{}430err = gp.C.Call(ctx, "adminVerifyUser", _params, &_result)431if err != nil {432return err433}434return435}436437// GetLoggedInUser calls getLoggedInUser on the server438func (gp *APIoverJSONRPC) GetLoggedInUser(ctx context.Context) (res *User, err error) {439if gp == nil {440err = errNotConnected441return442}443var _params []interface{}444445var result User446err = gp.C.Call(ctx, "getLoggedInUser", _params, &result)447if err != nil {448return449}450res = &result451452return453}454455// UpdateLoggedInUser calls updateLoggedInUser on the server456func (gp *APIoverJSONRPC) UpdateLoggedInUser(ctx context.Context, user *User) (res *User, err error) {457if gp == nil {458err = errNotConnected459return460}461var _params []interface{}462463_params = append(_params, user)464465var result User466err = gp.C.Call(ctx, "updateLoggedInUser", _params, &result)467if err != nil {468return469}470res = &result471472return473}474475// GetAuthProviders calls getAuthProviders on the server476func (gp *APIoverJSONRPC) GetAuthProviders(ctx context.Context) (res []*AuthProviderInfo, err error) {477if gp == nil {478err = errNotConnected479return480}481var _params []interface{}482483var result []*AuthProviderInfo484err = gp.C.Call(ctx, "getAuthProviders", _params, &result)485if err != nil {486return487}488res = result489490return491}492493// GetOwnAuthProviders calls getOwnAuthProviders on the server494func (gp *APIoverJSONRPC) GetOwnAuthProviders(ctx context.Context) (res []*AuthProviderEntry, err error) {495if gp == nil {496err = errNotConnected497return498}499var _params []interface{}500501var result []*AuthProviderEntry502err = gp.C.Call(ctx, "getOwnAuthProviders", _params, &result)503if err != nil {504return505}506res = result507508return509}510511// UpdateOwnAuthProvider calls updateOwnAuthProvider on the server512func (gp *APIoverJSONRPC) UpdateOwnAuthProvider(ctx context.Context, params *UpdateOwnAuthProviderParams) (err error) {513if gp == nil {514err = errNotConnected515return516}517var _params []interface{}518519_params = append(_params, params)520521err = gp.C.Call(ctx, "updateOwnAuthProvider", _params, nil)522if err != nil {523return524}525526return527}528529// DeleteOwnAuthProvider calls deleteOwnAuthProvider on the server530func (gp *APIoverJSONRPC) DeleteOwnAuthProvider(ctx context.Context, params *DeleteOwnAuthProviderParams) (err error) {531if gp == nil {532err = errNotConnected533return534}535var _params []interface{}536537_params = append(_params, params)538539err = gp.C.Call(ctx, "deleteOwnAuthProvider", _params, nil)540if err != nil {541return542}543544return545}546547// GetConfiguration calls getConfiguration on the server548func (gp *APIoverJSONRPC) GetConfiguration(ctx context.Context) (res *Configuration, err error) {549if gp == nil {550err = errNotConnected551return552}553var _params []interface{}554555var result Configuration556err = gp.C.Call(ctx, "getConfiguration", _params, &result)557if err != nil {558return559}560res = &result561562return563}564565// GetGitpodTokenScopes calls getGitpodTokenScopes on the server566func (gp *APIoverJSONRPC) GetGitpodTokenScopes(ctx context.Context, tokenHash string) (res []string, err error) {567if gp == nil {568err = errNotConnected569return570}571var _params []interface{}572573_params = append(_params, tokenHash)574575var result []string576err = gp.C.Call(ctx, "getGitpodTokenScopes", _params, &result)577if err != nil {578return579}580res = result581582return583}584585// GetToken calls getToken on the server586func (gp *APIoverJSONRPC) GetToken(ctx context.Context, query *GetTokenSearchOptions) (res *Token, err error) {587if gp == nil {588err = errNotConnected589return590}591var _params []interface{}592593_params = append(_params, query)594595var result Token596err = gp.C.Call(ctx, "getToken", _params, &result)597if err != nil {598return599}600res = &result601602return603}604605// DeleteAccount calls deleteAccount on the server606func (gp *APIoverJSONRPC) DeleteAccount(ctx context.Context) (err error) {607if gp == nil {608err = errNotConnected609return610}611var _params []interface{}612613err = gp.C.Call(ctx, "deleteAccount", _params, nil)614if err != nil {615return616}617618return619}620621// GetClientRegion calls getClientRegion on the server622func (gp *APIoverJSONRPC) GetClientRegion(ctx context.Context) (res string, err error) {623if gp == nil {624err = errNotConnected625return626}627var _params []interface{}628629var result string630err = gp.C.Call(ctx, "getClientRegion", _params, &result)631if err != nil {632return633}634res = result635636return637}638639// GetWorkspaces calls getWorkspaces on the server640func (gp *APIoverJSONRPC) GetWorkspaces(ctx context.Context, options *GetWorkspacesOptions) (res []*WorkspaceInfo, err error) {641if gp == nil {642err = errNotConnected643return644}645var _params []interface{}646647_params = append(_params, options)648649var result []*WorkspaceInfo650err = gp.C.Call(ctx, "getWorkspaces", _params, &result)651if err != nil {652return653}654res = result655656return657}658659// GetWorkspaceOwner calls getWorkspaceOwner on the server660func (gp *APIoverJSONRPC) GetWorkspaceOwner(ctx context.Context, workspaceID string) (res *UserInfo, err error) {661if gp == nil {662err = errNotConnected663return664}665var _params []interface{}666667_params = append(_params, workspaceID)668669var result UserInfo670err = gp.C.Call(ctx, "getWorkspaceOwner", _params, &result)671if err != nil {672return673}674res = &result675676return677}678679// GetWorkspaceUsers calls getWorkspaceUsers on the server680func (gp *APIoverJSONRPC) GetWorkspaceUsers(ctx context.Context, workspaceID string) (res []*WorkspaceInstanceUser, err error) {681if gp == nil {682err = errNotConnected683return684}685var _params []interface{}686687_params = append(_params, workspaceID)688689var result []*WorkspaceInstanceUser690err = gp.C.Call(ctx, "getWorkspaceUsers", _params, &result)691if err != nil {692return693}694res = result695696return697}698699// GetWorkspace calls getWorkspace on the server700func (gp *APIoverJSONRPC) GetWorkspace(ctx context.Context, id string) (res *WorkspaceInfo, err error) {701if gp == nil {702err = errNotConnected703return704}705var _params []interface{}706707_params = append(_params, id)708709var result WorkspaceInfo710err = gp.C.Call(ctx, "getWorkspace", _params, &result)711if err != nil {712return713}714res = &result715716return717}718719// GetIDEOptions calls getIDEOptions on the server720func (gp *APIoverJSONRPC) GetIDEOptions(ctx context.Context) (res *IDEOptions, err error) {721if gp == nil {722err = errNotConnected723return724}725var _params []interface{}726727var result IDEOptions728err = gp.C.Call(ctx, "getIDEOptions", _params, &result)729if err != nil {730return731}732733res = &result734735return736}737738// IsWorkspaceOwner calls isWorkspaceOwner on the server739func (gp *APIoverJSONRPC) IsWorkspaceOwner(ctx context.Context, workspaceID string) (res bool, err error) {740if gp == nil {741err = errNotConnected742return743}744var _params []interface{}745746_params = append(_params, workspaceID)747748var result bool749err = gp.C.Call(ctx, "isWorkspaceOwner", _params, &result)750if err != nil {751return752}753res = result754755return756}757758// CreateWorkspace calls createWorkspace on the server759func (gp *APIoverJSONRPC) CreateWorkspace(ctx context.Context, options *CreateWorkspaceOptions) (res *WorkspaceCreationResult, err error) {760if gp == nil {761err = errNotConnected762return763}764var _params []interface{}765766_params = append(_params, options)767768var result WorkspaceCreationResult769err = gp.C.Call(ctx, "createWorkspace", _params, &result)770if err != nil {771return772}773res = &result774775return776}777778// StartWorkspace calls startWorkspace on the server779func (gp *APIoverJSONRPC) StartWorkspace(ctx context.Context, id string, options *StartWorkspaceOptions) (res *StartWorkspaceResult, err error) {780if gp == nil {781err = errNotConnected782return783}784var _params []interface{}785786_params = append(_params, id)787_params = append(_params, options)788789var result StartWorkspaceResult790err = gp.C.Call(ctx, "startWorkspace", _params, &result)791if err != nil {792return793}794res = &result795796return797}798799// StopWorkspace calls stopWorkspace on the server800func (gp *APIoverJSONRPC) StopWorkspace(ctx context.Context, id string) (err error) {801if gp == nil {802err = errNotConnected803return804}805var _params []interface{}806807_params = append(_params, id)808809err = gp.C.Call(ctx, "stopWorkspace", _params, nil)810if err != nil {811return812}813814return815}816817// DeleteWorkspace calls deleteWorkspace on the server818func (gp *APIoverJSONRPC) DeleteWorkspace(ctx context.Context, id string) (err error) {819if gp == nil {820err = errNotConnected821return822}823var _params []interface{}824825_params = append(_params, id)826827err = gp.C.Call(ctx, "deleteWorkspace", _params, nil)828if err != nil {829return830}831832return833}834835// SetWorkspaceDescription calls setWorkspaceDescription on the server836func (gp *APIoverJSONRPC) SetWorkspaceDescription(ctx context.Context, id string, desc string) (err error) {837if gp == nil {838err = errNotConnected839return840}841var _params []interface{}842843_params = append(_params, id)844_params = append(_params, desc)845846err = gp.C.Call(ctx, "setWorkspaceDescription", _params, nil)847if err != nil {848return849}850851return852}853854// ControlAdmission calls controlAdmission on the server855func (gp *APIoverJSONRPC) ControlAdmission(ctx context.Context, id string, level *AdmissionLevel) (err error) {856if gp == nil {857err = errNotConnected858return859}860var _params []interface{}861862_params = append(_params, id)863_params = append(_params, level)864865err = gp.C.Call(ctx, "controlAdmission", _params, nil)866if err != nil {867return868}869870return871}872873// WatchWorkspaceImageBuildLogs calls watchWorkspaceImageBuildLogs on the server874func (gp *APIoverJSONRPC) WatchWorkspaceImageBuildLogs(ctx context.Context, workspaceID string) (err error) {875if gp == nil {876err = errNotConnected877return878}879var _params []interface{}880881_params = append(_params, workspaceID)882883err = gp.C.Call(ctx, "watchWorkspaceImageBuildLogs", _params, nil)884if err != nil {885return886}887888return889}890891// IsPrebuildDone calls isPrebuildDone on the server892func (gp *APIoverJSONRPC) IsPrebuildDone(ctx context.Context, pwsid string) (res bool, err error) {893if gp == nil {894err = errNotConnected895return896}897var _params []interface{}898899_params = append(_params, pwsid)900901var result bool902err = gp.C.Call(ctx, "isPrebuildDone", _params, &result)903if err != nil {904return905}906res = result907908return909}910911// SetWorkspaceTimeout calls setWorkspaceTimeout on the server912func (gp *APIoverJSONRPC) SetWorkspaceTimeout(ctx context.Context, workspaceID string, duration time.Duration) (res *SetWorkspaceTimeoutResult, err error) {913if gp == nil {914err = errNotConnected915return916}917var _params []interface{}918919_params = append(_params, workspaceID)920_params = append(_params, fmt.Sprintf("%dm", int(duration.Minutes())))921922var result SetWorkspaceTimeoutResult923err = gp.C.Call(ctx, "setWorkspaceTimeout", _params, &result)924if err != nil {925return926}927res = &result928929return930}931932// GetWorkspaceTimeout calls getWorkspaceTimeout on the server933func (gp *APIoverJSONRPC) GetWorkspaceTimeout(ctx context.Context, workspaceID string) (res *GetWorkspaceTimeoutResult, err error) {934if gp == nil {935err = errNotConnected936return937}938var _params []interface{}939940_params = append(_params, workspaceID)941942var result GetWorkspaceTimeoutResult943err = gp.C.Call(ctx, "getWorkspaceTimeout", _params, &result)944if err != nil {945return946}947res = &result948949return950}951952// SendHeartBeat calls sendHeartBeat on the server953func (gp *APIoverJSONRPC) SendHeartBeat(ctx context.Context, options *SendHeartBeatOptions) (err error) {954if gp == nil {955err = errNotConnected956return957}958var _params []interface{}959960_params = append(_params, options)961962err = gp.C.Call(ctx, "sendHeartBeat", _params, nil)963if err != nil {964return965}966967return968}969970// UpdateWorkspaceUserPin calls updateWorkspaceUserPin on the server971func (gp *APIoverJSONRPC) UpdateWorkspaceUserPin(ctx context.Context, id string, action *PinAction) (err error) {972if gp == nil {973err = errNotConnected974return975}976var _params []interface{}977978_params = append(_params, id)979_params = append(_params, action)980981err = gp.C.Call(ctx, "updateWorkspaceUserPin", _params, nil)982if err != nil {983return984}985986return987}988989// GetOpenPorts calls getOpenPorts on the server990func (gp *APIoverJSONRPC) GetOpenPorts(ctx context.Context, workspaceID string) (res []*WorkspaceInstancePort, err error) {991if gp == nil {992err = errNotConnected993return994}995var _params []interface{}996997_params = append(_params, workspaceID)998999var result []*WorkspaceInstancePort1000err = gp.C.Call(ctx, "getOpenPorts", _params, &result)1001if err != nil {1002return1003}1004res = result10051006return1007}10081009// OpenPort calls openPort on the server1010func (gp *APIoverJSONRPC) OpenPort(ctx context.Context, workspaceID string, port *WorkspaceInstancePort) (res *WorkspaceInstancePort, err error) {1011if gp == nil {1012err = errNotConnected1013return1014}1015var _params []interface{}10161017_params = append(_params, workspaceID)1018_params = append(_params, port)10191020var result WorkspaceInstancePort1021err = gp.C.Call(ctx, "openPort", _params, &result)1022if err != nil {1023return1024}1025res = &result10261027return1028}10291030// ClosePort calls closePort on the server1031func (gp *APIoverJSONRPC) ClosePort(ctx context.Context, workspaceID string, port float32) (err error) {1032if gp == nil {1033err = errNotConnected1034return1035}1036var _params []interface{}10371038_params = append(_params, workspaceID)1039_params = append(_params, port)10401041err = gp.C.Call(ctx, "closePort", _params, nil)1042if err != nil {1043return1044}10451046return1047}10481049// UpdateGitStatus calls UpdateGitStatus on the server1050func (gp *APIoverJSONRPC) UpdateGitStatus(ctx context.Context, workspaceID string, status *WorkspaceInstanceRepoStatus) (err error) {1051if gp == nil {1052err = errNotConnected1053return1054}1055var _params []interface{}1056_params = append(_params, workspaceID)1057_params = append(_params, status)10581059err = gp.C.Call(ctx, "updateGitStatus", _params, nil)1060if err != nil {1061return1062}10631064return1065}10661067// GetWorkspaceEnvVars calls GetWorkspaceEnvVars on the server1068func (gp *APIoverJSONRPC) GetWorkspaceEnvVars(ctx context.Context, workspaceID string) (res []*EnvVar, err error) {1069if gp == nil {1070err = errNotConnected1071return1072}1073var _params []interface{}10741075_params = append(_params, workspaceID)10761077var result []*EnvVar1078err = gp.C.Call(ctx, "getWorkspaceEnvVars", _params, &result)1079if err != nil {1080return1081}1082res = result10831084return1085}10861087// SetEnvVar calls setEnvVar on the server1088func (gp *APIoverJSONRPC) SetEnvVar(ctx context.Context, variable *UserEnvVarValue) (err error) {1089if gp == nil {1090err = errNotConnected1091return1092}1093var _params []interface{}10941095_params = append(_params, variable)10961097err = gp.C.Call(ctx, "setEnvVar", _params, nil)1098if err != nil {1099return1100}11011102return1103}11041105// DeleteEnvVar calls deleteEnvVar on the server1106func (gp *APIoverJSONRPC) DeleteEnvVar(ctx context.Context, variable *UserEnvVarValue) (err error) {1107if gp == nil {1108err = errNotConnected1109return1110}1111var _params []interface{}11121113_params = append(_params, variable)11141115err = gp.C.Call(ctx, "deleteEnvVar", _params, nil)1116if err != nil {1117return1118}11191120return1121}11221123// HasSSHPublicKey calls hasSSHPublicKey on the server1124func (gp *APIoverJSONRPC) HasSSHPublicKey(ctx context.Context) (res bool, err error) {1125if gp == nil {1126err = errNotConnected1127return1128}1129var _params []interface{}1130err = gp.C.Call(ctx, "hasSSHPublicKey", _params, &res)1131return1132}11331134// GetSSHPublicKeys calls getSSHPublicKeys on the server1135func (gp *APIoverJSONRPC) GetSSHPublicKeys(ctx context.Context) (res []*UserSSHPublicKeyValue, err error) {1136if gp == nil {1137err = errNotConnected1138return1139}1140var _params []interface{}1141err = gp.C.Call(ctx, "getSSHPublicKeys", _params, &res)1142return1143}11441145// AddSSHPublicKey calls addSSHPublicKey on the server1146func (gp *APIoverJSONRPC) AddSSHPublicKey(ctx context.Context, value *SSHPublicKeyValue) (res *UserSSHPublicKeyValue, err error) {1147if gp == nil {1148err = errNotConnected1149return1150}1151_params := []interface{}{value}1152err = gp.C.Call(ctx, "addSSHPublicKey", _params, &res)1153return1154}11551156// DeleteSSHPublicKey calls deleteSSHPublicKey on the server1157func (gp *APIoverJSONRPC) DeleteSSHPublicKey(ctx context.Context, id string) (err error) {1158if gp == nil {1159err = errNotConnected1160return1161}1162_params := []interface{}{id}1163err = gp.C.Call(ctx, "deleteSSHPublicKey", _params, nil)1164return1165}11661167// GetGitpodTokens calls getGitpodTokens on the server1168func (gp *APIoverJSONRPC) GetGitpodTokens(ctx context.Context) (res []*APIToken, err error) {1169if gp == nil {1170err = errNotConnected1171return1172}1173var _params []interface{}11741175var result []*APIToken1176err = gp.C.Call(ctx, "getGitpodTokens", _params, &result)1177if err != nil {1178return1179}1180res = result11811182return1183}11841185// GenerateNewGitpodToken calls generateNewGitpodToken on the server1186func (gp *APIoverJSONRPC) GenerateNewGitpodToken(ctx context.Context, options *GenerateNewGitpodTokenOptions) (res string, err error) {1187if gp == nil {1188err = errNotConnected1189return1190}1191var _params []interface{}11921193_params = append(_params, options)11941195var result string1196err = gp.C.Call(ctx, "generateNewGitpodToken", _params, &result)1197if err != nil {1198return1199}1200res = result12011202return1203}12041205// DeleteGitpodToken calls deleteGitpodToken on the server1206func (gp *APIoverJSONRPC) DeleteGitpodToken(ctx context.Context, tokenHash string) (err error) {1207if gp == nil {1208err = errNotConnected1209return1210}1211var _params []interface{}12121213_params = append(_params, tokenHash)12141215err = gp.C.Call(ctx, "deleteGitpodToken", _params, nil)1216if err != nil {1217return1218}12191220return1221}12221223// RegisterGithubApp calls registerGithubApp on the server1224func (gp *APIoverJSONRPC) RegisterGithubApp(ctx context.Context, installationID string) (err error) {1225if gp == nil {1226err = errNotConnected1227return1228}1229var _params []interface{}12301231_params = append(_params, installationID)12321233err = gp.C.Call(ctx, "registerGithubApp", _params, nil)1234if err != nil {1235return1236}12371238return1239}12401241// TakeSnapshot calls takeSnapshot on the server1242func (gp *APIoverJSONRPC) TakeSnapshot(ctx context.Context, options *TakeSnapshotOptions) (res string, err error) {1243if gp == nil {1244err = errNotConnected1245return1246}1247var _params []interface{}12481249_params = append(_params, options)12501251var result string1252err = gp.C.Call(ctx, "takeSnapshot", _params, &result)1253if err != nil {1254return1255}1256res = result12571258return1259}12601261// WaitForSnapshot calls waitForSnapshot on the server1262func (gp *APIoverJSONRPC) WaitForSnapshot(ctx context.Context, snapshotId string) (err error) {1263if gp == nil {1264err = errNotConnected1265return1266}1267var _params []interface{}12681269_params = append(_params, snapshotId)12701271var result string1272err = gp.C.Call(ctx, "waitForSnapshot", _params, &result)1273return1274}12751276// GetSnapshots calls getSnapshots on the server1277func (gp *APIoverJSONRPC) GetSnapshots(ctx context.Context, workspaceID string) (res []*string, err error) {1278if gp == nil {1279err = errNotConnected1280return1281}1282var _params []interface{}12831284_params = append(_params, workspaceID)12851286var result []*string1287err = gp.C.Call(ctx, "getSnapshots", _params, &result)1288if err != nil {1289return1290}1291res = result12921293return1294}12951296// GuessGitTokenScopes calls GuessGitTokenScopes on the server1297func (gp *APIoverJSONRPC) GuessGitTokenScopes(ctx context.Context, params *GuessGitTokenScopesParams) (res *GuessedGitTokenScopes, err error) {1298if gp == nil {1299err = errNotConnected1300return1301}1302var _params []interface{}13031304_params = append(_params, params)13051306var result GuessedGitTokenScopes1307err = gp.C.Call(ctx, "guessGitTokenScopes", _params, &result)1308if err != nil {1309return1310}1311res = &result13121313return1314}13151316// TrackEvent calls trackEvent on the server1317func (gp *APIoverJSONRPC) TrackEvent(ctx context.Context, params *RemoteTrackMessage) (err error) {1318if gp == nil {1319err = errNotConnected1320return1321}1322var _params []interface{}13231324_params = append(_params, params)1325err = gp.C.Call(ctx, "trackEvent", _params, nil)1326return1327}13281329func (gp *APIoverJSONRPC) GetSupportedWorkspaceClasses(ctx context.Context) (res []*SupportedWorkspaceClass, err error) {1330if gp == nil {1331err = errNotConnected1332return1333}1334_params := []interface{}{}1335err = gp.C.Call(ctx, "getSupportedWorkspaceClasses", _params, &res)1336return1337}13381339func (gp *APIoverJSONRPC) GetTeam(ctx context.Context, teamID string) (res *Team, err error) {1340if gp == nil {1341err = errNotConnected1342return1343}1344_params := []interface{}{teamID}1345err = gp.C.Call(ctx, string(FunctionGetTeam), _params, &res)1346return1347}13481349func (gp *APIoverJSONRPC) GetTeams(ctx context.Context) (res []*Team, err error) {1350if gp == nil {1351err = errNotConnected1352return1353}1354_params := []interface{}{}1355err = gp.C.Call(ctx, string(FunctionGetTeams), _params, &res)1356return1357}13581359func (gp *APIoverJSONRPC) CreateTeam(ctx context.Context, teamName string) (res *Team, err error) {1360if gp == nil {1361err = errNotConnected1362return1363}1364_params := []interface{}{teamName}1365err = gp.C.Call(ctx, string(FunctionCreateTeam), _params, &res)1366return1367}13681369func (gp *APIoverJSONRPC) GetTeamMembers(ctx context.Context, teamID string) (res []*TeamMemberInfo, err error) {1370if gp == nil {1371err = errNotConnected1372return1373}1374_params := []interface{}{teamID}1375err = gp.C.Call(ctx, string(FunctionGetTeamMembers), _params, &res)1376return1377}13781379func (gp *APIoverJSONRPC) JoinTeam(ctx context.Context, inviteID string) (res *Team, err error) {1380if gp == nil {1381err = errNotConnected1382return1383}1384_params := []interface{}{inviteID}1385err = gp.C.Call(ctx, string(FunctionJoinTeam), _params, &res)1386return1387}13881389func (gp *APIoverJSONRPC) GetGenericInvite(ctx context.Context, teamID string) (res *TeamMembershipInvite, err error) {1390if gp == nil {1391err = errNotConnected1392return1393}1394_params := []interface{}{teamID}1395err = gp.C.Call(ctx, string(FunctionGetGenericInvite), _params, &res)1396return1397}13981399func (gp *APIoverJSONRPC) ResetGenericInvite(ctx context.Context, teamID string) (res *TeamMembershipInvite, err error) {1400if gp == nil {1401err = errNotConnected1402return1403}1404_params := []interface{}{teamID}1405err = gp.C.Call(ctx, string(FunctionResetGenericInvite), _params, &res)1406return1407}14081409func (gp *APIoverJSONRPC) SetTeamMemberRole(ctx context.Context, teamID, userID string, role TeamMemberRole) (err error) {1410if gp == nil {1411err = errNotConnected1412return1413}1414_params := []interface{}{teamID, userID, role}1415err = gp.C.Call(ctx, string(FunctionSetTeamMemberRole), _params, nil)1416return1417}14181419func (gp *APIoverJSONRPC) RemoveTeamMember(ctx context.Context, teamID, userID string) (err error) {1420if gp == nil {1421err = errNotConnected1422return1423}1424_params := []interface{}{teamID, userID}1425err = gp.C.Call(ctx, string(FunctionRemoveTeamMember), _params, nil)1426return1427}14281429func (gp *APIoverJSONRPC) DeleteTeam(ctx context.Context, teamID string) (err error) {1430if gp == nil {1431err = errNotConnected1432return1433}1434_params := []interface{}{teamID}1435err = gp.C.Call(ctx, string(FunctionDeleteTeam), _params, nil)1436return1437}14381439func (gp *APIoverJSONRPC) GetOrgSettings(ctx context.Context, orgID string) (res *OrganizationSettings, err error) {1440if gp == nil {1441err = errNotConnected1442return1443}1444_params := []interface{}{orgID}1445err = gp.C.Call(ctx, string(FunctionGetOrgSettings), _params, &res)1446return1447}14481449func (gp *APIoverJSONRPC) GetDefaultWorkspaceImage(ctx context.Context, params *GetDefaultWorkspaceImageParams) (res *GetDefaultWorkspaceImageResult, err error) {1450if gp == nil {1451err = errNotConnected1452return1453}1454var _params []interface{}14551456_params = append(_params, params)14571458err = gp.C.Call(ctx, string(FunctionGetDefaultWorkspaceImage), _params, &res)1459return1460}14611462func (gp *APIoverJSONRPC) CreateProject(ctx context.Context, options *CreateProjectOptions) (res *Project, err error) {1463if gp == nil {1464err = errNotConnected1465return1466}1467_params := []interface{}{options}1468err = gp.C.Call(ctx, string(FunctionCreateProject), _params, &res)1469return1470}14711472func (gp *APIoverJSONRPC) DeleteProject(ctx context.Context, projectID string) (err error) {1473if gp == nil {1474err = errNotConnected1475return1476}1477_params := []interface{}{projectID}1478err = gp.C.Call(ctx, string(FunctionDeleteProject), _params, nil)1479return1480}14811482func (gp *APIoverJSONRPC) GetTeamProjects(ctx context.Context, teamID string) (res []*Project, err error) {1483if gp == nil {1484err = errNotConnected1485return1486}1487_params := []interface{}{teamID}1488err = gp.C.Call(ctx, string(FunctionGetTeamProjects), _params, &res)1489return1490}14911492func (gp *APIoverJSONRPC) GetIDToken(ctx context.Context) (err error) {1493if gp == nil {1494err = errNotConnected1495return1496}1497_params := []interface{}{}1498err = gp.C.Call(ctx, string(FunctionGetIDToken), _params, nil)1499return1500}15011502// PermissionName is the name of a permission1503type PermissionName string15041505const (1506// PermissionNameRegistryAccess is the "registry-access" permission1507PermissionNameRegistryAccess PermissionName = "registry-access"1508// PermissionNameAdminUsers is the "admin-users" permission1509PermissionNameAdminUsers PermissionName = "admin-users"1510// PermissionNameAdminWorkspaces is the "admin-workspaces" permission1511PermissionNameAdminWorkspaces PermissionName = "admin-workspaces"1512)15131514// AdmissionLevel is the admission level to a workspace1515type AdmissionLevel string15161517const (1518// AdmissionLevelOwner is the "owner" admission level1519AdmissionLevelOwner AdmissionLevel = "owner"1520// AdmissionLevelEveryone is the "everyone" admission level1521AdmissionLevelEveryone AdmissionLevel = "everyone"1522)15231524// PinAction is the pin action1525type PinAction string15261527const (1528// PinActionPin is the "pin" action1529PinActionPin PinAction = "pin"1530// PinActionUnpin is the "unpin" action1531PinActionUnpin PinAction = "unpin"1532// PinActionToggle is the "toggle" action1533PinActionToggle PinAction = "toggle"1534)15351536// UserInfo is the UserInfo message type1537type UserInfo struct {1538Name string `json:"name,omitempty"`1539}15401541// GetWorkspacesOptions is the GetWorkspacesOptions message type1542type GetWorkspacesOptions struct {1543Limit float64 `json:"limit,omitempty"`1544SearchString string `json:"searchString,omitempty"`1545PinnedOnly bool `json:"pinnedOnly,omitempty"`1546OrganizationId string `json:"organizationId,omitempty"`1547}15481549// StartWorkspaceResult is the StartWorkspaceResult message type1550type StartWorkspaceResult struct {1551InstanceID string `json:"instanceID,omitempty"`1552WorkspaceURL string `json:"workspaceURL,omitempty"`1553}15541555// APIToken is the APIToken message type1556type APIToken struct {15571558// Created timestamp1559Created string `json:"created,omitempty"`1560Deleted bool `json:"deleted,omitempty"`15611562// Human readable name of the token1563Name string `json:"name,omitempty"`15641565// Scopes (e.g. limition to read-only)1566Scopes []string `json:"scopes,omitempty"`15671568// Hash value (SHA256) of the token (primary key).1569TokenHash string `json:"tokenHash,omitempty"`15701571// // Token kindfloat64 is the float64 message type1572Type float64 `json:"type,omitempty"`15731574// The user the token belongs to.1575User *User `json:"user,omitempty"`1576}15771578// OAuth2Config is the OAuth2Config message type1579type OAuth2Config struct {1580AuthorizationParams map[string]string `json:"authorizationParams,omitempty"`1581AuthorizationURL string `json:"authorizationUrl,omitempty"`1582CallBackURL string `json:"callBackUrl,omitempty"`1583ClientID string `json:"clientId,omitempty"`1584ClientSecret string `json:"clientSecret,omitempty"`1585ConfigURL string `json:"configURL,omitempty"`1586Scope string `json:"scope,omitempty"`1587ScopeSeparator string `json:"scopeSeparator,omitempty"`1588SettingsURL string `json:"settingsUrl,omitempty"`1589TokenURL string `json:"tokenUrl,omitempty"`1590}15911592// AuthProviderEntry is the AuthProviderEntry message type1593type AuthProviderEntry struct {1594Host string `json:"host,omitempty"`1595ID string `json:"id,omitempty"`1596Oauth *OAuth2Config `json:"oauth,omitempty"`1597OwnerID string `json:"ownerId,omitempty"`15981599// Status string `json:"status,omitempty"` string is the string message type1600Type string `json:"type,omitempty"`1601}16021603// Commit is the Commit message type1604type Commit struct {1605Ref string `json:"ref,omitempty"`1606RefType string `json:"refType,omitempty"`1607Repository *Repository `json:"repository,omitempty"`1608Revision string `json:"revision,omitempty"`1609}16101611// Fork is the Fork message type1612type Fork struct {1613Parent *Repository `json:"parent,omitempty"`1614}16151616// Repository is the Repository message type1617type Repository struct {1618AvatarURL string `json:"avatarUrl,omitempty"`1619CloneURL string `json:"cloneUrl,omitempty"`1620DefaultBranch string `json:"defaultBranch,omitempty"`1621Description string `json:"description,omitempty"`1622Fork *Fork `json:"fork,omitempty"`1623Host string `json:"host,omitempty"`1624Name string `json:"name,omitempty"`1625Owner string `json:"owner,omitempty"`16261627// Optional for backwards compatibility1628Private bool `json:"private,omitempty"`1629WebURL string `json:"webUrl,omitempty"`1630}16311632// WorkspaceCreationResult is the WorkspaceCreationResult message type1633type WorkspaceCreationResult struct {1634CreatedWorkspaceID string `json:"createdWorkspaceId,omitempty"`1635ExistingWorkspaces []*WorkspaceInfo `json:"existingWorkspaces,omitempty"`1636WorkspaceURL string `json:"workspaceURL,omitempty"`1637}16381639// Workspace is the Workspace message type1640type Workspace struct {16411642// The resolved/built fixed named of the base image. This field is only set if the workspace1643// already has its base image built.1644BaseImageNameResolved string `json:"baseImageNameResolved,omitempty"`1645BasedOnPrebuildID string `json:"basedOnPrebuildId,omitempty"`1646BasedOnSnapshotID string `json:"basedOnSnapshotId,omitempty"`1647Config *WorkspaceConfig `json:"config,omitempty"`16481649// Marks the time when the workspace content has been deleted.1650ContentDeletedTime string `json:"contentDeletedTime,omitempty"`1651Context *WorkspaceContext `json:"context,omitempty"`1652ContextURL string `json:"contextURL,omitempty"`1653CreationTime string `json:"creationTime,omitempty"`1654Deleted bool `json:"deleted,omitempty"`1655Description string `json:"description,omitempty"`1656ID string `json:"id,omitempty"`16571658// The resolved, fix name of the workspace image. We only use this1659// to access the logs during an image build.1660ImageNameResolved string `json:"imageNameResolved,omitempty"`16611662// The source where to get the workspace base image from. This source is resolved1663// during workspace creation. Once a base image has been built the information in here1664// is superseded by baseImageNameResolved.1665ImageSource interface{} `json:"imageSource,omitempty"`1666OrganizationId string `json:"organizationId,omitempty"`1667OwnerID string `json:"ownerId,omitempty"`1668Pinned bool `json:"pinned,omitempty"`1669Shareable bool `json:"shareable,omitempty"`16701671// Mark as deleted (user-facing). The actual deletion of the workspace content is executed1672// with a (configurable) delay1673SoftDeleted string `json:"softDeleted,omitempty"`16741675// Marks the time when the workspace was marked as softDeleted. The actual deletion of the1676// workspace content happens after a configurable period16771678// SoftDeletedTime string `json:"softDeletedTime,omitempty"` string is the string message type1679Type string `json:"type,omitempty"`1680}16811682// WorkspaceConfig is the WorkspaceConfig message type1683type WorkspaceConfig struct {1684CheckoutLocation string `json:"checkoutLocation,omitempty"`16851686// Set of automatically inferred feature flags. That's not something the user can set, but1687// that is set by gitpod at workspace creation time.1688FeatureFlags []string `json:"_featureFlags,omitempty"`1689GitConfig map[string]string `json:"gitConfig,omitempty"`1690Github *GithubAppConfig `json:"github,omitempty"`1691Ide string `json:"ide,omitempty"`1692Image interface{} `json:"image,omitempty"`16931694// Where the config object originates from.1695//1696// repo - from the repository1697// derived - computed based on analyzing the repository1698// default - our static catch-all default config1699Origin string `json:"_origin,omitempty"`1700Ports []*PortConfig `json:"ports,omitempty"`1701Privileged bool `json:"privileged,omitempty"`1702Tasks []*TaskConfig `json:"tasks,omitempty"`1703Vscode *VSCodeConfig `json:"vscode,omitempty"`1704WorkspaceLocation string `json:"workspaceLocation,omitempty"`1705}17061707// WorkspaceContext is the WorkspaceContext message type1708type WorkspaceContext struct {1709ForceCreateNewWorkspace bool `json:"forceCreateNewWorkspace,omitempty"`1710NormalizedContextURL string `json:"normalizedContextURL,omitempty"`1711Title string `json:"title,omitempty"`17121713// Commit context1714Repository *Repository `json:"repository,omitempty"`1715Revision string `json:"revision,omitempty"`1716}17171718// WorkspaceImageSourceDocker is the WorkspaceImageSourceDocker message type1719type WorkspaceImageSourceDocker struct {1720DockerFileHash string `json:"dockerFileHash,omitempty"`1721DockerFilePath string `json:"dockerFilePath,omitempty"`1722DockerFileSource *Commit `json:"dockerFileSource,omitempty"`1723}17241725// WorkspaceImageSourceReference is the WorkspaceImageSourceReference message type1726type WorkspaceImageSourceReference struct {17271728// The resolved, fix base image reference1729BaseImageResolved string `json:"baseImageResolved,omitempty"`1730}17311732// WorkspaceInfo is the WorkspaceInfo message type1733type WorkspaceInfo struct {1734LatestInstance *WorkspaceInstance `json:"latestInstance,omitempty"`1735Workspace *Workspace `json:"workspace,omitempty"`1736}17371738// WorkspaceInstance is the WorkspaceInstance message type1739type WorkspaceInstance struct {1740Configuration *WorkspaceInstanceConfiguration `json:"configuration,omitempty"`1741CreationTime string `json:"creationTime,omitempty"`1742Deleted bool `json:"deleted,omitempty"`1743DeployedTime string `json:"deployedTime,omitempty"`1744ID string `json:"id,omitempty"`1745IdeURL string `json:"ideUrl,omitempty"`1746Region string `json:"region,omitempty"`1747StartedTime string `json:"startedTime,omitempty"`1748Status *WorkspaceInstanceStatus `json:"status,omitempty"`1749GitStatus *WorkspaceInstanceRepoStatus `json:"gitStatus,omitempty"`1750StoppedTime string `json:"stoppedTime,omitempty"`1751WorkspaceID string `json:"workspaceId,omitempty"`1752WorkspaceImage string `json:"workspaceImage,omitempty"`1753}17541755// WorkspaceInstanceConditions is the WorkspaceInstanceConditions message type1756type WorkspaceInstanceConditions struct {1757Deployed bool `json:"deployed,omitempty"`1758Failed string `json:"failed,omitempty"`1759FirstUserActivity string `json:"firstUserActivity,omitempty"`1760NeededImageBuild bool `json:"neededImageBuild,omitempty"`1761PullingImages bool `json:"pullingImages,omitempty"`1762Timeout string `json:"timeout,omitempty"`1763}17641765// WorkspaceInstanceConfiguration is the WorkspaceInstanceConfiguration message type1766type WorkspaceInstanceConfiguration struct {1767FeatureFlags []string `json:"featureFlags,omitempty"`1768TheiaVersion string `json:"theiaVersion,omitempty"`1769IDEConfig *WorkspaceInstanceIDEConfig `json:"ideConfig,omitempty"`1770}17711772// WorkspaceInstanceIDEConfig is the ide config information of a workspace instance1773type WorkspaceInstanceIDEConfig struct {1774UseLatest bool `json:"useLatest,omitempty"`1775IDE string `json:"ide,omitempty"`1776PreferToolbox bool `json:"preferToolbox,omitempty"`1777}17781779// WorkspaceInstanceRepoStatus is the WorkspaceInstanceRepoStatus message type1780type WorkspaceInstanceRepoStatus struct {1781Branch string `json:"branch,omitempty"`1782LatestCommit string `json:"latestCommit,omitempty"`1783TotalUncommitedFiles float64 `json:"totalUncommitedFiles,omitempty"`1784TotalUnpushedCommits float64 `json:"totalUnpushedCommits,omitempty"`1785TotalUntrackedFiles float64 `json:"totalUntrackedFiles,omitempty"`1786UncommitedFiles []string `json:"uncommitedFiles,omitempty"`1787UnpushedCommits []string `json:"unpushedCommits,omitempty"`1788UntrackedFiles []string `json:"untrackedFiles,omitempty"`1789}17901791// WorkspaceInstanceStatus is the WorkspaceInstanceStatus message type1792type WorkspaceInstanceStatus struct {1793Conditions *WorkspaceInstanceConditions `json:"conditions,omitempty"`1794ExposedPorts []*WorkspaceInstancePort `json:"exposedPorts,omitempty"`1795Message string `json:"message,omitempty"`1796NodeName string `json:"nodeName,omitempty"`1797OwnerToken string `json:"ownerToken,omitempty"`1798Phase string `json:"phase,omitempty"`1799Timeout string `json:"timeout,omitempty"`1800Version int `json:"version,omitempty"`1801}18021803// StartWorkspaceOptions is the StartWorkspaceOptions message type1804type StartWorkspaceOptions struct {1805ForceDefaultImage bool `json:"forceDefaultImage,omitempty"`1806WorkspaceClass string `json:"workspaceClass,omitempty"`1807IdeSettings *IDESettings `json:"ideSettings,omitempty"`1808Region string `json:"region,omitempty"`1809}18101811// GetWorkspaceTimeoutResult is the GetWorkspaceTimeoutResult message type1812type GetWorkspaceTimeoutResult struct {1813CanChange bool `json:"canChange,omitempty"`1814Duration string `json:"duration,omitempty"`1815HumanReadableDuration string `json:"humanReadableDuration,omitempty"`1816}18171818// WorkspaceInstancePort is the WorkspaceInstancePort message type1819type WorkspaceInstancePort struct {1820Port float64 `json:"port,omitempty"`1821URL string `json:"url,omitempty"`1822Visibility string `json:"visibility,omitempty"`1823Protocol string `json:"protocol,omitempty"`1824}18251826const (1827PortVisibilityPublic = "public"1828PortVisibilityPrivate = "private"1829)18301831const (1832PortProtocolHTTP = "http"1833PortProtocolHTTPS = "https"1834)18351836// GithubAppConfig is the GithubAppConfig message type1837type GithubAppConfig struct {1838Prebuilds *GithubAppPrebuildConfig `json:"prebuilds,omitempty"`1839}18401841// GithubAppPrebuildConfig is the GithubAppPrebuildConfig message type1842type GithubAppPrebuildConfig struct {1843AddBadge bool `json:"addBadge,omitempty"`1844AddCheck interface{} `json:"addCheck,omitempty"`1845AddComment bool `json:"addComment,omitempty"`1846AddLabel interface{} `json:"addLabel,omitempty"`1847Branches bool `json:"branches,omitempty"`1848Master bool `json:"master,omitempty"`1849PullRequests bool `json:"pullRequests,omitempty"`1850PullRequestsFromForks bool `json:"pullRequestsFromForks,omitempty"`1851}18521853// ImageConfigFile is the ImageConfigFile message type1854type ImageConfigFile struct {1855Context string `json:"context,omitempty"`1856File string `json:"file,omitempty"`1857}18581859// PortConfig is the PortConfig message type1860type PortConfig struct {1861OnOpen string `json:"onOpen,omitempty"`1862Port float64 `json:"port,omitempty"`1863Visibility string `json:"visibility,omitempty"`1864Description string `json:"description,omitempty"`1865Name string `json:"name,omitempty"`1866Protocol string `json:"protocol,omitempty"`1867}18681869// TaskConfig is the TaskConfig message type1870type TaskConfig struct {1871Before string `json:"before,omitempty"`1872Command string `json:"command,omitempty"`1873Env map[string]interface{} `json:"env,omitempty"`1874Init string `json:"init,omitempty"`1875Name string `json:"name,omitempty"`1876OpenIn string `json:"openIn,omitempty"`1877OpenMode string `json:"openMode,omitempty"`1878Prebuild string `json:"prebuild,omitempty"`1879}18801881// VSCodeConfig is the VSCodeConfig message type1882type VSCodeConfig struct {1883Extensions []string `json:"extensions,omitempty"`1884}18851886// Configuration is the Configuration message type1887type Configuration struct {1888IsDedicatedInstallation bool `json:"isDedicatedInstallation,omitempty"`1889}18901891// EnvVar is the EnvVar message type1892type EnvVar struct {1893ID string `json:"id,omitempty"`1894Name string `json:"name,omitempty"`1895Value string `json:"value,omitempty"`1896}18971898// UserEnvVarValue is the UserEnvVarValue message type1899type UserEnvVarValue struct {1900ID string `json:"id,omitempty"`1901Name string `json:"name,omitempty"`1902RepositoryPattern string `json:"repositoryPattern,omitempty"`1903Value string `json:"value,omitempty"`1904}19051906type SSHPublicKeyValue struct {1907Name string `json:"name,omitempty"`1908Key string `json:"key,omitempty"`1909}19101911type UserSSHPublicKeyValue struct {1912ID string `json:"id,omitempty"`1913Name string `json:"name,omitempty"`1914Key string `json:"key,omitempty"`1915Fingerprint string `json:"fingerprint,omitempty"`1916CreationTime string `json:"creationTime,omitempty"`1917LastUsedTime string `json:"lastUsedTime,omitempty"`1918}19191920// GenerateNewGitpodTokenOptions is the GenerateNewGitpodTokenOptions message type1921type GenerateNewGitpodTokenOptions struct {1922Name string `json:"name,omitempty"`19231924// Scopes []string `json:"scopes,omitempty"` float64 is the float64 message type1925Type float64 `json:"type,omitempty"`1926}19271928// TakeSnapshotOptions is the TakeSnapshotOptions message type1929type TakeSnapshotOptions struct {1930WorkspaceID string `json:"workspaceId,omitempty"`1931DontWait bool `json:"dontWait,omitempty"`1932}19331934// AdminBlockUserRequest is the AdminBlockUserRequest message type1935type AdminBlockUserRequest struct {1936UserID string `json:"id,omitempty"`1937IsBlocked bool `json:"blocked,omitempty"`1938}19391940// PickAuthProviderEntryHostOwnerIDType is the PickAuthProviderEntryHostOwnerIDType message type1941type PickAuthProviderEntryHostOwnerIDType struct {1942Host string `json:"host,omitempty"`19431944// OwnerId string `json:"ownerId,omitempty"` string is the string message type1945Type string `json:"type,omitempty"`1946}19471948// PickAuthProviderEntryOwnerID is the PickAuthProviderEntryOwnerID message type1949type PickAuthProviderEntryOwnerID struct {1950ID string `json:"id,omitempty"`1951OwnerID string `json:"ownerId,omitempty"`1952}19531954// PickOAuth2ConfigClientIDClientSecret is the PickOAuth2ConfigClientIDClientSecret message type1955type PickOAuth2ConfigClientIDClientSecret struct {1956ClientID string `json:"clientId,omitempty"`1957ClientSecret string `json:"clientSecret,omitempty"`1958}19591960// UpdateOwnAuthProviderParams is the UpdateOwnAuthProviderParams message type1961type UpdateOwnAuthProviderParams struct {1962Entry interface{} `json:"entry,omitempty"`1963}19641965// CreateWorkspaceOptions is the CreateWorkspaceOptions message type1966type CreateWorkspaceOptions struct {1967StartWorkspaceOptions1968ContextURL string `json:"contextUrl,omitempty"`1969ProjectId string `json:"projectId,omitempty"`1970OrganizationId string `json:"organizationId,omitempty"`1971IgnoreRunningWorkspaceOnSameCommit bool `json:"ignoreRunningWorkspaceOnSameCommit,omitempty"`1972ForceDefaultConfig bool `json:"forceDefaultConfig,omitempty"`1973IgnoreRunningPrebuild bool `json:"ignoreRunningPrebuild,omitempty"`1974AllowUsingPreviousPrebuilds bool `json:"allowUsingPreviousPrebuilds,omitempty"`1975}19761977// DeleteOwnAuthProviderParams is the DeleteOwnAuthProviderParams message type1978type DeleteOwnAuthProviderParams struct {1979ID string `json:"id,omitempty"`1980}19811982// GuessGitTokenScopesParams is the GuessGitTokenScopesParams message type1983type GuessGitTokenScopesParams struct {1984Host string `json:"host"`1985RepoURL string `json:"repoUrl"`1986GitCommand string `json:"gitCommand"`1987CurrentToken *GitToken `json:"currentToken"`1988}19891990type GitToken struct {1991Token string `json:"token"`1992User string `json:"user"`1993Scopes []string `json:"scopes"`1994}19951996// GuessedGitTokenScopes is the GuessedGitTokenScopes message type1997type GuessedGitTokenScopes struct {1998Scopes []string `json:"scopes,omitempty"`1999Message string `json:"message,omitempty"`2000}20012002// SupportedWorkspaceClass is the GetSupportedWorkspaceClasses message type2003type SupportedWorkspaceClass struct {2004ID string `json:"id,omitempty"`2005Category string `json:"category,omitempty"`2006DisplayName string `json:"displayName,omitempty"`2007Description string `json:"description,omitempty"`2008Powerups int `json:"powerups,omitempty"`2009IsDefault bool `json:"isDefault,omitempty"`2010}20112012type RemoteTrackMessage struct {2013Event string `json:"event,omitempty"`2014Properties interface{} `json:"properties,omitempty"`2015}20162017// WorkspaceInstanceUser is the WorkspaceInstanceUser message type2018type WorkspaceInstanceUser struct {2019AvatarURL string `json:"avatarUrl,omitempty"`2020InstanceID string `json:"instanceId,omitempty"`2021LastSeen string `json:"lastSeen,omitempty"`2022Name string `json:"name,omitempty"`2023UserID string `json:"userId,omitempty"`2024}20252026// SendHeartBeatOptions is the SendHeartBeatOptions message type2027type SendHeartBeatOptions struct {2028InstanceID string `json:"instanceId,omitempty"`2029RoundTripTime float64 `json:"roundTripTime,omitempty"`2030WasClosed bool `json:"wasClosed,omitempty"`2031}20322033// AdditionalUserData is the AdditionalUserData message type2034type AdditionalUserData struct {2035EmailNotificationSettings *EmailNotificationSettings `json:"emailNotificationSettings,omitempty"`2036Platforms []*UserPlatform `json:"platforms,omitempty"`2037IdeSettings *IDESettings `json:"ideSettings,omitempty"`2038}20392040// IDESettings is the IDESettings message type2041type IDESettings struct {2042DefaultIde string `json:"defaultIde,omitempty"`2043UseDesktopIde bool `json:"useDesktopIde,omitempty"`2044DefaultDesktopIde string `json:"defaultDesktopIde,omitempty"`2045UseLatestVersion bool `json:"useLatestVersion"`2046PreferToolbox bool `json:"preferToolbox"`2047}20482049// EmailNotificationSettings is the EmailNotificationSettings message type2050type EmailNotificationSettings struct {2051DisallowTransactionalEmails bool `json:"disallowTransactionalEmails,omitempty"`2052}20532054// Identity is the Identity message type2055type Identity struct {2056AuthID string `json:"authId,omitempty"`2057AuthName string `json:"authName,omitempty"`2058AuthProviderID string `json:"authProviderId,omitempty"`20592060// This is a flag that triggers the HARD DELETION of this entity2061Deleted bool `json:"deleted,omitempty"`2062PrimaryEmail string `json:"primaryEmail,omitempty"`2063Readonly bool `json:"readonly,omitempty"`2064Tokens []*Token `json:"tokens,omitempty"`2065LastSigninTime string `json:"lastSigninTime,omitempty"`2066}20672068// User is the User message type2069type User struct {2070AdditionalData *AdditionalUserData `json:"additionalData,omitempty"`2071AllowsMarketingCommunication bool `json:"allowsMarketingCommunication,omitempty"`2072AvatarURL string `json:"avatarUrl,omitempty"`20732074// Whether the user has been blocked to use our service, because of TOS violation for example.2075// Optional for backwards compatibility.2076Blocked bool `json:"blocked,omitempty"`20772078// The timestamp when the user entry was created2079CreationDate string `json:"creationDate,omitempty"`20802081// A map of random settings that alter the behaviour of Gitpod on a per-user basis2082FeatureFlags *UserFeatureSettings `json:"featureFlags,omitempty"`20832084// Optional for backwards compatibility2085FullName string `json:"fullName,omitempty"`20862087// The user id2088ID string `json:"id,omitempty"`2089Identities []*Identity `json:"identities,omitempty"`20902091// Whether the user is logical deleted. This flag is respected by all queries in UserDB2092MarkedDeleted bool `json:"markedDeleted,omitempty"`2093Name string `json:"name,omitempty"`20942095// The ID of the Organization this user is owned by. If empty, the user is owned by the installation2096OrganizationId string `json:"organizationId,omitempty"`20972098// whether this user can run workspaces in privileged mode2099Privileged bool `json:"privileged,omitempty"`21002101// The permissions and/or roles the user has2102RolesOrPermissions []string `json:"rolesOrPermissions,omitempty"`2103}21042105// Token is the Token message type2106type Token struct {2107ExpiryDate string `json:"expiryDate,omitempty"`2108IDToken string `json:"idToken,omitempty"`2109RefreshToken string `json:"refreshToken,omitempty"`2110Scopes []string `json:"scopes,omitempty"`2111UpdateDate string `json:"updateDate,omitempty"`2112Username string `json:"username,omitempty"`2113Value string `json:"value,omitempty"`2114}21152116// UserFeatureSettings is the UserFeatureSettings message type2117type UserFeatureSettings struct {21182119// Permanent feature flags are added to each and every workspace instance2120// this user starts.2121PermanentWSFeatureFlags []string `json:"permanentWSFeatureFlags,omitempty"`2122}21232124// UserPlatform is the UserPlatform message type2125type UserPlatform struct {2126Browser string `json:"browser,omitempty"`21272128// Since when does the user have the browser extension installe don this device.2129BrowserExtensionInstalledSince string `json:"browserExtensionInstalledSince,omitempty"`21302131// Since when does the user not have the browser extension installed anymore (but previously had).2132BrowserExtensionUninstalledSince string `json:"browserExtensionUninstalledSince,omitempty"`2133FirstUsed string `json:"firstUsed,omitempty"`2134LastUsed string `json:"lastUsed,omitempty"`2135Os string `json:"os,omitempty"`2136UID string `json:"uid,omitempty"`2137UserAgent string `json:"userAgent,omitempty"`2138}21392140// Requirements is the Requirements message type2141type Requirements struct {2142Default []string `json:"default,omitempty"`2143PrivateRepo []string `json:"privateRepo,omitempty"`2144PublicRepo []string `json:"publicRepo,omitempty"`2145}21462147// AuthProviderInfo is the AuthProviderInfo message type2148type AuthProviderInfo struct {2149AuthProviderID string `json:"authProviderId,omitempty"`2150AuthProviderType string `json:"authProviderType,omitempty"`2151Description string `json:"description,omitempty"`2152DisallowLogin bool `json:"disallowLogin,omitempty"`2153HiddenOnDashboard bool `json:"hiddenOnDashboard,omitempty"`2154Host string `json:"host,omitempty"`2155Icon string `json:"icon,omitempty"`2156IsReadonly bool `json:"isReadonly,omitempty"`2157LoginContextMatcher string `json:"loginContextMatcher,omitempty"`2158OwnerID string `json:"ownerId,omitempty"`2159Requirements *Requirements `json:"requirements,omitempty"`2160Scopes []string `json:"scopes,omitempty"`2161SettingsURL string `json:"settingsUrl,omitempty"`2162Verified bool `json:"verified,omitempty"`2163}21642165// GetTokenSearchOptions is the GetTokenSearchOptions message type2166type GetTokenSearchOptions struct {2167Host string `json:"host,omitempty"`2168}21692170// SetWorkspaceTimeoutResult is the SetWorkspaceTimeoutResult message type2171type SetWorkspaceTimeoutResult struct {2172ResetTimeoutOnWorkspaces []string `json:"resetTimeoutOnWorkspaces,omitempty"`2173HumanReadableDuration string `json:"humanReadableDuration,omitempty"`2174}21752176// UserMessage is the UserMessage message type2177type UserMessage struct {2178Content string `json:"content,omitempty"`21792180// date from where on this message should be shown2181From string `json:"from,omitempty"`2182ID string `json:"id,omitempty"`2183Title string `json:"title,omitempty"`2184URL string `json:"url,omitempty"`2185}21862187type Team struct {2188ID string `json:"id,omitempty"`2189Name string `json:"name,omitempty"`2190Slug string `json:"slug,omitempty"`2191CreationTime string `json:"creationTime,omitempty"`2192}21932194type TeamMemberRole string21952196const (2197TeamMember_Owner TeamMemberRole = "owner"2198TeamMember_Member TeamMemberRole = "member"2199)22002201type TeamMemberInfo struct {2202UserId string `json:"userId,omitempty"`2203FullName string `json:"fullName,omitempty"`2204PrimaryEmail string `json:"primaryEmail,omitempty"`2205AvatarUrl string `json:"avatarUrl,omitempty"`2206Role TeamMemberRole `json:"role,omitempty"`2207MemberSince string `json:"memberSince,omitempty"`2208OwnedByOrganization bool `json:"ownedByOrganization,omitempty"`2209}22102211type TeamMembershipInvite struct {2212ID string `json:"id,omitempty"`2213TeamID string `json:"teamId,omitempty"`2214Role TeamMemberRole `json:"role,omitempty"`2215CreationTime string `json:"creationTime,omitempty"`2216InvalidationTime string `json:"invalidationTime,omitempty"`2217InvitedEmail string `json:"invitedEmail,omitempty"`2218}22192220type OrganizationSettings struct {2221WorkspaceSharingDisabled bool `json:"workspaceSharingDisabled,omitempty"`2222DefaultWorkspaceImage string `json:"defaultWorkspaceImage,omitempty"`2223}22242225type Project struct {2226ID string `json:"id,omitempty"`2227UserID string `json:"userId,omitempty"`2228TeamID string `json:"teamId,omitempty"`2229Name string `json:"name,omitempty"`2230Slug string `json:"slug,omitempty"`2231CloneURL string `json:"cloneUrl,omitempty"`2232AppInstallationID string `json:"appInstallationId,omitempty"`2233Settings *ProjectSettings `json:"settings,omitempty"`2234CreationTime string `json:"creationTime,omitempty"`2235}22362237type ProjectSettings struct {2238UsePersistentVolumeClaim bool `json:"usePersistentVolumeClaim,omitempty"`2239WorkspaceClasses *WorkspaceClassesSettings `json:"workspaceClasses,omitempty"`2240PrebuildSettings *PrebuildSettings `json:"prebuilds,omitempty"`2241RestrictedWorkspaceClasses *[]string `json:"restrictedWorkspaceClasses,omitempty"`2242}2243type PrebuildSettings struct {2244Enable *bool `json:"enable,omitempty"`2245PrebuildInterval *int32 `json:"prebuildInterval,omitempty"`2246BranchStrategy *string `json:"branchStrategy,omitempty"`2247BranchMatchingPattern *string `json:"branchMatchingPattern,omitempty"`2248WorkspaceClass *string `json:"workspaceClass,omitempty"`2249}22502251type WorkspaceClassesSettings struct {2252Regular string `json:"regular,omitempty"`2253Prebuild string `json:"prebuild,omitempty"`2254}22552256type CreateProjectOptions struct {2257UserID string `json:"userId,omitempty"`2258TeamID string `json:"teamId,omitempty"`2259Name string `json:"name,omitempty"`2260Slug string `json:"slug,omitempty"`2261CloneURL string `json:"cloneUrl,omitempty"`2262AppInstallationID string `json:"appInstallationId,omitempty"`2263}22642265type IDEType string22662267const (2268IDETypeBrowser IDEType = "browser"2269IDETypeDesktop IDEType = "desktop"2270)22712272type IDEConfig struct {2273SupervisorImage string `json:"supervisorImage"`2274IdeOptions IDEOptions `json:"ideOptions"`2275}22762277type IDEOptions struct {2278// Options is a list of available IDEs.2279Options map[string]IDEOption `json:"options"`2280// DefaultIde when the user has not specified one.2281DefaultIde string `json:"defaultIde"`2282// DefaultDesktopIde when the user has not specified one.2283DefaultDesktopIde string `json:"defaultDesktopIde"`2284// Clients specific IDE options.2285Clients map[string]IDEClient `json:"clients"`2286}22872288type IDEOption struct {2289// OrderKey to ensure a stable order one can set an `orderKey`.2290OrderKey string `json:"orderKey,omitempty"`2291// Title with human readable text of the IDE (plain text only).2292Title string `json:"title"`2293// Type of the IDE, currently 'browser' or 'desktop'.2294Type IDEType `json:"type"`2295// Logo URL for the IDE. See also components/ide-proxy/static/image/ide-log/ folder2296Logo string `json:"logo"`2297// Tooltip plain text only2298Tooltip string `json:"tooltip,omitempty"`2299// Label is next to the IDE option like “Browser” (plain text only).2300Label string `json:"label,omitempty"`2301// Notes to the IDE option that are rendered in the preferences when a user chooses this IDE.2302Notes []string `json:"notes,omitempty"`2303// Hidden this IDE option is not visible in the IDE preferences.2304Hidden bool `json:"hidden,omitempty"`2305// Experimental this IDE option is to only be shown to some users2306Experimental bool `json:"experimental,omitempty"`2307// Image ref to the IDE image.2308Image string `json:"image"`2309// LatestImage ref to the IDE image, this image ref always resolve to digest.2310LatestImage string `json:"latestImage,omitempty"`2311// ResolveImageDigest when this is `true`, the tag of this image is resolved to the latest image digest regularly.2312// This is useful if this image points to a tag like `nightly` that will be updated regularly. When `resolveImageDigest` is `true`, we make sure that we resolve the tag regularly to the most recent image version.2313ResolveImageDigest bool `json:"resolveImageDigest,omitempty"`2314// PluginImage ref for the IDE image, this image ref always resolve to digest.2315// DEPRECATED use ImageLayers instead2316PluginImage string `json:"pluginImage,omitempty"`2317// PluginLatestImage ref for the latest IDE image, this image ref always resolve to digest.2318// DEPRECATED use LatestImageLayers instead2319PluginLatestImage string `json:"pluginLatestImage,omitempty"`2320// ImageVersion the semantic version of the IDE image.2321ImageVersion string `json:"imageVersion,omitempty"`2322// LatestImageVersion the semantic version of the latest IDE image.2323LatestImageVersion string `json:"latestImageVersion,omitempty"`2324// ImageLayers for additional ide layers and dependencies2325ImageLayers []string `json:"imageLayers,omitempty"`2326// LatestImageLayers for latest additional ide layers and dependencies2327LatestImageLayers []string `json:"latestImageLayers,omitempty"`2328}23292330type IDEClient struct {2331// DefaultDesktopIDE when the user has not specified one.2332DefaultDesktopIDE string `json:"defaultDesktopIDE,omitempty"`2333// DesktopIDEs supported by the client.2334DesktopIDEs []string `json:"desktopIDEs,omitempty"`2335// InstallationSteps to install the client on user machine.2336InstallationSteps []string `json:"installationSteps,omitempty"`2337}23382339type GetDefaultWorkspaceImageParams struct {2340WorkspaceID string `json:"workspaceId,omitempty"`2341}23422343type WorkspaceImageSource string23442345const (2346WorkspaceImageSourceInstallation WorkspaceImageSource = "installation"2347WorkspaceImageSourceOrganization WorkspaceImageSource = "organization"2348)23492350type GetDefaultWorkspaceImageResult struct {2351Image string `json:"image,omitempty"`2352Source WorkspaceImageSource `json:"source,omitempty"`2353}235423552356