From 62860ecd2b0c4a418f5fc8a39da84330b6c5714d Mon Sep 17 00:00:00 2001 From: Huiwen Date: Fri, 24 Nov 2023 06:10:36 +0000 Subject: [PATCH] Migrate gRPC workspaceService other workspace related method --- .../SelectWorkspaceClassComponent.tsx | 10 +- components/dashboard/src/data/setup.tsx | 2 +- .../data/workspaces/list-workspaces-query.ts | 18 +- .../toggle-workspace-pinned-mutation.ts | 47 - .../toggle-workspace-shared-mutation.ts | 58 -- .../update-workspace-description-mutation.ts | 50 - .../workspaces/update-workspace-mutation.ts | 26 + .../workspaces/workspace-classes-query.ts | 9 +- .../src/service/json-rpc-workspace-client.ts | 98 +- .../src/workspaces/RenameWorkspaceModal.tsx | 24 +- .../src/workspaces/WorkspaceOverflowMenu.tsx | 21 +- .../public-api/gitpod/v1/workspace.proto | 53 + .../go/v1/v1connect/workspace.connect.go | 76 ++ .../v1/v1connect/workspace.proxy.connect.go | 30 + components/public-api/go/v1/workspace.pb.go | 952 ++++++++++++++---- .../public-api/go/v1/workspace_grpc.pb.go | 118 +++ .../src/public-api-converter.ts | 11 + .../src/gitpod/v1/workspace_connect.ts | 37 +- .../typescript/src/gitpod/v1/workspace_pb.ts | 287 ++++++ .../server/src/api/workspace-service-api.ts | 94 +- 20 files changed, 1608 insertions(+), 413 deletions(-) delete mode 100644 components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts delete mode 100644 components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts delete mode 100644 components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts create mode 100644 components/dashboard/src/data/workspaces/update-workspace-mutation.ts diff --git a/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx b/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx index 25712a409b94c8..a33ac56cadeacf 100644 --- a/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx +++ b/components/dashboard/src/components/SelectWorkspaceClassComponent.tsx @@ -4,11 +4,11 @@ * See License.AGPL.txt in the project root for license information. */ -import { SupportedWorkspaceClass } from "@gitpod/gitpod-protocol/lib/workspace-class"; import { FC, useCallback, useEffect, useMemo } from "react"; -import WorkspaceClass from "../icons/WorkspaceClass.svg"; +import WorkspaceClassIcon from "../icons/WorkspaceClass.svg"; import { Combobox, ComboboxElement, ComboboxSelectedItem } from "./podkit/combobox/Combobox"; import { useWorkspaceClasses } from "../data/workspaces/workspace-classes-query"; +import { WorkspaceClass } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; interface SelectWorkspaceClassProps { selectedWorkspaceClass?: string; @@ -78,7 +78,7 @@ export default function SelectWorkspaceClassComponent({ } type WorkspaceClassDropDownElementSelectedProps = { - wsClass?: SupportedWorkspaceClass; + wsClass?: WorkspaceClass; loading?: boolean; }; @@ -90,7 +90,7 @@ const WorkspaceClassDropDownElementSelected: FC{title}} @@ -106,7 +106,7 @@ const WorkspaceClassDropDownElementSelected: FC diff --git a/components/dashboard/src/data/setup.tsx b/components/dashboard/src/data/setup.tsx index 0d58a3b89c5d7a..2ab1b5ac4296b7 100644 --- a/components/dashboard/src/data/setup.tsx +++ b/components/dashboard/src/data/setup.tsx @@ -32,7 +32,7 @@ import * as SSHClasses from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; // This is used to version the cache // If data we cache changes in a non-backwards compatible way, increment this version // That will bust any previous cache versions a client may have stored -const CACHE_VERSION = "14"; +const CACHE_VERSION = "16"; export function noPersistence(queryKey: QueryKey): QueryKey { return [...queryKey, "no-persistence"]; diff --git a/components/dashboard/src/data/workspaces/list-workspaces-query.ts b/components/dashboard/src/data/workspaces/list-workspaces-query.ts index 0c3f2c5b5815db..2b3a48de7e2c38 100644 --- a/components/dashboard/src/data/workspaces/list-workspaces-query.ts +++ b/components/dashboard/src/data/workspaces/list-workspaces-query.ts @@ -4,7 +4,7 @@ * See License.AGPL.txt in the project root for license information. */ -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useCurrentOrg } from "../organizations/orgs-query"; import { workspaceClient } from "../../service/public-api"; import { Workspace } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; @@ -57,3 +57,19 @@ export function getListWorkspacesQueryKey(orgId?: string) { } return ["workspaces", "list", orgId]; } + +export const useUpdateWorkspaceInCache = () => { + const queryClient = useQueryClient(); + const org = useCurrentOrg(); + return (newWorkspace: Workspace) => { + const queryKey = getListWorkspacesQueryKey(org.data?.id); + queryClient.setQueryData(queryKey, (oldWorkspacesData) => { + return oldWorkspacesData?.map((info) => { + if (info.id !== newWorkspace.id) { + return info; + } + return newWorkspace; + }); + }); + }; +}; diff --git a/components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts b/components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts deleted file mode 100644 index af010d6c829aaf..00000000000000 --- a/components/dashboard/src/data/workspaces/toggle-workspace-pinned-mutation.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2023 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; -import { getListWorkspacesQueryKey, ListWorkspacesQueryResult } from "./list-workspaces-query"; -import { useCurrentOrg } from "../organizations/orgs-query"; -import { Workspace, WorkspaceMetadata } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; - -type ToggleWorkspacePinnedArgs = { - workspaceId: string; -}; - -export const useToggleWorkspacedPinnedMutation = () => { - const queryClient = useQueryClient(); - const org = useCurrentOrg(); - - return useMutation({ - mutationFn: async ({ workspaceId }: ToggleWorkspacePinnedArgs) => { - return await getGitpodService().server.updateWorkspaceUserPin(workspaceId, "toggle"); - }, - onSuccess: (_, { workspaceId }) => { - // TODO: use `useUpdateWorkspaceInCache` after respond Workspace object, see EXP-960 - const queryKey = getListWorkspacesQueryKey(org.data?.id); - - // Update workspace.pinned to account for the toggle so it's reflected immediately - queryClient.setQueryData(queryKey, (oldWorkspaceData) => { - return oldWorkspaceData?.map((info) => { - if (info.id !== workspaceId) { - return info; - } - const workspace = new Workspace(info); - if (!workspace.metadata) { - workspace.metadata = new WorkspaceMetadata(); - } - workspace.metadata.pinned = !workspace.metadata.pinned; - return workspace; - }); - }); - - queryClient.invalidateQueries({ queryKey }); - }, - }); -}; diff --git a/components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts b/components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts deleted file mode 100644 index bdc22d5b9eb4d1..00000000000000 --- a/components/dashboard/src/data/workspaces/toggle-workspace-shared-mutation.ts +++ /dev/null @@ -1,58 +0,0 @@ -/** - * Copyright (c) 2023 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; -import { getListWorkspacesQueryKey, ListWorkspacesQueryResult } from "./list-workspaces-query"; -import { useCurrentOrg } from "../organizations/orgs-query"; -import { AdmissionLevel, Workspace, WorkspaceSpec } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; - -type ToggleWorkspaceSharedArgs = { - workspaceId: string; - level: AdmissionLevel; -}; - -export const useToggleWorkspaceSharedMutation = () => { - const queryClient = useQueryClient(); - const org = useCurrentOrg(); - - return useMutation({ - mutationFn: async ({ workspaceId, level }: ToggleWorkspaceSharedArgs) => { - if (level === AdmissionLevel.UNSPECIFIED) { - return; - } - return await getGitpodService().server.controlAdmission( - workspaceId, - level === AdmissionLevel.EVERYONE ? "everyone" : "owner", - ); - }, - onSuccess: (_, { workspaceId, level }) => { - if (level === AdmissionLevel.UNSPECIFIED) { - return; - } - // TODO: use `useUpdateWorkspaceInCache` after respond Workspace object, see EXP-960 - const queryKey = getListWorkspacesQueryKey(org.data?.id); - - // Update workspace.shareable to the level we set so it's reflected immediately - queryClient.setQueryData(queryKey, (oldWorkspacesData) => { - return oldWorkspacesData?.map((info) => { - if (info.id !== workspaceId) { - return info; - } - - const workspace = new Workspace(info); - if (!workspace.spec) { - workspace.spec = new WorkspaceSpec(); - } - workspace.spec.admission = level; - return workspace; - }); - }); - - queryClient.invalidateQueries({ queryKey }); - }, - }); -}; diff --git a/components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts b/components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts deleted file mode 100644 index 1d2ede145d9687..00000000000000 --- a/components/dashboard/src/data/workspaces/update-workspace-description-mutation.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2023 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; -import { getListWorkspacesQueryKey, ListWorkspacesQueryResult } from "./list-workspaces-query"; -import { useCurrentOrg } from "../organizations/orgs-query"; -import { Workspace, WorkspaceMetadata } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; - -type UpdateWorkspaceDescriptionArgs = { - workspaceId: string; - newDescription: string; -}; -export const useUpdateWorkspaceDescriptionMutation = () => { - const queryClient = useQueryClient(); - const org = useCurrentOrg(); - - return useMutation({ - mutationFn: async ({ workspaceId, newDescription }: UpdateWorkspaceDescriptionArgs) => { - return await getGitpodService().server.setWorkspaceDescription(workspaceId, newDescription); - }, - onSuccess: (_, { workspaceId, newDescription }) => { - // TODO: use `useUpdateWorkspaceInCache` after respond Workspace object, see EXP-960 - const queryKey = getListWorkspacesQueryKey(org.data?.id); - - // pro-actively update workspace description rather than reload all workspaces - queryClient.setQueryData(queryKey, (oldWorkspacesData) => { - return oldWorkspacesData?.map((info) => { - if (info.id !== workspaceId) { - return info; - } - - // TODO: Once the update description response includes an updated record, - // we can return that instead of having to know what to merge manually (same for other mutations) - const workspace = new Workspace(info); - if (!workspace.metadata) { - workspace.metadata = new WorkspaceMetadata(); - } - workspace.metadata.name = newDescription; - return workspace; - }); - }); - - queryClient.invalidateQueries({ queryKey }); - }, - }); -}; diff --git a/components/dashboard/src/data/workspaces/update-workspace-mutation.ts b/components/dashboard/src/data/workspaces/update-workspace-mutation.ts new file mode 100644 index 00000000000000..ce0e8bb960f79a --- /dev/null +++ b/components/dashboard/src/data/workspaces/update-workspace-mutation.ts @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +import { useMutation } from "@tanstack/react-query"; +import { useUpdateWorkspaceInCache } from "./list-workspaces-query"; +import { UpdateWorkspaceRequest } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; +import { PartialMessage } from "@bufbuild/protobuf"; +import { workspaceClient } from "../../service/public-api"; + +export const useUpdateWorkspaceMutation = () => { + const updateWorkspace = useUpdateWorkspaceInCache(); + + return useMutation({ + mutationFn: async (data: PartialMessage) => { + return await workspaceClient.updateWorkspace(data); + }, + onSuccess: (data) => { + if (data.workspace) { + updateWorkspace(data.workspace); + } + }, + }); +}; diff --git a/components/dashboard/src/data/workspaces/workspace-classes-query.ts b/components/dashboard/src/data/workspaces/workspace-classes-query.ts index a8c1d24d27594d..157bb3814ebcf5 100644 --- a/components/dashboard/src/data/workspaces/workspace-classes-query.ts +++ b/components/dashboard/src/data/workspaces/workspace-classes-query.ts @@ -4,15 +4,16 @@ * See License.AGPL.txt in the project root for license information. */ -import { SupportedWorkspaceClass } from "@gitpod/gitpod-protocol/lib/workspace-class"; import { useQuery } from "@tanstack/react-query"; -import { getGitpodService } from "../../service/service"; +import { workspaceClient } from "../../service/public-api"; +import { WorkspaceClass } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; export const useWorkspaceClasses = () => { - return useQuery({ + return useQuery({ queryKey: ["workspace-classes"], queryFn: async () => { - return getGitpodService().server.getSupportedWorkspaceClasses(); + const response = await workspaceClient.listWorkspaceClasses({}); + return response.workspaceClasses; }, cacheTime: 1000 * 60 * 60, // 1h staleTime: 1000 * 60 * 60, // 1h diff --git a/components/dashboard/src/service/json-rpc-workspace-client.ts b/components/dashboard/src/service/json-rpc-workspace-client.ts index ea33f278eef63a..2af3fe851e5f42 100644 --- a/components/dashboard/src/service/json-rpc-workspace-client.ts +++ b/components/dashboard/src/service/json-rpc-workspace-client.ts @@ -32,6 +32,13 @@ import { ParseContextURLResponse, UpdateWorkspaceRequest, UpdateWorkspaceResponse, + DeleteWorkspaceRequest, + DeleteWorkspaceResponse, + ListWorkspaceClassesRequest, + ListWorkspaceClassesResponse, + StopWorkspaceRequest, + StopWorkspaceResponse, + AdmissionLevel, } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; import { converter } from "./public-api"; import { getGitpodService } from "./service"; @@ -248,7 +255,85 @@ export class JsonRpcWorkspaceClient implements PromiseClient, _options?: CallOptions | undefined, ): Promise { - throw new ApplicationError(ErrorCodes.UNIMPLEMENTED, "not implemented"); + if (!request.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + + // check if user can access workspace first + await this.getWorkspace({ workspaceId: request.workspaceId }); + + const server = getGitpodService().server; + const tasks: Array> = []; + + if (request.metadata) { + if (request.metadata.name) { + tasks.push(server.setWorkspaceDescription(request.workspaceId, request.metadata.name)); + } + if (request.metadata.pinned !== undefined) { + tasks.push( + server.updateWorkspaceUserPin(request.workspaceId, request.metadata.pinned ? "pin" : "unpin"), + ); + } + } + + if (request.spec) { + if (request.spec?.admission) { + if (request.spec?.admission === AdmissionLevel.OWNER_ONLY) { + tasks.push(server.controlAdmission(request.workspaceId, "owner")); + } else if (request.spec?.admission === AdmissionLevel.EVERYONE) { + tasks.push(server.controlAdmission(request.workspaceId, "everyone")); + } + } + + if ((request.spec?.timeout?.disconnected?.seconds ?? 0) > 0) { + const timeout = converter.toDurationString(request.spec!.timeout!.disconnected!); + tasks.push(server.setWorkspaceTimeout(request.workspaceId, timeout)); + } + } + + if (request.gitStatus) { + tasks.push( + server.updateGitStatus(request.workspaceId, { + branch: request.gitStatus.branch!, + latestCommit: request.gitStatus.latestCommit!, + uncommitedFiles: request.gitStatus.uncommitedFiles!, + totalUncommitedFiles: request.gitStatus.totalUncommitedFiles!, + untrackedFiles: request.gitStatus.untrackedFiles!, + totalUntrackedFiles: request.gitStatus.totalUntrackedFiles!, + unpushedCommits: request.gitStatus.unpushedCommits!, + totalUnpushedCommits: request.gitStatus.totalUnpushedCommits!, + }), + ); + } + await Promise.allSettled(tasks); + const result = new UpdateWorkspaceResponse(); + const workspace = await this.getWorkspace({ workspaceId: request.workspaceId }); + result.workspace = workspace.workspace; + return result; + } + + async stopWorkspace( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + await getGitpodService().server.stopWorkspace(request.workspaceId); + const result = new StopWorkspaceResponse(); + return result; + } + + async deleteWorkspace( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + await getGitpodService().server.deleteWorkspace(request.workspaceId); + const result = new DeleteWorkspaceResponse(); + return result; } async parseContextURL( @@ -257,4 +342,15 @@ export class JsonRpcWorkspaceClient implements PromiseClient { throw new ApplicationError(ErrorCodes.UNIMPLEMENTED, "not implemented"); } + + async listWorkspaceClasses( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + const list = await getGitpodService().server.getSupportedWorkspaceClasses(); + const response = new ListWorkspaceClassesResponse(); + response.pagination = new PaginationResponse(); + response.workspaceClasses = list.map((i) => converter.toWorkspaceClass(i)); + return response; + } } diff --git a/components/dashboard/src/workspaces/RenameWorkspaceModal.tsx b/components/dashboard/src/workspaces/RenameWorkspaceModal.tsx index 0d8b1c13e1b5e5..08dcd8a97e9b82 100644 --- a/components/dashboard/src/workspaces/RenameWorkspaceModal.tsx +++ b/components/dashboard/src/workspaces/RenameWorkspaceModal.tsx @@ -6,9 +6,9 @@ import { FunctionComponent, useCallback, useState } from "react"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; -import { useUpdateWorkspaceDescriptionMutation } from "../data/workspaces/update-workspace-description-mutation"; import { Button } from "../components/Button"; import { Workspace } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; +import { useUpdateWorkspaceMutation } from "../data/workspaces/update-workspace-mutation"; type Props = { workspace: Workspace; @@ -16,17 +16,17 @@ type Props = { }; export const RenameWorkspaceModal: FunctionComponent = ({ workspace, onClose }) => { const [errorMessage, setErrorMessage] = useState(""); - const [description, setDescription] = useState(workspace.metadata?.name || ""); - const updateDescription = useUpdateWorkspaceDescriptionMutation(); + const [name, setName] = useState(workspace.metadata?.name || ""); + const updateWorkspace = useUpdateWorkspaceMutation(); const updateWorkspaceDescription = useCallback(async () => { try { - if (description.length === 0) { + if (name.length === 0) { setErrorMessage("Description cannot not be empty."); return; } - if (description.length > 250) { + if (name.length > 250) { setErrorMessage("Description is too long for readability."); return; } @@ -34,14 +34,14 @@ export const RenameWorkspaceModal: FunctionComponent = ({ workspace, onCl setErrorMessage(""); // Using mutateAsync here so we can close the modal after it completes successfully - await updateDescription.mutateAsync({ workspaceId: workspace.id, newDescription: description }); + await updateWorkspace.mutateAsync({ workspaceId: workspace.id, metadata: { name } }); // Close the modal onClose(); } catch (error) { setErrorMessage("Something went wrong. Please try renaming again."); } - }, [description, onClose, updateDescription, workspace.id]); + }, [name, onClose, updateWorkspace, workspace.id]); return ( @@ -54,9 +54,9 @@ export const RenameWorkspaceModal: FunctionComponent = ({ workspace, onCl autoFocus className="w-full truncate" type="text" - value={description} - disabled={updateDescription.isLoading} - onChange={(e) => setDescription(e.target.value)} + value={name} + disabled={updateWorkspace.isLoading} + onChange={(e) => setName(e.target.value)} />

Change the description to make it easier to go back to a workspace.

@@ -64,10 +64,10 @@ export const RenameWorkspaceModal: FunctionComponent = ({ workspace, onCl
- - diff --git a/components/dashboard/src/workspaces/WorkspaceOverflowMenu.tsx b/components/dashboard/src/workspaces/WorkspaceOverflowMenu.tsx index 958b0040906fb5..75fd95c87cc574 100644 --- a/components/dashboard/src/workspaces/WorkspaceOverflowMenu.tsx +++ b/components/dashboard/src/workspaces/WorkspaceOverflowMenu.tsx @@ -9,8 +9,6 @@ import { FunctionComponent, useCallback, useMemo, useState } from "react"; import { ContextMenuEntry } from "../components/ContextMenu"; import { ItemFieldContextMenu } from "../components/ItemsList"; import { useStopWorkspaceMutation } from "../data/workspaces/stop-workspace-mutation"; -import { useToggleWorkspacedPinnedMutation } from "../data/workspaces/toggle-workspace-pinned-mutation"; -import { useToggleWorkspaceSharedMutation } from "../data/workspaces/toggle-workspace-shared-mutation"; import ConnectToSSHModal from "./ConnectToSSHModal"; import { DeleteWorkspaceModal } from "./DeleteWorkspaceModal"; import { useToast } from "../components/toasts/Toasts"; @@ -18,6 +16,7 @@ import { RenameWorkspaceModal } from "./RenameWorkspaceModal"; import { AdmissionLevel, Workspace, WorkspacePhase_Phase } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; import { workspaceClient } from "../service/public-api"; import { useOrgSettingsQuery } from "../data/organizations/org-settings-query"; +import { useUpdateWorkspaceMutation } from "../data/workspaces/update-workspace-mutation"; type WorkspaceEntryOverflowMenuProps = { info: Workspace; @@ -36,8 +35,7 @@ export const WorkspaceEntryOverflowMenu: FunctionComponent { - toggleWorkspacePinned.mutate({ + updateWorkspace.mutate({ workspaceId: workspace.id, + metadata: { + pinned: !workspace.metadata?.pinned + } }); - }, [toggleWorkspacePinned, workspace.id]); + }, [updateWorkspace, workspace.id, workspace.metadata?.pinned]); // Can we use `/start#${workspace.id}` instead? const startUrl = useMemo( diff --git a/components/public-api/gitpod/v1/workspace.proto b/components/public-api/gitpod/v1/workspace.proto index ee9b76a8641d61..faf144cafa9040 100644 --- a/components/public-api/gitpod/v1/workspace.proto +++ b/components/public-api/gitpod/v1/workspace.proto @@ -35,6 +35,17 @@ service WorkspaceService { // UpdateWorkspace updates the workspace. rpc UpdateWorkspace(UpdateWorkspaceRequest) returns (UpdateWorkspaceResponse) {} + // StopWorkspace stops a running workspace. + rpc StopWorkspace(StopWorkspaceRequest) returns (StopWorkspaceResponse) {} + + // DeleteWorkspace deletes a workspace. + // When the workspace is running, it will be stopped as well. + // Deleted workspaces cannot be started again. + rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (DeleteWorkspaceResponse) {} + + // ListWorkspaceClasses enumerates all available workspace classes. + rpc ListWorkspaceClasses(ListWorkspaceClassesRequest) returns (ListWorkspaceClassesResponse) {} + // ParseContextURL parses a context URL and returns the workspace metadata and spec. // Not implemented yet. rpc ParseContextURL(ParseContextURLRequest) returns (ParseContextURLResponse) {} @@ -688,6 +699,34 @@ message UpdateWorkspaceResponse { Workspace workspace = 1; } +message StopWorkspaceRequest { + // workspace_id specifies which workspace should be stopped. + // + // +required + string workspace_id = 1; +} + +message StopWorkspaceResponse {} + +message DeleteWorkspaceRequest { + // workspace_id specifies the workspace that is going to delete. + // + // +required + string workspace_id = 1; +} + +message DeleteWorkspaceResponse {} + +message ListWorkspaceClassesRequest { + PaginationRequest pagination = 1; +} + +message ListWorkspaceClassesResponse { + PaginationResponse pagination = 1; + + repeated WorkspaceClass workspace_classes = 2; +} + message ParseContextURLRequest { // context_url is the URL to parse string context_url = 1; @@ -700,3 +739,17 @@ message ParseContextURLResponse { WorkspaceMetadata metadata = 1; WorkspaceSpec spec = 2; } + +message WorkspaceClass { + // id is the unique identifier of the workspace class + string id = 1; + + // display_name is the human readable name of the workspace class + string display_name = 2; + + // description is a human readable description of the workspace class + string description = 3; + + // is_default indicates if this workspace class is the default one + bool is_default = 4; +} diff --git a/components/public-api/go/v1/v1connect/workspace.connect.go b/components/public-api/go/v1/v1connect/workspace.connect.go index b49bbd5e5586ad..fd1e2ca43c816c 100644 --- a/components/public-api/go/v1/v1connect/workspace.connect.go +++ b/components/public-api/go/v1/v1connect/workspace.connect.go @@ -49,6 +49,14 @@ type WorkspaceServiceClient interface { StartWorkspace(context.Context, *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) // UpdateWorkspace updates the workspace. UpdateWorkspace(context.Context, *connect_go.Request[v1.UpdateWorkspaceRequest]) (*connect_go.Response[v1.UpdateWorkspaceResponse], error) + // StopWorkspace stops a running workspace. + StopWorkspace(context.Context, *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) + // DeleteWorkspace deletes a workspace. + // When the workspace is running, it will be stopped as well. + // Deleted workspaces cannot be started again. + DeleteWorkspace(context.Context, *connect_go.Request[v1.DeleteWorkspaceRequest]) (*connect_go.Response[v1.DeleteWorkspaceResponse], error) + // ListWorkspaceClasses enumerates all available workspace classes. + ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) // ParseContextURL parses a context URL and returns the workspace metadata and spec. // Not implemented yet. ParseContextURL(context.Context, *connect_go.Request[v1.ParseContextURLRequest]) (*connect_go.Response[v1.ParseContextURLResponse], error) @@ -104,6 +112,21 @@ func NewWorkspaceServiceClient(httpClient connect_go.HTTPClient, baseURL string, baseURL+"/gitpod.v1.WorkspaceService/UpdateWorkspace", opts..., ), + stopWorkspace: connect_go.NewClient[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse]( + httpClient, + baseURL+"/gitpod.v1.WorkspaceService/StopWorkspace", + opts..., + ), + deleteWorkspace: connect_go.NewClient[v1.DeleteWorkspaceRequest, v1.DeleteWorkspaceResponse]( + httpClient, + baseURL+"/gitpod.v1.WorkspaceService/DeleteWorkspace", + opts..., + ), + listWorkspaceClasses: connect_go.NewClient[v1.ListWorkspaceClassesRequest, v1.ListWorkspaceClassesResponse]( + httpClient, + baseURL+"/gitpod.v1.WorkspaceService/ListWorkspaceClasses", + opts..., + ), parseContextURL: connect_go.NewClient[v1.ParseContextURLRequest, v1.ParseContextURLResponse]( httpClient, baseURL+"/gitpod.v1.WorkspaceService/ParseContextURL", @@ -140,6 +163,9 @@ type workspaceServiceClient struct { createAndStartWorkspace *connect_go.Client[v1.CreateAndStartWorkspaceRequest, v1.CreateAndStartWorkspaceResponse] startWorkspace *connect_go.Client[v1.StartWorkspaceRequest, v1.StartWorkspaceResponse] updateWorkspace *connect_go.Client[v1.UpdateWorkspaceRequest, v1.UpdateWorkspaceResponse] + stopWorkspace *connect_go.Client[v1.StopWorkspaceRequest, v1.StopWorkspaceResponse] + deleteWorkspace *connect_go.Client[v1.DeleteWorkspaceRequest, v1.DeleteWorkspaceResponse] + listWorkspaceClasses *connect_go.Client[v1.ListWorkspaceClassesRequest, v1.ListWorkspaceClassesResponse] parseContextURL *connect_go.Client[v1.ParseContextURLRequest, v1.ParseContextURLResponse] getWorkspaceDefaultImage *connect_go.Client[v1.GetWorkspaceDefaultImageRequest, v1.GetWorkspaceDefaultImageResponse] sendHeartBeat *connect_go.Client[v1.SendHeartBeatRequest, v1.SendHeartBeatResponse] @@ -177,6 +203,21 @@ func (c *workspaceServiceClient) UpdateWorkspace(ctx context.Context, req *conne return c.updateWorkspace.CallUnary(ctx, req) } +// StopWorkspace calls gitpod.v1.WorkspaceService.StopWorkspace. +func (c *workspaceServiceClient) StopWorkspace(ctx context.Context, req *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { + return c.stopWorkspace.CallUnary(ctx, req) +} + +// DeleteWorkspace calls gitpod.v1.WorkspaceService.DeleteWorkspace. +func (c *workspaceServiceClient) DeleteWorkspace(ctx context.Context, req *connect_go.Request[v1.DeleteWorkspaceRequest]) (*connect_go.Response[v1.DeleteWorkspaceResponse], error) { + return c.deleteWorkspace.CallUnary(ctx, req) +} + +// ListWorkspaceClasses calls gitpod.v1.WorkspaceService.ListWorkspaceClasses. +func (c *workspaceServiceClient) ListWorkspaceClasses(ctx context.Context, req *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) { + return c.listWorkspaceClasses.CallUnary(ctx, req) +} + // ParseContextURL calls gitpod.v1.WorkspaceService.ParseContextURL. func (c *workspaceServiceClient) ParseContextURL(ctx context.Context, req *connect_go.Request[v1.ParseContextURLRequest]) (*connect_go.Response[v1.ParseContextURLResponse], error) { return c.parseContextURL.CallUnary(ctx, req) @@ -222,6 +263,14 @@ type WorkspaceServiceHandler interface { StartWorkspace(context.Context, *connect_go.Request[v1.StartWorkspaceRequest]) (*connect_go.Response[v1.StartWorkspaceResponse], error) // UpdateWorkspace updates the workspace. UpdateWorkspace(context.Context, *connect_go.Request[v1.UpdateWorkspaceRequest]) (*connect_go.Response[v1.UpdateWorkspaceResponse], error) + // StopWorkspace stops a running workspace. + StopWorkspace(context.Context, *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) + // DeleteWorkspace deletes a workspace. + // When the workspace is running, it will be stopped as well. + // Deleted workspaces cannot be started again. + DeleteWorkspace(context.Context, *connect_go.Request[v1.DeleteWorkspaceRequest]) (*connect_go.Response[v1.DeleteWorkspaceResponse], error) + // ListWorkspaceClasses enumerates all available workspace classes. + ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) // ParseContextURL parses a context URL and returns the workspace metadata and spec. // Not implemented yet. ParseContextURL(context.Context, *connect_go.Request[v1.ParseContextURLRequest]) (*connect_go.Response[v1.ParseContextURLResponse], error) @@ -274,6 +323,21 @@ func NewWorkspaceServiceHandler(svc WorkspaceServiceHandler, opts ...connect_go. svc.UpdateWorkspace, opts..., )) + mux.Handle("/gitpod.v1.WorkspaceService/StopWorkspace", connect_go.NewUnaryHandler( + "/gitpod.v1.WorkspaceService/StopWorkspace", + svc.StopWorkspace, + opts..., + )) + mux.Handle("/gitpod.v1.WorkspaceService/DeleteWorkspace", connect_go.NewUnaryHandler( + "/gitpod.v1.WorkspaceService/DeleteWorkspace", + svc.DeleteWorkspace, + opts..., + )) + mux.Handle("/gitpod.v1.WorkspaceService/ListWorkspaceClasses", connect_go.NewUnaryHandler( + "/gitpod.v1.WorkspaceService/ListWorkspaceClasses", + svc.ListWorkspaceClasses, + opts..., + )) mux.Handle("/gitpod.v1.WorkspaceService/ParseContextURL", connect_go.NewUnaryHandler( "/gitpod.v1.WorkspaceService/ParseContextURL", svc.ParseContextURL, @@ -329,6 +393,18 @@ func (UnimplementedWorkspaceServiceHandler) UpdateWorkspace(context.Context, *co return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.WorkspaceService.UpdateWorkspace is not implemented")) } +func (UnimplementedWorkspaceServiceHandler) StopWorkspace(context.Context, *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.WorkspaceService.StopWorkspace is not implemented")) +} + +func (UnimplementedWorkspaceServiceHandler) DeleteWorkspace(context.Context, *connect_go.Request[v1.DeleteWorkspaceRequest]) (*connect_go.Response[v1.DeleteWorkspaceResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.WorkspaceService.DeleteWorkspace is not implemented")) +} + +func (UnimplementedWorkspaceServiceHandler) ListWorkspaceClasses(context.Context, *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.WorkspaceService.ListWorkspaceClasses is not implemented")) +} + func (UnimplementedWorkspaceServiceHandler) ParseContextURL(context.Context, *connect_go.Request[v1.ParseContextURLRequest]) (*connect_go.Response[v1.ParseContextURLResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.WorkspaceService.ParseContextURL is not implemented")) } diff --git a/components/public-api/go/v1/v1connect/workspace.proxy.connect.go b/components/public-api/go/v1/v1connect/workspace.proxy.connect.go index eb29bf1072716b..6695019c83da65 100644 --- a/components/public-api/go/v1/v1connect/workspace.proxy.connect.go +++ b/components/public-api/go/v1/v1connect/workspace.proxy.connect.go @@ -69,6 +69,36 @@ func (s *ProxyWorkspaceServiceHandler) UpdateWorkspace(ctx context.Context, req return connect_go.NewResponse(resp), nil } +func (s *ProxyWorkspaceServiceHandler) StopWorkspace(ctx context.Context, req *connect_go.Request[v1.StopWorkspaceRequest]) (*connect_go.Response[v1.StopWorkspaceResponse], error) { + resp, err := s.Client.StopWorkspace(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyWorkspaceServiceHandler) DeleteWorkspace(ctx context.Context, req *connect_go.Request[v1.DeleteWorkspaceRequest]) (*connect_go.Response[v1.DeleteWorkspaceResponse], error) { + resp, err := s.Client.DeleteWorkspace(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyWorkspaceServiceHandler) ListWorkspaceClasses(ctx context.Context, req *connect_go.Request[v1.ListWorkspaceClassesRequest]) (*connect_go.Response[v1.ListWorkspaceClassesResponse], error) { + resp, err := s.Client.ListWorkspaceClasses(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + func (s *ProxyWorkspaceServiceHandler) ParseContextURL(ctx context.Context, req *connect_go.Request[v1.ParseContextURLRequest]) (*connect_go.Response[v1.ParseContextURLResponse], error) { resp, err := s.Client.ParseContextURL(ctx, req.Msg) if err != nil { diff --git a/components/public-api/go/v1/workspace.pb.go b/components/public-api/go/v1/workspace.pb.go index b50c503660c4a9..a0c9ba36ed2a7b 100644 --- a/components/public-api/go/v1/workspace.pb.go +++ b/components/public-api/go/v1/workspace.pb.go @@ -2733,6 +2733,284 @@ func (x *UpdateWorkspaceResponse) GetWorkspace() *Workspace { return nil } +type StopWorkspaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // workspace_id specifies which workspace should be stopped. + // + // +required + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` +} + +func (x *StopWorkspaceRequest) Reset() { + *x = StopWorkspaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopWorkspaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopWorkspaceRequest) ProtoMessage() {} + +func (x *StopWorkspaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopWorkspaceRequest.ProtoReflect.Descriptor instead. +func (*StopWorkspaceRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{33} +} + +func (x *StopWorkspaceRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +type StopWorkspaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StopWorkspaceResponse) Reset() { + *x = StopWorkspaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopWorkspaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopWorkspaceResponse) ProtoMessage() {} + +func (x *StopWorkspaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StopWorkspaceResponse.ProtoReflect.Descriptor instead. +func (*StopWorkspaceResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{34} +} + +type DeleteWorkspaceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // workspace_id specifies the workspace that is going to delete. + // + // +required + WorkspaceId string `protobuf:"bytes,1,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"` +} + +func (x *DeleteWorkspaceRequest) Reset() { + *x = DeleteWorkspaceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteWorkspaceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteWorkspaceRequest) ProtoMessage() {} + +func (x *DeleteWorkspaceRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteWorkspaceRequest.ProtoReflect.Descriptor instead. +func (*DeleteWorkspaceRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{35} +} + +func (x *DeleteWorkspaceRequest) GetWorkspaceId() string { + if x != nil { + return x.WorkspaceId + } + return "" +} + +type DeleteWorkspaceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteWorkspaceResponse) Reset() { + *x = DeleteWorkspaceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteWorkspaceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteWorkspaceResponse) ProtoMessage() {} + +func (x *DeleteWorkspaceResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteWorkspaceResponse.ProtoReflect.Descriptor instead. +func (*DeleteWorkspaceResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{36} +} + +type ListWorkspaceClassesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *ListWorkspaceClassesRequest) Reset() { + *x = ListWorkspaceClassesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWorkspaceClassesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWorkspaceClassesRequest) ProtoMessage() {} + +func (x *ListWorkspaceClassesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListWorkspaceClassesRequest.ProtoReflect.Descriptor instead. +func (*ListWorkspaceClassesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{37} +} + +func (x *ListWorkspaceClassesRequest) GetPagination() *PaginationRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type ListWorkspaceClassesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + WorkspaceClasses []*WorkspaceClass `protobuf:"bytes,2,rep,name=workspace_classes,json=workspaceClasses,proto3" json:"workspace_classes,omitempty"` +} + +func (x *ListWorkspaceClassesResponse) Reset() { + *x = ListWorkspaceClassesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWorkspaceClassesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWorkspaceClassesResponse) ProtoMessage() {} + +func (x *ListWorkspaceClassesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListWorkspaceClassesResponse.ProtoReflect.Descriptor instead. +func (*ListWorkspaceClassesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{38} +} + +func (x *ListWorkspaceClassesResponse) GetPagination() *PaginationResponse { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListWorkspaceClassesResponse) GetWorkspaceClasses() []*WorkspaceClass { + if x != nil { + return x.WorkspaceClasses + } + return nil +} + type ParseContextURLRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2747,7 +3025,7 @@ type ParseContextURLRequest struct { func (x *ParseContextURLRequest) Reset() { *x = ParseContextURLRequest{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[33] + mi := &file_gitpod_v1_workspace_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2760,7 +3038,7 @@ func (x *ParseContextURLRequest) String() string { func (*ParseContextURLRequest) ProtoMessage() {} func (x *ParseContextURLRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[33] + mi := &file_gitpod_v1_workspace_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2773,7 +3051,7 @@ func (x *ParseContextURLRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseContextURLRequest.ProtoReflect.Descriptor instead. func (*ParseContextURLRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{33} + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{39} } func (x *ParseContextURLRequest) GetContextUrl() string { @@ -2802,7 +3080,7 @@ type ParseContextURLResponse struct { func (x *ParseContextURLResponse) Reset() { *x = ParseContextURLResponse{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[34] + mi := &file_gitpod_v1_workspace_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2815,7 +3093,7 @@ func (x *ParseContextURLResponse) String() string { func (*ParseContextURLResponse) ProtoMessage() {} func (x *ParseContextURLResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[34] + mi := &file_gitpod_v1_workspace_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2828,7 +3106,7 @@ func (x *ParseContextURLResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ParseContextURLResponse.ProtoReflect.Descriptor instead. func (*ParseContextURLResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{34} + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{40} } func (x *ParseContextURLResponse) GetMetadata() *WorkspaceMetadata { @@ -2845,6 +3123,81 @@ func (x *ParseContextURLResponse) GetSpec() *WorkspaceSpec { return nil } +type WorkspaceClass struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the unique identifier of the workspace class + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // display_name is the human readable name of the workspace class + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + // description is a human readable description of the workspace class + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // is_default indicates if this workspace class is the default one + IsDefault bool `protobuf:"varint,4,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"` +} + +func (x *WorkspaceClass) Reset() { + *x = WorkspaceClass{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_workspace_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkspaceClass) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkspaceClass) ProtoMessage() {} + +func (x *WorkspaceClass) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_workspace_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WorkspaceClass.ProtoReflect.Descriptor instead. +func (*WorkspaceClass) Descriptor() ([]byte, []int) { + return file_gitpod_v1_workspace_proto_rawDescGZIP(), []int{41} +} + +func (x *WorkspaceClass) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *WorkspaceClass) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *WorkspaceClass) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *WorkspaceClass) GetIsDefault() bool { + if x != nil { + return x.IsDefault + } + return false +} + type CreateAndStartWorkspaceRequest_ContextURL struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2861,7 +3214,7 @@ type CreateAndStartWorkspaceRequest_ContextURL struct { func (x *CreateAndStartWorkspaceRequest_ContextURL) Reset() { *x = CreateAndStartWorkspaceRequest_ContextURL{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[35] + mi := &file_gitpod_v1_workspace_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2874,7 +3227,7 @@ func (x *CreateAndStartWorkspaceRequest_ContextURL) String() string { func (*CreateAndStartWorkspaceRequest_ContextURL) ProtoMessage() {} func (x *CreateAndStartWorkspaceRequest_ContextURL) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[35] + mi := &file_gitpod_v1_workspace_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2929,7 +3282,7 @@ type WorkspaceSpec_Timeout struct { func (x *WorkspaceSpec_Timeout) Reset() { *x = WorkspaceSpec_Timeout{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[37] + mi := &file_gitpod_v1_workspace_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2942,7 +3295,7 @@ func (x *WorkspaceSpec_Timeout) String() string { func (*WorkspaceSpec_Timeout) ProtoMessage() {} func (x *WorkspaceSpec_Timeout) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[37] + mi := &file_gitpod_v1_workspace_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2994,7 +3347,7 @@ type WorkspaceSpec_GitSpec struct { func (x *WorkspaceSpec_GitSpec) Reset() { *x = WorkspaceSpec_GitSpec{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[38] + mi := &file_gitpod_v1_workspace_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3007,7 +3360,7 @@ func (x *WorkspaceSpec_GitSpec) String() string { func (*WorkspaceSpec_GitSpec) ProtoMessage() {} func (x *WorkspaceSpec_GitSpec) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[38] + mi := &file_gitpod_v1_workspace_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3056,7 +3409,7 @@ type WorkspaceStatus_WorkspaceConditions struct { func (x *WorkspaceStatus_WorkspaceConditions) Reset() { *x = WorkspaceStatus_WorkspaceConditions{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[39] + mi := &file_gitpod_v1_workspace_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3069,7 +3422,7 @@ func (x *WorkspaceStatus_WorkspaceConditions) String() string { func (*WorkspaceStatus_WorkspaceConditions) ProtoMessage() {} func (x *WorkspaceStatus_WorkspaceConditions) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[39] + mi := &file_gitpod_v1_workspace_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3121,7 +3474,7 @@ type WorkspaceStatus_PrebuildResult struct { func (x *WorkspaceStatus_PrebuildResult) Reset() { *x = WorkspaceStatus_PrebuildResult{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[40] + mi := &file_gitpod_v1_workspace_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3134,7 +3487,7 @@ func (x *WorkspaceStatus_PrebuildResult) String() string { func (*WorkspaceStatus_PrebuildResult) ProtoMessage() {} func (x *WorkspaceStatus_PrebuildResult) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[40] + mi := &file_gitpod_v1_workspace_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3181,7 +3534,7 @@ type WorkspaceInitializer_Spec struct { func (x *WorkspaceInitializer_Spec) Reset() { *x = WorkspaceInitializer_Spec{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[41] + mi := &file_gitpod_v1_workspace_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3194,7 +3547,7 @@ func (x *WorkspaceInitializer_Spec) String() string { func (*WorkspaceInitializer_Spec) ProtoMessage() {} func (x *WorkspaceInitializer_Spec) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[41] + mi := &file_gitpod_v1_workspace_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3294,7 +3647,7 @@ type GitInitializer_GitConfig struct { func (x *GitInitializer_GitConfig) Reset() { *x = GitInitializer_GitConfig{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[42] + mi := &file_gitpod_v1_workspace_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3307,7 +3660,7 @@ func (x *GitInitializer_GitConfig) String() string { func (*GitInitializer_GitConfig) ProtoMessage() {} func (x *GitInitializer_GitConfig) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[42] + mi := &file_gitpod_v1_workspace_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3378,7 +3731,7 @@ type FileDownloadInitializer_FileInfo struct { func (x *FileDownloadInitializer_FileInfo) Reset() { *x = FileDownloadInitializer_FileInfo{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[44] + mi := &file_gitpod_v1_workspace_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3391,7 +3744,7 @@ func (x *FileDownloadInitializer_FileInfo) String() string { func (*FileDownloadInitializer_FileInfo) ProtoMessage() {} func (x *FileDownloadInitializer_FileInfo) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[44] + mi := &file_gitpod_v1_workspace_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3442,7 +3795,7 @@ type UpdateWorkspaceRequest_UpdateWorkspaceMetadata struct { func (x *UpdateWorkspaceRequest_UpdateWorkspaceMetadata) Reset() { *x = UpdateWorkspaceRequest_UpdateWorkspaceMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[45] + mi := &file_gitpod_v1_workspace_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3455,7 +3808,7 @@ func (x *UpdateWorkspaceRequest_UpdateWorkspaceMetadata) String() string { func (*UpdateWorkspaceRequest_UpdateWorkspaceMetadata) ProtoMessage() {} func (x *UpdateWorkspaceRequest_UpdateWorkspaceMetadata) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[45] + mi := &file_gitpod_v1_workspace_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3499,7 +3852,7 @@ type UpdateWorkspaceRequest_UpdateTimeout struct { func (x *UpdateWorkspaceRequest_UpdateTimeout) Reset() { *x = UpdateWorkspaceRequest_UpdateTimeout{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[46] + mi := &file_gitpod_v1_workspace_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3512,7 +3865,7 @@ func (x *UpdateWorkspaceRequest_UpdateTimeout) String() string { func (*UpdateWorkspaceRequest_UpdateTimeout) ProtoMessage() {} func (x *UpdateWorkspaceRequest_UpdateTimeout) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[46] + mi := &file_gitpod_v1_workspace_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3558,7 +3911,7 @@ type UpdateWorkspaceRequest_UpdateWorkspaceSpec struct { func (x *UpdateWorkspaceRequest_UpdateWorkspaceSpec) Reset() { *x = UpdateWorkspaceRequest_UpdateWorkspaceSpec{} if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_workspace_proto_msgTypes[47] + mi := &file_gitpod_v1_workspace_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3571,7 +3924,7 @@ func (x *UpdateWorkspaceRequest_UpdateWorkspaceSpec) String() string { func (*UpdateWorkspaceRequest_UpdateWorkspaceSpec) ProtoMessage() {} func (x *UpdateWorkspaceRequest_UpdateWorkspaceSpec) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_workspace_proto_msgTypes[47] + mi := &file_gitpod_v1_workspace_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4158,104 +4511,157 @@ var file_gitpod_v1_workspace_proto_rawDesc = []byte{ 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, - 0x64, 0x0a, 0x16, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, - 0x52, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x04, 0x73, - 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, - 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x2a, 0x6f, 0x0a, 0x0e, 0x41, 0x64, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x1b, 0x41, - 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, - 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, - 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, - 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, - 0x45, 0x56, 0x45, 0x52, 0x59, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x32, 0xf5, 0x08, 0x0a, 0x10, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, - 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x14, 0x57, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x69, 0x74, - 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, + 0x39, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x53, 0x74, + 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, + 0x0c, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x49, 0x64, + 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x0a, 0x1b, 0x4c, + 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa5, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x10, + 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, + 0x22, 0x64, 0x0a, 0x16, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x55, 0x52, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x81, 0x01, 0x0a, 0x17, 0x50, 0x61, 0x72, 0x73, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x38, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x84, 0x01, 0x0a, 0x0e, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x2a, 0x6f, 0x0a, 0x0e, 0x41, 0x64, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x1b, 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, + 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x5f, 0x4f, 0x4e, + 0x4c, 0x59, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x44, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x56, 0x45, 0x52, 0x59, 0x4f, 0x4e, 0x45, + 0x10, 0x02, 0x32, 0x92, 0x0b, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x6f, + 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6b, 0x0a, 0x14, 0x57, 0x61, + 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, - 0x57, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x73, 0x12, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x20, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, - 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, - 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x55, 0x52, 0x4c, 0x12, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x52, 0x4c, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x75, 0x0a, - 0x18, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x65, 0x66, - 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, - 0x74, 0x42, 0x65, 0x61, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x16, 0x47, 0x65, - 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x57, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x72, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x29, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, + 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, + 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x53, 0x74, 0x6f, + 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x57, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x5a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x69, 0x0a, 0x14, 0x4c, + 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x6f, 0x72, 0x6b, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x52, 0x4c, 0x12, 0x21, 0x2e, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, + 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x55, 0x52, 0x4c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x75, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x1d, + 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0d, 0x53, 0x65, 0x6e, + 0x64, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x12, 0x1f, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, 0x74, + 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x6f, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x28, 0x2e, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4f, 0x77, 0x6e, 0x65, + 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x84, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x73, 0x12, 0x2f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x64, 0x69, 0x74, 0x6f, + 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x64, 0x69, 0x74, - 0x6f, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x2f, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, - 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x64, 0x69, 0x74, 0x6f, 0x72, 0x43, 0x72, 0x65, - 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, + 0x73, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, + 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -4271,7 +4677,7 @@ func file_gitpod_v1_workspace_proto_rawDescGZIP() []byte { } var file_gitpod_v1_workspace_proto_enumTypes = make([]protoimpl.EnumInfo, 8) -var file_gitpod_v1_workspace_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_gitpod_v1_workspace_proto_msgTypes = make([]protoimpl.MessageInfo, 55) var file_gitpod_v1_workspace_proto_goTypes = []interface{}{ (AdmissionLevel)(0), // 0: gitpod.v1.AdmissionLevel (GetWorkspaceDefaultImageResponse_Source)(0), // 1: gitpod.v1.GetWorkspaceDefaultImageResponse.Source @@ -4314,36 +4720,43 @@ var file_gitpod_v1_workspace_proto_goTypes = []interface{}{ (*GitStatus)(nil), // 38: gitpod.v1.GitStatus (*UpdateWorkspaceRequest)(nil), // 39: gitpod.v1.UpdateWorkspaceRequest (*UpdateWorkspaceResponse)(nil), // 40: gitpod.v1.UpdateWorkspaceResponse - (*ParseContextURLRequest)(nil), // 41: gitpod.v1.ParseContextURLRequest - (*ParseContextURLResponse)(nil), // 42: gitpod.v1.ParseContextURLResponse - (*CreateAndStartWorkspaceRequest_ContextURL)(nil), // 43: gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL - nil, // 44: gitpod.v1.WorkspaceMetadata.AnnotationsEntry - (*WorkspaceSpec_Timeout)(nil), // 45: gitpod.v1.WorkspaceSpec.Timeout - (*WorkspaceSpec_GitSpec)(nil), // 46: gitpod.v1.WorkspaceSpec.GitSpec - (*WorkspaceStatus_WorkspaceConditions)(nil), // 47: gitpod.v1.WorkspaceStatus.WorkspaceConditions - (*WorkspaceStatus_PrebuildResult)(nil), // 48: gitpod.v1.WorkspaceStatus.PrebuildResult - (*WorkspaceInitializer_Spec)(nil), // 49: gitpod.v1.WorkspaceInitializer.Spec - (*GitInitializer_GitConfig)(nil), // 50: gitpod.v1.GitInitializer.GitConfig - nil, // 51: gitpod.v1.GitInitializer.GitConfig.CustomConfigEntry - (*FileDownloadInitializer_FileInfo)(nil), // 52: gitpod.v1.FileDownloadInitializer.FileInfo - (*UpdateWorkspaceRequest_UpdateWorkspaceMetadata)(nil), // 53: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceMetadata - (*UpdateWorkspaceRequest_UpdateTimeout)(nil), // 54: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout - (*UpdateWorkspaceRequest_UpdateWorkspaceSpec)(nil), // 55: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec - (*PaginationRequest)(nil), // 56: gitpod.v1.PaginationRequest - (*PaginationResponse)(nil), // 57: gitpod.v1.PaginationResponse - (*EnvironmentVariable)(nil), // 58: gitpod.v1.EnvironmentVariable - (*timestamppb.Timestamp)(nil), // 59: google.protobuf.Timestamp - (*EditorReference)(nil), // 60: gitpod.v1.EditorReference - (*durationpb.Duration)(nil), // 61: google.protobuf.Duration + (*StopWorkspaceRequest)(nil), // 41: gitpod.v1.StopWorkspaceRequest + (*StopWorkspaceResponse)(nil), // 42: gitpod.v1.StopWorkspaceResponse + (*DeleteWorkspaceRequest)(nil), // 43: gitpod.v1.DeleteWorkspaceRequest + (*DeleteWorkspaceResponse)(nil), // 44: gitpod.v1.DeleteWorkspaceResponse + (*ListWorkspaceClassesRequest)(nil), // 45: gitpod.v1.ListWorkspaceClassesRequest + (*ListWorkspaceClassesResponse)(nil), // 46: gitpod.v1.ListWorkspaceClassesResponse + (*ParseContextURLRequest)(nil), // 47: gitpod.v1.ParseContextURLRequest + (*ParseContextURLResponse)(nil), // 48: gitpod.v1.ParseContextURLResponse + (*WorkspaceClass)(nil), // 49: gitpod.v1.WorkspaceClass + (*CreateAndStartWorkspaceRequest_ContextURL)(nil), // 50: gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL + nil, // 51: gitpod.v1.WorkspaceMetadata.AnnotationsEntry + (*WorkspaceSpec_Timeout)(nil), // 52: gitpod.v1.WorkspaceSpec.Timeout + (*WorkspaceSpec_GitSpec)(nil), // 53: gitpod.v1.WorkspaceSpec.GitSpec + (*WorkspaceStatus_WorkspaceConditions)(nil), // 54: gitpod.v1.WorkspaceStatus.WorkspaceConditions + (*WorkspaceStatus_PrebuildResult)(nil), // 55: gitpod.v1.WorkspaceStatus.PrebuildResult + (*WorkspaceInitializer_Spec)(nil), // 56: gitpod.v1.WorkspaceInitializer.Spec + (*GitInitializer_GitConfig)(nil), // 57: gitpod.v1.GitInitializer.GitConfig + nil, // 58: gitpod.v1.GitInitializer.GitConfig.CustomConfigEntry + (*FileDownloadInitializer_FileInfo)(nil), // 59: gitpod.v1.FileDownloadInitializer.FileInfo + (*UpdateWorkspaceRequest_UpdateWorkspaceMetadata)(nil), // 60: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceMetadata + (*UpdateWorkspaceRequest_UpdateTimeout)(nil), // 61: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout + (*UpdateWorkspaceRequest_UpdateWorkspaceSpec)(nil), // 62: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec + (*PaginationRequest)(nil), // 63: gitpod.v1.PaginationRequest + (*PaginationResponse)(nil), // 64: gitpod.v1.PaginationResponse + (*EnvironmentVariable)(nil), // 65: gitpod.v1.EnvironmentVariable + (*timestamppb.Timestamp)(nil), // 66: google.protobuf.Timestamp + (*EditorReference)(nil), // 67: gitpod.v1.EditorReference + (*durationpb.Duration)(nil), // 68: google.protobuf.Duration } var file_gitpod_v1_workspace_proto_depIdxs = []int32{ 26, // 0: gitpod.v1.GetWorkspaceResponse.workspace:type_name -> gitpod.v1.Workspace 29, // 1: gitpod.v1.WatchWorkspaceStatusResponse.status:type_name -> gitpod.v1.WorkspaceStatus - 56, // 2: gitpod.v1.ListWorkspacesRequest.pagination:type_name -> gitpod.v1.PaginationRequest - 57, // 3: gitpod.v1.ListWorkspacesResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 63, // 2: gitpod.v1.ListWorkspacesRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 64, // 3: gitpod.v1.ListWorkspacesResponse.pagination:type_name -> gitpod.v1.PaginationResponse 26, // 4: gitpod.v1.ListWorkspacesResponse.workspaces:type_name -> gitpod.v1.Workspace 27, // 5: gitpod.v1.CreateAndStartWorkspaceRequest.metadata:type_name -> gitpod.v1.WorkspaceMetadata - 43, // 6: gitpod.v1.CreateAndStartWorkspaceRequest.context_url:type_name -> gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL + 50, // 6: gitpod.v1.CreateAndStartWorkspaceRequest.context_url:type_name -> gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL 28, // 7: gitpod.v1.CreateAndStartWorkspaceRequest.spec:type_name -> gitpod.v1.WorkspaceSpec 26, // 8: gitpod.v1.CreateAndStartWorkspaceResponse.workspace:type_name -> gitpod.v1.Workspace 26, // 9: gitpod.v1.StartWorkspaceResponse.workspace:type_name -> gitpod.v1.Workspace @@ -4351,76 +4764,85 @@ var file_gitpod_v1_workspace_proto_depIdxs = []int32{ 27, // 11: gitpod.v1.Workspace.metadata:type_name -> gitpod.v1.WorkspaceMetadata 28, // 12: gitpod.v1.Workspace.spec:type_name -> gitpod.v1.WorkspaceSpec 29, // 13: gitpod.v1.Workspace.status:type_name -> gitpod.v1.WorkspaceStatus - 44, // 14: gitpod.v1.WorkspaceMetadata.annotations:type_name -> gitpod.v1.WorkspaceMetadata.AnnotationsEntry + 51, // 14: gitpod.v1.WorkspaceMetadata.annotations:type_name -> gitpod.v1.WorkspaceMetadata.AnnotationsEntry 33, // 15: gitpod.v1.WorkspaceSpec.initializer:type_name -> gitpod.v1.WorkspaceInitializer 2, // 16: gitpod.v1.WorkspaceSpec.type:type_name -> gitpod.v1.WorkspaceSpec.WorkspaceType 30, // 17: gitpod.v1.WorkspaceSpec.ports:type_name -> gitpod.v1.WorkspacePort - 58, // 18: gitpod.v1.WorkspaceSpec.environment_variables:type_name -> gitpod.v1.EnvironmentVariable - 46, // 19: gitpod.v1.WorkspaceSpec.git:type_name -> gitpod.v1.WorkspaceSpec.GitSpec - 45, // 20: gitpod.v1.WorkspaceSpec.timeout:type_name -> gitpod.v1.WorkspaceSpec.Timeout + 65, // 18: gitpod.v1.WorkspaceSpec.environment_variables:type_name -> gitpod.v1.EnvironmentVariable + 53, // 19: gitpod.v1.WorkspaceSpec.git:type_name -> gitpod.v1.WorkspaceSpec.GitSpec + 52, // 20: gitpod.v1.WorkspaceSpec.timeout:type_name -> gitpod.v1.WorkspaceSpec.Timeout 0, // 21: gitpod.v1.WorkspaceSpec.admission:type_name -> gitpod.v1.AdmissionLevel - 59, // 22: gitpod.v1.WorkspaceSpec.last_user_activity:type_name -> google.protobuf.Timestamp - 60, // 23: gitpod.v1.WorkspaceSpec.editor:type_name -> gitpod.v1.EditorReference + 66, // 22: gitpod.v1.WorkspaceSpec.last_user_activity:type_name -> google.protobuf.Timestamp + 67, // 23: gitpod.v1.WorkspaceSpec.editor:type_name -> gitpod.v1.EditorReference 32, // 24: gitpod.v1.WorkspaceStatus.phase:type_name -> gitpod.v1.WorkspacePhase - 47, // 25: gitpod.v1.WorkspaceStatus.conditions:type_name -> gitpod.v1.WorkspaceStatus.WorkspaceConditions - 48, // 26: gitpod.v1.WorkspaceStatus.prebuild_result:type_name -> gitpod.v1.WorkspaceStatus.PrebuildResult + 54, // 25: gitpod.v1.WorkspaceStatus.conditions:type_name -> gitpod.v1.WorkspaceStatus.WorkspaceConditions + 55, // 26: gitpod.v1.WorkspaceStatus.prebuild_result:type_name -> gitpod.v1.WorkspaceStatus.PrebuildResult 31, // 27: gitpod.v1.WorkspaceStatus.git_status:type_name -> gitpod.v1.WorkspaceGitStatus 0, // 28: gitpod.v1.WorkspacePort.admission:type_name -> gitpod.v1.AdmissionLevel 4, // 29: gitpod.v1.WorkspacePort.protocol:type_name -> gitpod.v1.WorkspacePort.Protocol 5, // 30: gitpod.v1.WorkspacePhase.name:type_name -> gitpod.v1.WorkspacePhase.Phase - 59, // 31: gitpod.v1.WorkspacePhase.last_transition_time:type_name -> google.protobuf.Timestamp - 49, // 32: gitpod.v1.WorkspaceInitializer.specs:type_name -> gitpod.v1.WorkspaceInitializer.Spec + 66, // 31: gitpod.v1.WorkspacePhase.last_transition_time:type_name -> google.protobuf.Timestamp + 56, // 32: gitpod.v1.WorkspaceInitializer.specs:type_name -> gitpod.v1.WorkspaceInitializer.Spec 6, // 33: gitpod.v1.GitInitializer.target_mode:type_name -> gitpod.v1.GitInitializer.CloneTargetMode - 50, // 34: gitpod.v1.GitInitializer.config:type_name -> gitpod.v1.GitInitializer.GitConfig - 52, // 35: gitpod.v1.FileDownloadInitializer.files:type_name -> gitpod.v1.FileDownloadInitializer.FileInfo - 53, // 36: gitpod.v1.UpdateWorkspaceRequest.metadata:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceMetadata - 55, // 37: gitpod.v1.UpdateWorkspaceRequest.spec:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec + 57, // 34: gitpod.v1.GitInitializer.config:type_name -> gitpod.v1.GitInitializer.GitConfig + 59, // 35: gitpod.v1.FileDownloadInitializer.files:type_name -> gitpod.v1.FileDownloadInitializer.FileInfo + 60, // 36: gitpod.v1.UpdateWorkspaceRequest.metadata:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceMetadata + 62, // 37: gitpod.v1.UpdateWorkspaceRequest.spec:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec 31, // 38: gitpod.v1.UpdateWorkspaceRequest.git_status:type_name -> gitpod.v1.WorkspaceGitStatus 26, // 39: gitpod.v1.UpdateWorkspaceResponse.workspace:type_name -> gitpod.v1.Workspace - 27, // 40: gitpod.v1.ParseContextURLResponse.metadata:type_name -> gitpod.v1.WorkspaceMetadata - 28, // 41: gitpod.v1.ParseContextURLResponse.spec:type_name -> gitpod.v1.WorkspaceSpec - 60, // 42: gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL.editor:type_name -> gitpod.v1.EditorReference - 61, // 43: gitpod.v1.WorkspaceSpec.Timeout.inactivity:type_name -> google.protobuf.Duration - 61, // 44: gitpod.v1.WorkspaceSpec.Timeout.disconnected:type_name -> google.protobuf.Duration - 61, // 45: gitpod.v1.WorkspaceSpec.Timeout.maximum_lifetime:type_name -> google.protobuf.Duration - 3, // 46: gitpod.v1.WorkspaceStatus.WorkspaceConditions.failed_reason:type_name -> gitpod.v1.WorkspaceStatus.WorkspaceConditions.FailedReason - 34, // 47: gitpod.v1.WorkspaceInitializer.Spec.git:type_name -> gitpod.v1.GitInitializer - 35, // 48: gitpod.v1.WorkspaceInitializer.Spec.snapshot:type_name -> gitpod.v1.SnapshotInitializer - 36, // 49: gitpod.v1.WorkspaceInitializer.Spec.prebuild:type_name -> gitpod.v1.PrebuildInitializer - 37, // 50: gitpod.v1.WorkspaceInitializer.Spec.download:type_name -> gitpod.v1.FileDownloadInitializer - 51, // 51: gitpod.v1.GitInitializer.GitConfig.custom_config:type_name -> gitpod.v1.GitInitializer.GitConfig.CustomConfigEntry - 7, // 52: gitpod.v1.GitInitializer.GitConfig.authentication:type_name -> gitpod.v1.GitInitializer.AuthMethod - 61, // 53: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout.inactivity:type_name -> google.protobuf.Duration - 61, // 54: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout.disconnected:type_name -> google.protobuf.Duration - 54, // 55: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec.timeout:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout - 0, // 56: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec.admission:type_name -> gitpod.v1.AdmissionLevel - 8, // 57: gitpod.v1.WorkspaceService.GetWorkspace:input_type -> gitpod.v1.GetWorkspaceRequest - 10, // 58: gitpod.v1.WorkspaceService.WatchWorkspaceStatus:input_type -> gitpod.v1.WatchWorkspaceStatusRequest - 12, // 59: gitpod.v1.WorkspaceService.ListWorkspaces:input_type -> gitpod.v1.ListWorkspacesRequest - 14, // 60: gitpod.v1.WorkspaceService.CreateAndStartWorkspace:input_type -> gitpod.v1.CreateAndStartWorkspaceRequest - 16, // 61: gitpod.v1.WorkspaceService.StartWorkspace:input_type -> gitpod.v1.StartWorkspaceRequest - 39, // 62: gitpod.v1.WorkspaceService.UpdateWorkspace:input_type -> gitpod.v1.UpdateWorkspaceRequest - 41, // 63: gitpod.v1.WorkspaceService.ParseContextURL:input_type -> gitpod.v1.ParseContextURLRequest - 18, // 64: gitpod.v1.WorkspaceService.GetWorkspaceDefaultImage:input_type -> gitpod.v1.GetWorkspaceDefaultImageRequest - 20, // 65: gitpod.v1.WorkspaceService.SendHeartBeat:input_type -> gitpod.v1.SendHeartBeatRequest - 22, // 66: gitpod.v1.WorkspaceService.GetWorkspaceOwnerToken:input_type -> gitpod.v1.GetWorkspaceOwnerTokenRequest - 24, // 67: gitpod.v1.WorkspaceService.GetWorkspaceEditorCredentials:input_type -> gitpod.v1.GetWorkspaceEditorCredentialsRequest - 9, // 68: gitpod.v1.WorkspaceService.GetWorkspace:output_type -> gitpod.v1.GetWorkspaceResponse - 11, // 69: gitpod.v1.WorkspaceService.WatchWorkspaceStatus:output_type -> gitpod.v1.WatchWorkspaceStatusResponse - 13, // 70: gitpod.v1.WorkspaceService.ListWorkspaces:output_type -> gitpod.v1.ListWorkspacesResponse - 15, // 71: gitpod.v1.WorkspaceService.CreateAndStartWorkspace:output_type -> gitpod.v1.CreateAndStartWorkspaceResponse - 17, // 72: gitpod.v1.WorkspaceService.StartWorkspace:output_type -> gitpod.v1.StartWorkspaceResponse - 40, // 73: gitpod.v1.WorkspaceService.UpdateWorkspace:output_type -> gitpod.v1.UpdateWorkspaceResponse - 42, // 74: gitpod.v1.WorkspaceService.ParseContextURL:output_type -> gitpod.v1.ParseContextURLResponse - 19, // 75: gitpod.v1.WorkspaceService.GetWorkspaceDefaultImage:output_type -> gitpod.v1.GetWorkspaceDefaultImageResponse - 21, // 76: gitpod.v1.WorkspaceService.SendHeartBeat:output_type -> gitpod.v1.SendHeartBeatResponse - 23, // 77: gitpod.v1.WorkspaceService.GetWorkspaceOwnerToken:output_type -> gitpod.v1.GetWorkspaceOwnerTokenResponse - 25, // 78: gitpod.v1.WorkspaceService.GetWorkspaceEditorCredentials:output_type -> gitpod.v1.GetWorkspaceEditorCredentialsResponse - 68, // [68:79] is the sub-list for method output_type - 57, // [57:68] is the sub-list for method input_type - 57, // [57:57] is the sub-list for extension type_name - 57, // [57:57] is the sub-list for extension extendee - 0, // [0:57] is the sub-list for field type_name + 63, // 40: gitpod.v1.ListWorkspaceClassesRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 64, // 41: gitpod.v1.ListWorkspaceClassesResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 49, // 42: gitpod.v1.ListWorkspaceClassesResponse.workspace_classes:type_name -> gitpod.v1.WorkspaceClass + 27, // 43: gitpod.v1.ParseContextURLResponse.metadata:type_name -> gitpod.v1.WorkspaceMetadata + 28, // 44: gitpod.v1.ParseContextURLResponse.spec:type_name -> gitpod.v1.WorkspaceSpec + 67, // 45: gitpod.v1.CreateAndStartWorkspaceRequest.ContextURL.editor:type_name -> gitpod.v1.EditorReference + 68, // 46: gitpod.v1.WorkspaceSpec.Timeout.inactivity:type_name -> google.protobuf.Duration + 68, // 47: gitpod.v1.WorkspaceSpec.Timeout.disconnected:type_name -> google.protobuf.Duration + 68, // 48: gitpod.v1.WorkspaceSpec.Timeout.maximum_lifetime:type_name -> google.protobuf.Duration + 3, // 49: gitpod.v1.WorkspaceStatus.WorkspaceConditions.failed_reason:type_name -> gitpod.v1.WorkspaceStatus.WorkspaceConditions.FailedReason + 34, // 50: gitpod.v1.WorkspaceInitializer.Spec.git:type_name -> gitpod.v1.GitInitializer + 35, // 51: gitpod.v1.WorkspaceInitializer.Spec.snapshot:type_name -> gitpod.v1.SnapshotInitializer + 36, // 52: gitpod.v1.WorkspaceInitializer.Spec.prebuild:type_name -> gitpod.v1.PrebuildInitializer + 37, // 53: gitpod.v1.WorkspaceInitializer.Spec.download:type_name -> gitpod.v1.FileDownloadInitializer + 58, // 54: gitpod.v1.GitInitializer.GitConfig.custom_config:type_name -> gitpod.v1.GitInitializer.GitConfig.CustomConfigEntry + 7, // 55: gitpod.v1.GitInitializer.GitConfig.authentication:type_name -> gitpod.v1.GitInitializer.AuthMethod + 68, // 56: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout.inactivity:type_name -> google.protobuf.Duration + 68, // 57: gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout.disconnected:type_name -> google.protobuf.Duration + 61, // 58: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec.timeout:type_name -> gitpod.v1.UpdateWorkspaceRequest.UpdateTimeout + 0, // 59: gitpod.v1.UpdateWorkspaceRequest.UpdateWorkspaceSpec.admission:type_name -> gitpod.v1.AdmissionLevel + 8, // 60: gitpod.v1.WorkspaceService.GetWorkspace:input_type -> gitpod.v1.GetWorkspaceRequest + 10, // 61: gitpod.v1.WorkspaceService.WatchWorkspaceStatus:input_type -> gitpod.v1.WatchWorkspaceStatusRequest + 12, // 62: gitpod.v1.WorkspaceService.ListWorkspaces:input_type -> gitpod.v1.ListWorkspacesRequest + 14, // 63: gitpod.v1.WorkspaceService.CreateAndStartWorkspace:input_type -> gitpod.v1.CreateAndStartWorkspaceRequest + 16, // 64: gitpod.v1.WorkspaceService.StartWorkspace:input_type -> gitpod.v1.StartWorkspaceRequest + 39, // 65: gitpod.v1.WorkspaceService.UpdateWorkspace:input_type -> gitpod.v1.UpdateWorkspaceRequest + 41, // 66: gitpod.v1.WorkspaceService.StopWorkspace:input_type -> gitpod.v1.StopWorkspaceRequest + 43, // 67: gitpod.v1.WorkspaceService.DeleteWorkspace:input_type -> gitpod.v1.DeleteWorkspaceRequest + 45, // 68: gitpod.v1.WorkspaceService.ListWorkspaceClasses:input_type -> gitpod.v1.ListWorkspaceClassesRequest + 47, // 69: gitpod.v1.WorkspaceService.ParseContextURL:input_type -> gitpod.v1.ParseContextURLRequest + 18, // 70: gitpod.v1.WorkspaceService.GetWorkspaceDefaultImage:input_type -> gitpod.v1.GetWorkspaceDefaultImageRequest + 20, // 71: gitpod.v1.WorkspaceService.SendHeartBeat:input_type -> gitpod.v1.SendHeartBeatRequest + 22, // 72: gitpod.v1.WorkspaceService.GetWorkspaceOwnerToken:input_type -> gitpod.v1.GetWorkspaceOwnerTokenRequest + 24, // 73: gitpod.v1.WorkspaceService.GetWorkspaceEditorCredentials:input_type -> gitpod.v1.GetWorkspaceEditorCredentialsRequest + 9, // 74: gitpod.v1.WorkspaceService.GetWorkspace:output_type -> gitpod.v1.GetWorkspaceResponse + 11, // 75: gitpod.v1.WorkspaceService.WatchWorkspaceStatus:output_type -> gitpod.v1.WatchWorkspaceStatusResponse + 13, // 76: gitpod.v1.WorkspaceService.ListWorkspaces:output_type -> gitpod.v1.ListWorkspacesResponse + 15, // 77: gitpod.v1.WorkspaceService.CreateAndStartWorkspace:output_type -> gitpod.v1.CreateAndStartWorkspaceResponse + 17, // 78: gitpod.v1.WorkspaceService.StartWorkspace:output_type -> gitpod.v1.StartWorkspaceResponse + 40, // 79: gitpod.v1.WorkspaceService.UpdateWorkspace:output_type -> gitpod.v1.UpdateWorkspaceResponse + 42, // 80: gitpod.v1.WorkspaceService.StopWorkspace:output_type -> gitpod.v1.StopWorkspaceResponse + 44, // 81: gitpod.v1.WorkspaceService.DeleteWorkspace:output_type -> gitpod.v1.DeleteWorkspaceResponse + 46, // 82: gitpod.v1.WorkspaceService.ListWorkspaceClasses:output_type -> gitpod.v1.ListWorkspaceClassesResponse + 48, // 83: gitpod.v1.WorkspaceService.ParseContextURL:output_type -> gitpod.v1.ParseContextURLResponse + 19, // 84: gitpod.v1.WorkspaceService.GetWorkspaceDefaultImage:output_type -> gitpod.v1.GetWorkspaceDefaultImageResponse + 21, // 85: gitpod.v1.WorkspaceService.SendHeartBeat:output_type -> gitpod.v1.SendHeartBeatResponse + 23, // 86: gitpod.v1.WorkspaceService.GetWorkspaceOwnerToken:output_type -> gitpod.v1.GetWorkspaceOwnerTokenResponse + 25, // 87: gitpod.v1.WorkspaceService.GetWorkspaceEditorCredentials:output_type -> gitpod.v1.GetWorkspaceEditorCredentialsResponse + 74, // [74:88] is the sub-list for method output_type + 60, // [60:74] is the sub-list for method input_type + 60, // [60:60] is the sub-list for extension type_name + 60, // [60:60] is the sub-list for extension extendee + 0, // [0:60] is the sub-list for field type_name } func init() { file_gitpod_v1_workspace_proto_init() } @@ -4829,7 +5251,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseContextURLRequest); i { + switch v := v.(*StopWorkspaceRequest); i { case 0: return &v.state case 1: @@ -4841,7 +5263,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseContextURLResponse); i { + switch v := v.(*StopWorkspaceResponse); i { case 0: return &v.state case 1: @@ -4853,7 +5275,19 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAndStartWorkspaceRequest_ContextURL); i { + switch v := v.(*DeleteWorkspaceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteWorkspaceResponse); i { case 0: return &v.state case 1: @@ -4865,7 +5299,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceSpec_Timeout); i { + switch v := v.(*ListWorkspaceClassesRequest); i { case 0: return &v.state case 1: @@ -4877,7 +5311,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceSpec_GitSpec); i { + switch v := v.(*ListWorkspaceClassesResponse); i { case 0: return &v.state case 1: @@ -4889,7 +5323,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceStatus_WorkspaceConditions); i { + switch v := v.(*ParseContextURLRequest); i { case 0: return &v.state case 1: @@ -4901,7 +5335,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceStatus_PrebuildResult); i { + switch v := v.(*ParseContextURLResponse); i { case 0: return &v.state case 1: @@ -4913,7 +5347,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkspaceInitializer_Spec); i { + switch v := v.(*WorkspaceClass); i { case 0: return &v.state case 1: @@ -4925,7 +5359,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitInitializer_GitConfig); i { + switch v := v.(*CreateAndStartWorkspaceRequest_ContextURL); i { case 0: return &v.state case 1: @@ -4937,7 +5371,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileDownloadInitializer_FileInfo); i { + switch v := v.(*WorkspaceSpec_Timeout); i { case 0: return &v.state case 1: @@ -4949,7 +5383,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateWorkspaceRequest_UpdateWorkspaceMetadata); i { + switch v := v.(*WorkspaceSpec_GitSpec); i { case 0: return &v.state case 1: @@ -4961,7 +5395,7 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateWorkspaceRequest_UpdateTimeout); i { + switch v := v.(*WorkspaceStatus_WorkspaceConditions); i { case 0: return &v.state case 1: @@ -4973,6 +5407,78 @@ func file_gitpod_v1_workspace_proto_init() { } } file_gitpod_v1_workspace_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceStatus_PrebuildResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceInitializer_Spec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GitInitializer_GitConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FileDownloadInitializer_FileInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateWorkspaceRequest_UpdateWorkspaceMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateWorkspaceRequest_UpdateTimeout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_workspace_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateWorkspaceRequest_UpdateWorkspaceSpec); i { case 0: return &v.state @@ -4990,22 +5496,22 @@ func file_gitpod_v1_workspace_proto_init() { (*CreateAndStartWorkspaceRequest_Spec)(nil), } file_gitpod_v1_workspace_proto_msgTypes[31].OneofWrappers = []interface{}{} - file_gitpod_v1_workspace_proto_msgTypes[41].OneofWrappers = []interface{}{ + file_gitpod_v1_workspace_proto_msgTypes[48].OneofWrappers = []interface{}{ (*WorkspaceInitializer_Spec_Git)(nil), (*WorkspaceInitializer_Spec_Snapshot)(nil), (*WorkspaceInitializer_Spec_Prebuild)(nil), (*WorkspaceInitializer_Spec_Download)(nil), } - file_gitpod_v1_workspace_proto_msgTypes[45].OneofWrappers = []interface{}{} - file_gitpod_v1_workspace_proto_msgTypes[46].OneofWrappers = []interface{}{} - file_gitpod_v1_workspace_proto_msgTypes[47].OneofWrappers = []interface{}{} + file_gitpod_v1_workspace_proto_msgTypes[52].OneofWrappers = []interface{}{} + file_gitpod_v1_workspace_proto_msgTypes[53].OneofWrappers = []interface{}{} + file_gitpod_v1_workspace_proto_msgTypes[54].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_v1_workspace_proto_rawDesc, NumEnums: 8, - NumMessages: 48, + NumMessages: 55, NumExtensions: 0, NumServices: 1, }, diff --git a/components/public-api/go/v1/workspace_grpc.pb.go b/components/public-api/go/v1/workspace_grpc.pb.go index c4133ffe27fff2..5811c791c51749 100644 --- a/components/public-api/go/v1/workspace_grpc.pb.go +++ b/components/public-api/go/v1/workspace_grpc.pb.go @@ -44,6 +44,14 @@ type WorkspaceServiceClient interface { StartWorkspace(ctx context.Context, in *StartWorkspaceRequest, opts ...grpc.CallOption) (*StartWorkspaceResponse, error) // UpdateWorkspace updates the workspace. UpdateWorkspace(ctx context.Context, in *UpdateWorkspaceRequest, opts ...grpc.CallOption) (*UpdateWorkspaceResponse, error) + // StopWorkspace stops a running workspace. + StopWorkspace(ctx context.Context, in *StopWorkspaceRequest, opts ...grpc.CallOption) (*StopWorkspaceResponse, error) + // DeleteWorkspace deletes a workspace. + // When the workspace is running, it will be stopped as well. + // Deleted workspaces cannot be started again. + DeleteWorkspace(ctx context.Context, in *DeleteWorkspaceRequest, opts ...grpc.CallOption) (*DeleteWorkspaceResponse, error) + // ListWorkspaceClasses enumerates all available workspace classes. + ListWorkspaceClasses(ctx context.Context, in *ListWorkspaceClassesRequest, opts ...grpc.CallOption) (*ListWorkspaceClassesResponse, error) // ParseContextURL parses a context URL and returns the workspace metadata and spec. // Not implemented yet. ParseContextURL(ctx context.Context, in *ParseContextURLRequest, opts ...grpc.CallOption) (*ParseContextURLResponse, error) @@ -144,6 +152,33 @@ func (c *workspaceServiceClient) UpdateWorkspace(ctx context.Context, in *Update return out, nil } +func (c *workspaceServiceClient) StopWorkspace(ctx context.Context, in *StopWorkspaceRequest, opts ...grpc.CallOption) (*StopWorkspaceResponse, error) { + out := new(StopWorkspaceResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.WorkspaceService/StopWorkspace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workspaceServiceClient) DeleteWorkspace(ctx context.Context, in *DeleteWorkspaceRequest, opts ...grpc.CallOption) (*DeleteWorkspaceResponse, error) { + out := new(DeleteWorkspaceResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.WorkspaceService/DeleteWorkspace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *workspaceServiceClient) ListWorkspaceClasses(ctx context.Context, in *ListWorkspaceClassesRequest, opts ...grpc.CallOption) (*ListWorkspaceClassesResponse, error) { + out := new(ListWorkspaceClassesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.WorkspaceService/ListWorkspaceClasses", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *workspaceServiceClient) ParseContextURL(ctx context.Context, in *ParseContextURLRequest, opts ...grpc.CallOption) (*ParseContextURLResponse, error) { out := new(ParseContextURLResponse) err := c.cc.Invoke(ctx, "/gitpod.v1.WorkspaceService/ParseContextURL", in, out, opts...) @@ -211,6 +246,14 @@ type WorkspaceServiceServer interface { StartWorkspace(context.Context, *StartWorkspaceRequest) (*StartWorkspaceResponse, error) // UpdateWorkspace updates the workspace. UpdateWorkspace(context.Context, *UpdateWorkspaceRequest) (*UpdateWorkspaceResponse, error) + // StopWorkspace stops a running workspace. + StopWorkspace(context.Context, *StopWorkspaceRequest) (*StopWorkspaceResponse, error) + // DeleteWorkspace deletes a workspace. + // When the workspace is running, it will be stopped as well. + // Deleted workspaces cannot be started again. + DeleteWorkspace(context.Context, *DeleteWorkspaceRequest) (*DeleteWorkspaceResponse, error) + // ListWorkspaceClasses enumerates all available workspace classes. + ListWorkspaceClasses(context.Context, *ListWorkspaceClassesRequest) (*ListWorkspaceClassesResponse, error) // ParseContextURL parses a context URL and returns the workspace metadata and spec. // Not implemented yet. ParseContextURL(context.Context, *ParseContextURLRequest) (*ParseContextURLResponse, error) @@ -249,6 +292,15 @@ func (UnimplementedWorkspaceServiceServer) StartWorkspace(context.Context, *Star func (UnimplementedWorkspaceServiceServer) UpdateWorkspace(context.Context, *UpdateWorkspaceRequest) (*UpdateWorkspaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkspace not implemented") } +func (UnimplementedWorkspaceServiceServer) StopWorkspace(context.Context, *StopWorkspaceRequest) (*StopWorkspaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopWorkspace not implemented") +} +func (UnimplementedWorkspaceServiceServer) DeleteWorkspace(context.Context, *DeleteWorkspaceRequest) (*DeleteWorkspaceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteWorkspace not implemented") +} +func (UnimplementedWorkspaceServiceServer) ListWorkspaceClasses(context.Context, *ListWorkspaceClassesRequest) (*ListWorkspaceClassesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListWorkspaceClasses not implemented") +} func (UnimplementedWorkspaceServiceServer) ParseContextURL(context.Context, *ParseContextURLRequest) (*ParseContextURLResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ParseContextURL not implemented") } @@ -388,6 +440,60 @@ func _WorkspaceService_UpdateWorkspace_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _WorkspaceService_StopWorkspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StopWorkspaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkspaceServiceServer).StopWorkspace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.WorkspaceService/StopWorkspace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkspaceServiceServer).StopWorkspace(ctx, req.(*StopWorkspaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkspaceService_DeleteWorkspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteWorkspaceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkspaceServiceServer).DeleteWorkspace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.WorkspaceService/DeleteWorkspace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkspaceServiceServer).DeleteWorkspace(ctx, req.(*DeleteWorkspaceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WorkspaceService_ListWorkspaceClasses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListWorkspaceClassesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkspaceServiceServer).ListWorkspaceClasses(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.WorkspaceService/ListWorkspaceClasses", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkspaceServiceServer).ListWorkspaceClasses(ctx, req.(*ListWorkspaceClassesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _WorkspaceService_ParseContextURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ParseContextURLRequest) if err := dec(in); err != nil { @@ -505,6 +611,18 @@ var WorkspaceService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateWorkspace", Handler: _WorkspaceService_UpdateWorkspace_Handler, }, + { + MethodName: "StopWorkspace", + Handler: _WorkspaceService_StopWorkspace_Handler, + }, + { + MethodName: "DeleteWorkspace", + Handler: _WorkspaceService_DeleteWorkspace_Handler, + }, + { + MethodName: "ListWorkspaceClasses", + Handler: _WorkspaceService_ListWorkspaceClasses_Handler, + }, { MethodName: "ParseContextURL", Handler: _WorkspaceService_ParseContextURL_Handler, diff --git a/components/public-api/typescript-common/src/public-api-converter.ts b/components/public-api/typescript-common/src/public-api-converter.ts index 4cb926f36cac1c..bd76eaac227f9b 100644 --- a/components/public-api/typescript-common/src/public-api-converter.ts +++ b/components/public-api/typescript-common/src/public-api-converter.ts @@ -45,6 +45,7 @@ import { SnapshotInitializer, UpdateWorkspaceRequest_UpdateTimeout, Workspace, + WorkspaceClass, WorkspaceGitStatus, WorkspaceInitializer, WorkspaceInitializer_Spec, @@ -119,6 +120,7 @@ import { import { Author, Commit } from "@gitpod/public-api/lib/gitpod/v1/scm_pb"; import type { DeepPartial } from "@gitpod/gitpod-protocol/lib/util/deep-partial"; import { BlockedRepository as ProtocolBlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; +import { SupportedWorkspaceClass } from "@gitpod/gitpod-protocol/lib/workspace-class"; export type PartialConfiguration = DeepPartial & Pick; @@ -1094,4 +1096,13 @@ export class PublicAPIConverter { nanos: (totalSeconds - Math.floor(totalSeconds)) * 1e9, }); } + + toWorkspaceClass(cls: SupportedWorkspaceClass): WorkspaceClass { + return new WorkspaceClass({ + id: cls.id, + displayName: cls.displayName, + description: cls.description, + isDefault: cls.isDefault, + }); + } } diff --git a/components/public-api/typescript/src/gitpod/v1/workspace_connect.ts b/components/public-api/typescript/src/gitpod/v1/workspace_connect.ts index b89cb5dc9fb176..326d00ca7d146a 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspace_connect.ts +++ b/components/public-api/typescript/src/gitpod/v1/workspace_connect.ts @@ -9,7 +9,7 @@ /* eslint-disable */ // @ts-nocheck -import { CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, GetWorkspaceDefaultImageRequest, GetWorkspaceDefaultImageResponse, GetWorkspaceEditorCredentialsRequest, GetWorkspaceEditorCredentialsResponse, GetWorkspaceOwnerTokenRequest, GetWorkspaceOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspacesRequest, ListWorkspacesResponse, ParseContextURLRequest, ParseContextURLResponse, SendHeartBeatRequest, SendHeartBeatResponse, StartWorkspaceRequest, StartWorkspaceResponse, UpdateWorkspaceRequest, UpdateWorkspaceResponse, WatchWorkspaceStatusRequest, WatchWorkspaceStatusResponse } from "./workspace_pb.js"; +import { CreateAndStartWorkspaceRequest, CreateAndStartWorkspaceResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse, GetWorkspaceDefaultImageRequest, GetWorkspaceDefaultImageResponse, GetWorkspaceEditorCredentialsRequest, GetWorkspaceEditorCredentialsResponse, GetWorkspaceOwnerTokenRequest, GetWorkspaceOwnerTokenResponse, GetWorkspaceRequest, GetWorkspaceResponse, ListWorkspaceClassesRequest, ListWorkspaceClassesResponse, ListWorkspacesRequest, ListWorkspacesResponse, ParseContextURLRequest, ParseContextURLResponse, SendHeartBeatRequest, SendHeartBeatResponse, StartWorkspaceRequest, StartWorkspaceResponse, StopWorkspaceRequest, StopWorkspaceResponse, UpdateWorkspaceRequest, UpdateWorkspaceResponse, WatchWorkspaceStatusRequest, WatchWorkspaceStatusResponse } from "./workspace_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -90,6 +90,41 @@ export const WorkspaceService = { O: UpdateWorkspaceResponse, kind: MethodKind.Unary, }, + /** + * StopWorkspace stops a running workspace. + * + * @generated from rpc gitpod.v1.WorkspaceService.StopWorkspace + */ + stopWorkspace: { + name: "StopWorkspace", + I: StopWorkspaceRequest, + O: StopWorkspaceResponse, + kind: MethodKind.Unary, + }, + /** + * DeleteWorkspace deletes a workspace. + * When the workspace is running, it will be stopped as well. + * Deleted workspaces cannot be started again. + * + * @generated from rpc gitpod.v1.WorkspaceService.DeleteWorkspace + */ + deleteWorkspace: { + name: "DeleteWorkspace", + I: DeleteWorkspaceRequest, + O: DeleteWorkspaceResponse, + kind: MethodKind.Unary, + }, + /** + * ListWorkspaceClasses enumerates all available workspace classes. + * + * @generated from rpc gitpod.v1.WorkspaceService.ListWorkspaceClasses + */ + listWorkspaceClasses: { + name: "ListWorkspaceClasses", + I: ListWorkspaceClassesRequest, + O: ListWorkspaceClassesResponse, + kind: MethodKind.Unary, + }, /** * ParseContextURL parses a context URL and returns the workspace metadata and spec. * Not implemented yet. diff --git a/components/public-api/typescript/src/gitpod/v1/workspace_pb.ts b/components/public-api/typescript/src/gitpod/v1/workspace_pb.ts index 29bea0033452df..8f26a3b817923a 100644 --- a/components/public-api/typescript/src/gitpod/v1/workspace_pb.ts +++ b/components/public-api/typescript/src/gitpod/v1/workspace_pb.ts @@ -2821,6 +2821,230 @@ export class UpdateWorkspaceResponse extends Message { } } +/** + * @generated from message gitpod.v1.StopWorkspaceRequest + */ +export class StopWorkspaceRequest extends Message { + /** + * workspace_id specifies which workspace should be stopped. + * + * +required + * + * @generated from field: string workspace_id = 1; + */ + workspaceId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StopWorkspaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StopWorkspaceRequest { + return new StopWorkspaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopWorkspaceRequest { + return new StopWorkspaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StopWorkspaceRequest { + return new StopWorkspaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: StopWorkspaceRequest | PlainMessage | undefined, b: StopWorkspaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(StopWorkspaceRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.StopWorkspaceResponse + */ +export class StopWorkspaceResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.StopWorkspaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): StopWorkspaceResponse { + return new StopWorkspaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): StopWorkspaceResponse { + return new StopWorkspaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): StopWorkspaceResponse { + return new StopWorkspaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: StopWorkspaceResponse | PlainMessage | undefined, b: StopWorkspaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(StopWorkspaceResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.DeleteWorkspaceRequest + */ +export class DeleteWorkspaceRequest extends Message { + /** + * workspace_id specifies the workspace that is going to delete. + * + * +required + * + * @generated from field: string workspace_id = 1; + */ + workspaceId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.DeleteWorkspaceRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "workspace_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteWorkspaceRequest { + return new DeleteWorkspaceRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteWorkspaceRequest { + return new DeleteWorkspaceRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteWorkspaceRequest { + return new DeleteWorkspaceRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteWorkspaceRequest | PlainMessage | undefined, b: DeleteWorkspaceRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteWorkspaceRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.DeleteWorkspaceResponse + */ +export class DeleteWorkspaceResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.DeleteWorkspaceResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteWorkspaceResponse { + return new DeleteWorkspaceResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteWorkspaceResponse { + return new DeleteWorkspaceResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteWorkspaceResponse { + return new DeleteWorkspaceResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteWorkspaceResponse | PlainMessage | undefined, b: DeleteWorkspaceResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteWorkspaceResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListWorkspaceClassesRequest + */ +export class ListWorkspaceClassesRequest extends Message { + /** + * @generated from field: gitpod.v1.PaginationRequest pagination = 1; + */ + pagination?: PaginationRequest; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListWorkspaceClassesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListWorkspaceClassesRequest { + return new ListWorkspaceClassesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListWorkspaceClassesRequest { + return new ListWorkspaceClassesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListWorkspaceClassesRequest { + return new ListWorkspaceClassesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListWorkspaceClassesRequest | PlainMessage | undefined, b: ListWorkspaceClassesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListWorkspaceClassesRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListWorkspaceClassesResponse + */ +export class ListWorkspaceClassesResponse extends Message { + /** + * @generated from field: gitpod.v1.PaginationResponse pagination = 1; + */ + pagination?: PaginationResponse; + + /** + * @generated from field: repeated gitpod.v1.WorkspaceClass workspace_classes = 2; + */ + workspaceClasses: WorkspaceClass[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListWorkspaceClassesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, + { no: 2, name: "workspace_classes", kind: "message", T: WorkspaceClass, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListWorkspaceClassesResponse { + return new ListWorkspaceClassesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListWorkspaceClassesResponse { + return new ListWorkspaceClassesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListWorkspaceClassesResponse { + return new ListWorkspaceClassesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListWorkspaceClassesResponse | PlainMessage | undefined, b: ListWorkspaceClassesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListWorkspaceClassesResponse, a, b); + } +} + /** * @generated from message gitpod.v1.ParseContextURLRequest */ @@ -2910,3 +3134,66 @@ export class ParseContextURLResponse extends Message { return proto3.util.equals(ParseContextURLResponse, a, b); } } + +/** + * @generated from message gitpod.v1.WorkspaceClass + */ +export class WorkspaceClass extends Message { + /** + * id is the unique identifier of the workspace class + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * display_name is the human readable name of the workspace class + * + * @generated from field: string display_name = 2; + */ + displayName = ""; + + /** + * description is a human readable description of the workspace class + * + * @generated from field: string description = 3; + */ + description = ""; + + /** + * is_default indicates if this workspace class is the default one + * + * @generated from field: bool is_default = 4; + */ + isDefault = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.WorkspaceClass"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "display_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "is_default", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): WorkspaceClass { + return new WorkspaceClass().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): WorkspaceClass { + return new WorkspaceClass().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): WorkspaceClass { + return new WorkspaceClass().fromJsonString(jsonString, options); + } + + static equals(a: WorkspaceClass | PlainMessage | undefined, b: WorkspaceClass | PlainMessage | undefined): boolean { + return proto3.util.equals(WorkspaceClass, a, b); + } +} diff --git a/components/server/src/api/workspace-service-api.ts b/components/server/src/api/workspace-service-api.ts index 0695edd1e5ff41..1ca3ad44334f46 100644 --- a/components/server/src/api/workspace-service-api.ts +++ b/components/server/src/api/workspace-service-api.ts @@ -30,6 +30,13 @@ import { ParseContextURLResponse, UpdateWorkspaceRequest, UpdateWorkspaceResponse, + StopWorkspaceRequest, + StopWorkspaceResponse, + DeleteWorkspaceRequest, + DeleteWorkspaceResponse, + ListWorkspaceClassesRequest, + ListWorkspaceClassesResponse, + AdmissionLevel, } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; import { inject, injectable } from "inversify"; import { WorkspaceService } from "../workspace/workspace-service"; @@ -252,10 +259,95 @@ export class WorkspaceServiceAPI implements ServiceImpl { - throw new ApplicationError(ErrorCodes.UNIMPLEMENTED, "not implemented"); + if (!req.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + const userId = ctxUserId(); + + // check if user can access workspace first, so that it throws NotFound if workspace is not found + await this.workspaceService.getWorkspace(userId, req.workspaceId); + + const tasks: Array> = []; + + if (req.metadata) { + if (req.metadata.name) { + tasks.push(this.workspaceService.setDescription(userId, req.workspaceId, req.metadata.name)); + } + if (req.metadata.pinned !== undefined) { + tasks.push(this.workspaceService.setPinned(userId, req.workspaceId, req.metadata.pinned)); + } + } + + if (req.spec) { + if ((req.spec.timeout?.disconnected?.seconds ?? 0) > 0) { + tasks.push( + this.workspaceService.setWorkspaceTimeout( + userId, + req.workspaceId, + this.apiConverter.toDurationString(req.spec.timeout!.disconnected!), + ), + ); + } + if (req.spec.admission !== undefined) { + if (req.spec.admission === AdmissionLevel.OWNER_ONLY) { + tasks.push(this.workspaceService.controlAdmission(userId, req.workspaceId, "owner")); + } else if (req.spec.admission === AdmissionLevel.EVERYONE) { + tasks.push(this.workspaceService.controlAdmission(userId, req.workspaceId, "everyone")); + } + } + } + + if (req.gitStatus) { + tasks.push( + this.workspaceService.updateGitStatus(userId, req.workspaceId, { + branch: req.gitStatus.branch!, + latestCommit: req.gitStatus.latestCommit!, + uncommitedFiles: req.gitStatus.uncommitedFiles!, + totalUncommitedFiles: req.gitStatus.totalUncommitedFiles!, + untrackedFiles: req.gitStatus.untrackedFiles!, + totalUntrackedFiles: req.gitStatus.totalUntrackedFiles!, + unpushedCommits: req.gitStatus.unpushedCommits!, + totalUnpushedCommits: req.gitStatus.totalUnpushedCommits!, + }), + ); + } + + // Use all or allSettled + // TODO: update workspace-service to make sure it can be done in one request + await Promise.allSettled(tasks); + const info = await this.workspaceService.getWorkspace(ctxUserId(), req.workspaceId); + const response = new UpdateWorkspaceResponse(); + response.workspace = this.apiConverter.toWorkspace(info); + return response; } async parseContextURL(req: ParseContextURLRequest): Promise { throw new ApplicationError(ErrorCodes.UNIMPLEMENTED, "not implemented"); } + + async stopWorkspace(req: StopWorkspaceRequest): Promise { + if (!req.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + await this.workspaceService.stopWorkspace(ctxUserId(), req.workspaceId, "stopped via API"); + const response = new StopWorkspaceResponse(); + return response; + } + + async deleteWorkspace(req: DeleteWorkspaceRequest): Promise { + if (!req.workspaceId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "workspaceId is required"); + } + await this.workspaceService.deleteWorkspace(ctxUserId(), req.workspaceId, "user"); + const response = new DeleteWorkspaceResponse(); + return response; + } + + async listWorkspaceClasses(req: ListWorkspaceClassesRequest): Promise { + const clsList = await this.workspaceService.getSupportedWorkspaceClasses({ id: ctxUserId() }); + const response = new ListWorkspaceClassesResponse(); + response.pagination = new PaginationResponse(); + response.workspaceClasses = clsList.map((i) => this.apiConverter.toWorkspaceClass(i)); + return response; + } }