@gitpod/public-api 0.1.5-mp-server-ws-probe-remove.0 → 0.1.5-mp-grpc-web-prototype.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/gitpod/v1/pagination.pb.d.ts +31 -0
  2. package/lib/gitpod/v1/pagination.pb.d.ts.map +1 -0
  3. package/lib/gitpod/v1/pagination.pb.js +53 -0
  4. package/lib/gitpod/v1/pagination.pb.js.map +1 -0
  5. package/lib/gitpod/v1/pagination.pb.ts +77 -0
  6. package/lib/gitpod/v1/prebuilds.pb.d.ts +289 -0
  7. package/lib/gitpod/v1/prebuilds.pb.d.ts.map +1 -0
  8. package/lib/gitpod/v1/prebuilds.pb.js +585 -0
  9. package/lib/gitpod/v1/prebuilds.pb.js.map +1 -0
  10. package/lib/gitpod/v1/prebuilds.pb.ts +782 -0
  11. package/lib/gitpod/v1/workspaces.pb.d.ts +665 -0
  12. package/lib/gitpod/v1/workspaces.pb.d.ts.map +1 -0
  13. package/lib/gitpod/v1/workspaces.pb.js +1571 -0
  14. package/lib/gitpod/v1/workspaces.pb.js.map +1 -0
  15. package/lib/gitpod/v1/workspaces.pb.ts +2031 -0
  16. package/lib/google/protobuf/field_mask.pb.d.ts +231 -0
  17. package/lib/google/protobuf/field_mask.pb.d.ts.map +1 -0
  18. package/lib/google/protobuf/field_mask.pb.js +54 -0
  19. package/lib/google/protobuf/field_mask.pb.js.map +1 -0
  20. package/lib/google/protobuf/field_mask.pb.ts +280 -0
  21. package/lib/google/protobuf/timestamp.pb.d.ts +131 -0
  22. package/lib/google/protobuf/timestamp.pb.d.ts.map +1 -0
  23. package/lib/google/protobuf/timestamp.pb.js +81 -0
  24. package/lib/google/protobuf/timestamp.pb.js.map +1 -0
  25. package/lib/google/protobuf/timestamp.pb.ts +211 -0
  26. package/package.json +7 -10
  27. package/pkg-yarn.lock +4 -5
  28. package/provenance-bundle.jsonl +2 -2
  29. package/lib/gitpod/v1/pagination_grpc_pb.js +0 -7
  30. package/lib/gitpod/v1/pagination_pb.d.ts +0 -36
  31. package/lib/gitpod/v1/pagination_pb.js +0 -206
  32. package/lib/gitpod/v1/prebuilds_grpc_pb.d.ts +0 -95
  33. package/lib/gitpod/v1/prebuilds_grpc_pb.js +0 -161
  34. package/lib/gitpod/v1/prebuilds_pb.d.ts +0 -283
  35. package/lib/gitpod/v1/prebuilds_pb.js +0 -1997
  36. package/lib/gitpod/v1/workspaces_grpc_pb.d.ts +0 -197
  37. package/lib/gitpod/v1/workspaces_grpc_pb.js +0 -368
  38. package/lib/gitpod/v1/workspaces_pb.d.ts +0 -810
  39. package/lib/gitpod/v1/workspaces_pb.js +0 -5976
@@ -0,0 +1,2031 @@
1
+ /**
2
+ * Copyright (c) 2022 Gitpod GmbH. All rights reserved.
3
+ * Licensed under the GNU Affero General Public License (AGPL).
4
+ * See License-AGPL.txt in the project root for license information.
5
+ */
6
+
7
+ /* eslint-disable */
8
+ import * as Long from "long";
9
+ import { CallContext, CallOptions } from "nice-grpc-common";
10
+ import * as _m0 from "protobufjs/minimal";
11
+ import { FieldMask } from "../../google/protobuf/field_mask.pb";
12
+ import { Timestamp } from "../../google/protobuf/timestamp.pb";
13
+ import { Pagination } from "./pagination.pb";
14
+
15
+ export const protobufPackage = "gitpod.v1";
16
+
17
+ /** Admission level describes who can access a workspace instance and its ports. */
18
+ export enum AdmissionLevel {
19
+ ADMISSION_LEVEL_UNSPECIFIED = "ADMISSION_LEVEL_UNSPECIFIED",
20
+ /** ADMISSION_LEVEL_OWNER_ONLY - ADMISSION_LEVEL_OWNER_ONLY means the workspace can only be accessed using the owner token */
21
+ ADMISSION_LEVEL_OWNER_ONLY = "ADMISSION_LEVEL_OWNER_ONLY",
22
+ /** ADMISSION_LEVEL_EVERYONE - ADMISSION_LEVEL_EVERYONE means the workspace (including ports) can be accessed by everyone. */
23
+ ADMISSION_LEVEL_EVERYONE = "ADMISSION_LEVEL_EVERYONE",
24
+ UNRECOGNIZED = "UNRECOGNIZED",
25
+ }
26
+
27
+ export function admissionLevelFromJSON(object: any): AdmissionLevel {
28
+ switch (object) {
29
+ case 0:
30
+ case "ADMISSION_LEVEL_UNSPECIFIED":
31
+ return AdmissionLevel.ADMISSION_LEVEL_UNSPECIFIED;
32
+ case 1:
33
+ case "ADMISSION_LEVEL_OWNER_ONLY":
34
+ return AdmissionLevel.ADMISSION_LEVEL_OWNER_ONLY;
35
+ case 2:
36
+ case "ADMISSION_LEVEL_EVERYONE":
37
+ return AdmissionLevel.ADMISSION_LEVEL_EVERYONE;
38
+ case -1:
39
+ case "UNRECOGNIZED":
40
+ default:
41
+ return AdmissionLevel.UNRECOGNIZED;
42
+ }
43
+ }
44
+
45
+ export function admissionLevelToNumber(object: AdmissionLevel): number {
46
+ switch (object) {
47
+ case AdmissionLevel.ADMISSION_LEVEL_UNSPECIFIED:
48
+ return 0;
49
+ case AdmissionLevel.ADMISSION_LEVEL_OWNER_ONLY:
50
+ return 1;
51
+ case AdmissionLevel.ADMISSION_LEVEL_EVERYONE:
52
+ return 2;
53
+ case AdmissionLevel.UNRECOGNIZED:
54
+ default:
55
+ return -1;
56
+ }
57
+ }
58
+
59
+ export interface ListWorkspacesRequest {
60
+ pagination: Pagination | undefined;
61
+ fieldMask: string[] | undefined;
62
+ }
63
+
64
+ export interface ListWorkspacesResponse {
65
+ nextPageToken: string;
66
+ result: ListWorkspacesResponse_WorkspaceAndInstance[];
67
+ }
68
+
69
+ export interface ListWorkspacesResponse_WorkspaceAndInstance {
70
+ result: Workspace | undefined;
71
+ lastActiveInstances: WorkspaceInstance | undefined;
72
+ }
73
+
74
+ export interface GetWorkspaceRequest {
75
+ workspaceId: string;
76
+ }
77
+
78
+ export interface GetWorkspaceResponse {
79
+ result: Workspace | undefined;
80
+ }
81
+
82
+ export interface GetOwnerTokenRequest {
83
+ workspaceId: string;
84
+ }
85
+
86
+ export interface GetOwnerTokenResponse {
87
+ token: string;
88
+ }
89
+
90
+ export interface CreateAndStartWorkspaceRequest {
91
+ idempotencyToken: string;
92
+ contextUrl: string | undefined;
93
+ prebuildId: string | undefined;
94
+ startSpec: StartWorkspaceSpec | undefined;
95
+ }
96
+
97
+ export interface CreateAndStartWorkspaceResponse {
98
+ workspaceId: string;
99
+ }
100
+
101
+ export interface StartWorkspaceRequest {
102
+ idempotencyToken: string;
103
+ workspaceId: string;
104
+ spec: StartWorkspaceSpec | undefined;
105
+ }
106
+
107
+ export interface StartWorkspaceResponse {
108
+ instanceId: string;
109
+ workspaceUrl: string;
110
+ }
111
+
112
+ export interface GetActiveWorkspaceInstanceRequest {
113
+ workspaceId: string;
114
+ }
115
+
116
+ export interface GetActiveWorkspaceInstanceResponse {
117
+ instance: WorkspaceInstance | undefined;
118
+ }
119
+
120
+ export interface GetWorkspaceInstanceOwnerTokenRequest {
121
+ instanceId: string;
122
+ }
123
+
124
+ export interface GetWorkspaceInstanceOwnerTokenResponse {
125
+ ownerToken: string;
126
+ }
127
+
128
+ export interface ListenToWorkspaceInstanceRequest {
129
+ instanceId: string;
130
+ }
131
+
132
+ export interface ListenToWorkspaceInstanceResponse {
133
+ instanceStatus: WorkspaceInstanceStatus | undefined;
134
+ }
135
+
136
+ export interface ListenToImageBuildLogsRequest {
137
+ instanceId: string;
138
+ }
139
+
140
+ export interface ListenToImageBuildLogsResponse {
141
+ line: string;
142
+ }
143
+
144
+ export interface StopWorkspaceRequest {
145
+ idempotencyToken: string;
146
+ workspaceId: string;
147
+ }
148
+
149
+ export interface StopWorkspaceResponse {
150
+ }
151
+
152
+ /** Workspace describes a single workspace */
153
+ export interface Workspace {
154
+ /** workspace_id is the ID of the workspace */
155
+ workspaceId: string;
156
+ /** owner_id is the ID of the user who created this workspace */
157
+ ownerId: string;
158
+ /** project_id is the ID of the project which this workspace belongs to */
159
+ projectId: string;
160
+ /** context reports the original context the workspace was created from */
161
+ context:
162
+ | WorkspaceContext
163
+ | undefined;
164
+ /** description is a human readable description of the workspace */
165
+ description: string;
166
+ }
167
+
168
+ /** WorkspaceContext describes the context a workspace was created from */
169
+ export interface WorkspaceContext {
170
+ /**
171
+ * All workspace context originates from a URL - this is the context URL
172
+ * which led to the creation of a workspace.
173
+ */
174
+ contextUrl: string;
175
+ git: WorkspaceContext_Git | undefined;
176
+ prebuild: WorkspaceContext_Prebuild | undefined;
177
+ snapshot: WorkspaceContext_Snapshot | undefined;
178
+ }
179
+
180
+ /** Explicit Git context */
181
+ export interface WorkspaceContext_Git {
182
+ normalizedContextUrl: string;
183
+ commit: string;
184
+ }
185
+
186
+ /** Workspace was created from a prebuild */
187
+ export interface WorkspaceContext_Prebuild {
188
+ /**
189
+ * original_context is the Git context which lead to the selection
190
+ * of a prebuild.
191
+ */
192
+ originalContext:
193
+ | WorkspaceContext_Git
194
+ | undefined;
195
+ /** prebuild_id is the ID of the prebuild which was used to create this workspace */
196
+ prebuildId: string;
197
+ }
198
+
199
+ /** Snapshot context points to the snapshot which the workspace was created from */
200
+ export interface WorkspaceContext_Snapshot {
201
+ snapshotId: string;
202
+ }
203
+
204
+ /** WorkspaceInstance describes a single workspace instance */
205
+ export interface WorkspaceInstance {
206
+ /** Instance ID is the unique identifier of the workspace instance */
207
+ instanceId: string;
208
+ /** Worksapce ID is the unique identifier of the workspace this instance belongs to */
209
+ workspaceId: string;
210
+ createdAt: Date | undefined;
211
+ status: WorkspaceInstanceStatus | undefined;
212
+ }
213
+
214
+ /** WorkspaceStatus describes a workspace status */
215
+ export interface WorkspaceInstanceStatus {
216
+ /**
217
+ * version of the status update. Workspace instances themselves are unversioned,
218
+ * but their statuus has different versions.
219
+ * The value of this field has no semantic meaning (e.g. don't interpret it as
220
+ * as a timestemp), but it can be used to impose a partial order.
221
+ * If a.status_version < b.status_version then a was the status before b.
222
+ */
223
+ statusVersion: number;
224
+ /** the phase of a workspace is a simple, high-level summary of where the workspace instance is in its lifecycle */
225
+ phase: WorkspaceInstanceStatus_Phase;
226
+ /** conditions detail the current state of the workspace instance */
227
+ conditions:
228
+ | WorkspaceInstanceStatus_Conditions
229
+ | undefined;
230
+ /** message is an optional human-readable message detailing the current phase */
231
+ message: string;
232
+ /** URL contains the endpoint at which the workspace instance is available */
233
+ url: string;
234
+ /** Admission describes who can access a workspace instance and its ports. */
235
+ admission: AdmissionLevel;
236
+ }
237
+
238
+ /**
239
+ * Phase is a simple, high-level summary of where the workspace instance is in its lifecycle.
240
+ * The phase is not intended to be a comprehensive rollup of observations of the workspace state,
241
+ * nor is it intended to be a comprehensive state machine.
242
+ * (based on https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase)
243
+ */
244
+ export enum WorkspaceInstanceStatus_Phase {
245
+ /**
246
+ * PHASE_UNSPECIFIED - Unknown indicates an issue within the workspace manager in that it cannot determine the actual phase of
247
+ * a workspace. This phase is usually accompanied by an error.
248
+ */
249
+ PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
250
+ /**
251
+ * PHASE_PREPARING - Preparing means that we haven't actually started the workspace instance just yet, but rather
252
+ * are still preparing for launch.
253
+ */
254
+ PHASE_PREPARING = "PHASE_PREPARING",
255
+ /** PHASE_IMAGEBUILD - ImageBuild indicates that there's an image build running for this workspace. */
256
+ PHASE_IMAGEBUILD = "PHASE_IMAGEBUILD",
257
+ /**
258
+ * PHASE_PENDING - Pending means the workspace does not yet consume resources in the cluster, but rather is looking for
259
+ * some space within the cluster. If for example the cluster needs to scale up to accomodate the
260
+ * workspace, the workspace will be in Pending state until that happened.
261
+ */
262
+ PHASE_PENDING = "PHASE_PENDING",
263
+ /**
264
+ * PHASE_CREATING - Creating means the workspace is currently being created. That includes downloading the images required
265
+ * to run the workspace over the network. The time spent in this phase varies widely and depends on the current
266
+ * network speed, image size and cache states.
267
+ */
268
+ PHASE_CREATING = "PHASE_CREATING",
269
+ /**
270
+ * PHASE_INITIALIZING - Initializing is the phase in which the workspace is executing the appropriate workspace initializer (e.g. Git
271
+ * clone or backup download). After this phase one can expect the workspace to either be Running or Failed.
272
+ */
273
+ PHASE_INITIALIZING = "PHASE_INITIALIZING",
274
+ /**
275
+ * PHASE_RUNNING - Running means the workspace is able to actively perform work, either by serving a user through Theia,
276
+ * or as a headless workspace.
277
+ */
278
+ PHASE_RUNNING = "PHASE_RUNNING",
279
+ /**
280
+ * PHASE_INTERRUPTED - Interrupted is an exceptional state where the container should be running but is temporarily unavailable.
281
+ * When in this state, we expect it to become running or stopping anytime soon.
282
+ */
283
+ PHASE_INTERRUPTED = "PHASE_INTERRUPTED",
284
+ /** PHASE_STOPPING - Stopping means that the workspace is currently shutting down. It could go to stopped every moment. */
285
+ PHASE_STOPPING = "PHASE_STOPPING",
286
+ /** PHASE_STOPPED - Stopped means the workspace ended regularly because it was shut down. */
287
+ PHASE_STOPPED = "PHASE_STOPPED",
288
+ UNRECOGNIZED = "UNRECOGNIZED",
289
+ }
290
+
291
+ export function workspaceInstanceStatus_PhaseFromJSON(object: any): WorkspaceInstanceStatus_Phase {
292
+ switch (object) {
293
+ case 0:
294
+ case "PHASE_UNSPECIFIED":
295
+ return WorkspaceInstanceStatus_Phase.PHASE_UNSPECIFIED;
296
+ case 1:
297
+ case "PHASE_PREPARING":
298
+ return WorkspaceInstanceStatus_Phase.PHASE_PREPARING;
299
+ case 2:
300
+ case "PHASE_IMAGEBUILD":
301
+ return WorkspaceInstanceStatus_Phase.PHASE_IMAGEBUILD;
302
+ case 3:
303
+ case "PHASE_PENDING":
304
+ return WorkspaceInstanceStatus_Phase.PHASE_PENDING;
305
+ case 4:
306
+ case "PHASE_CREATING":
307
+ return WorkspaceInstanceStatus_Phase.PHASE_CREATING;
308
+ case 5:
309
+ case "PHASE_INITIALIZING":
310
+ return WorkspaceInstanceStatus_Phase.PHASE_INITIALIZING;
311
+ case 6:
312
+ case "PHASE_RUNNING":
313
+ return WorkspaceInstanceStatus_Phase.PHASE_RUNNING;
314
+ case 7:
315
+ case "PHASE_INTERRUPTED":
316
+ return WorkspaceInstanceStatus_Phase.PHASE_INTERRUPTED;
317
+ case 8:
318
+ case "PHASE_STOPPING":
319
+ return WorkspaceInstanceStatus_Phase.PHASE_STOPPING;
320
+ case 9:
321
+ case "PHASE_STOPPED":
322
+ return WorkspaceInstanceStatus_Phase.PHASE_STOPPED;
323
+ case -1:
324
+ case "UNRECOGNIZED":
325
+ default:
326
+ return WorkspaceInstanceStatus_Phase.UNRECOGNIZED;
327
+ }
328
+ }
329
+
330
+ export function workspaceInstanceStatus_PhaseToNumber(object: WorkspaceInstanceStatus_Phase): number {
331
+ switch (object) {
332
+ case WorkspaceInstanceStatus_Phase.PHASE_UNSPECIFIED:
333
+ return 0;
334
+ case WorkspaceInstanceStatus_Phase.PHASE_PREPARING:
335
+ return 1;
336
+ case WorkspaceInstanceStatus_Phase.PHASE_IMAGEBUILD:
337
+ return 2;
338
+ case WorkspaceInstanceStatus_Phase.PHASE_PENDING:
339
+ return 3;
340
+ case WorkspaceInstanceStatus_Phase.PHASE_CREATING:
341
+ return 4;
342
+ case WorkspaceInstanceStatus_Phase.PHASE_INITIALIZING:
343
+ return 5;
344
+ case WorkspaceInstanceStatus_Phase.PHASE_RUNNING:
345
+ return 6;
346
+ case WorkspaceInstanceStatus_Phase.PHASE_INTERRUPTED:
347
+ return 7;
348
+ case WorkspaceInstanceStatus_Phase.PHASE_STOPPING:
349
+ return 8;
350
+ case WorkspaceInstanceStatus_Phase.PHASE_STOPPED:
351
+ return 9;
352
+ case WorkspaceInstanceStatus_Phase.UNRECOGNIZED:
353
+ default:
354
+ return -1;
355
+ }
356
+ }
357
+
358
+ /**
359
+ * Conditions gives more detailed information as to the state of the workspace. Which condition actually
360
+ * has a value depends on the phase the workspace is in.
361
+ */
362
+ export interface WorkspaceInstanceStatus_Conditions {
363
+ /**
364
+ * failed contains the reason the workspace failed to operate. If this field is empty, the workspace has not failed.
365
+ * This field is filled exclusively when caused by system errors.
366
+ */
367
+ failed: string;
368
+ /** timeout contains the reason the workspace has timed out. If this field is empty, the workspace has not timed out. */
369
+ timeout: string;
370
+ /** first_user_activity is the time when MarkActive was first called on the workspace */
371
+ firstUserActivity:
372
+ | Date
373
+ | undefined;
374
+ /** stopped_by_request is true if the workspace was stopped using a StopWorkspace call */
375
+ stoppedByRequest?: boolean | undefined;
376
+ }
377
+
378
+ /** StartWorkspaceSpec influences the workspace start */
379
+ export interface StartWorkspaceSpec {
380
+ }
381
+
382
+ function createBaseListWorkspacesRequest(): ListWorkspacesRequest {
383
+ return { pagination: undefined, fieldMask: undefined };
384
+ }
385
+
386
+ export const ListWorkspacesRequest = {
387
+ encode(message: ListWorkspacesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
388
+ if (message.pagination !== undefined) {
389
+ Pagination.encode(message.pagination, writer.uint32(10).fork()).ldelim();
390
+ }
391
+ if (message.fieldMask !== undefined) {
392
+ FieldMask.encode(FieldMask.wrap(message.fieldMask), writer.uint32(18).fork()).ldelim();
393
+ }
394
+ return writer;
395
+ },
396
+
397
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListWorkspacesRequest {
398
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
399
+ let end = length === undefined ? reader.len : reader.pos + length;
400
+ const message = createBaseListWorkspacesRequest();
401
+ while (reader.pos < end) {
402
+ const tag = reader.uint32();
403
+ switch (tag >>> 3) {
404
+ case 1:
405
+ message.pagination = Pagination.decode(reader, reader.uint32());
406
+ break;
407
+ case 2:
408
+ message.fieldMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
409
+ break;
410
+ default:
411
+ reader.skipType(tag & 7);
412
+ break;
413
+ }
414
+ }
415
+ return message;
416
+ },
417
+
418
+ fromPartial(object: DeepPartial<ListWorkspacesRequest>): ListWorkspacesRequest {
419
+ const message = createBaseListWorkspacesRequest();
420
+ message.pagination = (object.pagination !== undefined && object.pagination !== null)
421
+ ? Pagination.fromPartial(object.pagination)
422
+ : undefined;
423
+ message.fieldMask = object.fieldMask ?? undefined;
424
+ return message;
425
+ },
426
+ };
427
+
428
+ function createBaseListWorkspacesResponse(): ListWorkspacesResponse {
429
+ return { nextPageToken: "", result: [] };
430
+ }
431
+
432
+ export const ListWorkspacesResponse = {
433
+ encode(message: ListWorkspacesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
434
+ if (message.nextPageToken !== "") {
435
+ writer.uint32(10).string(message.nextPageToken);
436
+ }
437
+ for (const v of message.result) {
438
+ ListWorkspacesResponse_WorkspaceAndInstance.encode(v!, writer.uint32(18).fork()).ldelim();
439
+ }
440
+ return writer;
441
+ },
442
+
443
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListWorkspacesResponse {
444
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
445
+ let end = length === undefined ? reader.len : reader.pos + length;
446
+ const message = createBaseListWorkspacesResponse();
447
+ while (reader.pos < end) {
448
+ const tag = reader.uint32();
449
+ switch (tag >>> 3) {
450
+ case 1:
451
+ message.nextPageToken = reader.string();
452
+ break;
453
+ case 2:
454
+ message.result.push(ListWorkspacesResponse_WorkspaceAndInstance.decode(reader, reader.uint32()));
455
+ break;
456
+ default:
457
+ reader.skipType(tag & 7);
458
+ break;
459
+ }
460
+ }
461
+ return message;
462
+ },
463
+
464
+ fromPartial(object: DeepPartial<ListWorkspacesResponse>): ListWorkspacesResponse {
465
+ const message = createBaseListWorkspacesResponse();
466
+ message.nextPageToken = object.nextPageToken ?? "";
467
+ message.result = object.result?.map((e) => ListWorkspacesResponse_WorkspaceAndInstance.fromPartial(e)) || [];
468
+ return message;
469
+ },
470
+ };
471
+
472
+ function createBaseListWorkspacesResponse_WorkspaceAndInstance(): ListWorkspacesResponse_WorkspaceAndInstance {
473
+ return { result: undefined, lastActiveInstances: undefined };
474
+ }
475
+
476
+ export const ListWorkspacesResponse_WorkspaceAndInstance = {
477
+ encode(message: ListWorkspacesResponse_WorkspaceAndInstance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
478
+ if (message.result !== undefined) {
479
+ Workspace.encode(message.result, writer.uint32(10).fork()).ldelim();
480
+ }
481
+ if (message.lastActiveInstances !== undefined) {
482
+ WorkspaceInstance.encode(message.lastActiveInstances, writer.uint32(18).fork()).ldelim();
483
+ }
484
+ return writer;
485
+ },
486
+
487
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListWorkspacesResponse_WorkspaceAndInstance {
488
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
489
+ let end = length === undefined ? reader.len : reader.pos + length;
490
+ const message = createBaseListWorkspacesResponse_WorkspaceAndInstance();
491
+ while (reader.pos < end) {
492
+ const tag = reader.uint32();
493
+ switch (tag >>> 3) {
494
+ case 1:
495
+ message.result = Workspace.decode(reader, reader.uint32());
496
+ break;
497
+ case 2:
498
+ message.lastActiveInstances = WorkspaceInstance.decode(reader, reader.uint32());
499
+ break;
500
+ default:
501
+ reader.skipType(tag & 7);
502
+ break;
503
+ }
504
+ }
505
+ return message;
506
+ },
507
+
508
+ fromPartial(
509
+ object: DeepPartial<ListWorkspacesResponse_WorkspaceAndInstance>,
510
+ ): ListWorkspacesResponse_WorkspaceAndInstance {
511
+ const message = createBaseListWorkspacesResponse_WorkspaceAndInstance();
512
+ message.result = (object.result !== undefined && object.result !== null)
513
+ ? Workspace.fromPartial(object.result)
514
+ : undefined;
515
+ message.lastActiveInstances = (object.lastActiveInstances !== undefined && object.lastActiveInstances !== null)
516
+ ? WorkspaceInstance.fromPartial(object.lastActiveInstances)
517
+ : undefined;
518
+ return message;
519
+ },
520
+ };
521
+
522
+ function createBaseGetWorkspaceRequest(): GetWorkspaceRequest {
523
+ return { workspaceId: "" };
524
+ }
525
+
526
+ export const GetWorkspaceRequest = {
527
+ encode(message: GetWorkspaceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
528
+ if (message.workspaceId !== "") {
529
+ writer.uint32(10).string(message.workspaceId);
530
+ }
531
+ return writer;
532
+ },
533
+
534
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkspaceRequest {
535
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
536
+ let end = length === undefined ? reader.len : reader.pos + length;
537
+ const message = createBaseGetWorkspaceRequest();
538
+ while (reader.pos < end) {
539
+ const tag = reader.uint32();
540
+ switch (tag >>> 3) {
541
+ case 1:
542
+ message.workspaceId = reader.string();
543
+ break;
544
+ default:
545
+ reader.skipType(tag & 7);
546
+ break;
547
+ }
548
+ }
549
+ return message;
550
+ },
551
+
552
+ fromPartial(object: DeepPartial<GetWorkspaceRequest>): GetWorkspaceRequest {
553
+ const message = createBaseGetWorkspaceRequest();
554
+ message.workspaceId = object.workspaceId ?? "";
555
+ return message;
556
+ },
557
+ };
558
+
559
+ function createBaseGetWorkspaceResponse(): GetWorkspaceResponse {
560
+ return { result: undefined };
561
+ }
562
+
563
+ export const GetWorkspaceResponse = {
564
+ encode(message: GetWorkspaceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
565
+ if (message.result !== undefined) {
566
+ Workspace.encode(message.result, writer.uint32(10).fork()).ldelim();
567
+ }
568
+ return writer;
569
+ },
570
+
571
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkspaceResponse {
572
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
573
+ let end = length === undefined ? reader.len : reader.pos + length;
574
+ const message = createBaseGetWorkspaceResponse();
575
+ while (reader.pos < end) {
576
+ const tag = reader.uint32();
577
+ switch (tag >>> 3) {
578
+ case 1:
579
+ message.result = Workspace.decode(reader, reader.uint32());
580
+ break;
581
+ default:
582
+ reader.skipType(tag & 7);
583
+ break;
584
+ }
585
+ }
586
+ return message;
587
+ },
588
+
589
+ fromPartial(object: DeepPartial<GetWorkspaceResponse>): GetWorkspaceResponse {
590
+ const message = createBaseGetWorkspaceResponse();
591
+ message.result = (object.result !== undefined && object.result !== null)
592
+ ? Workspace.fromPartial(object.result)
593
+ : undefined;
594
+ return message;
595
+ },
596
+ };
597
+
598
+ function createBaseGetOwnerTokenRequest(): GetOwnerTokenRequest {
599
+ return { workspaceId: "" };
600
+ }
601
+
602
+ export const GetOwnerTokenRequest = {
603
+ encode(message: GetOwnerTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
604
+ if (message.workspaceId !== "") {
605
+ writer.uint32(10).string(message.workspaceId);
606
+ }
607
+ return writer;
608
+ },
609
+
610
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetOwnerTokenRequest {
611
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
612
+ let end = length === undefined ? reader.len : reader.pos + length;
613
+ const message = createBaseGetOwnerTokenRequest();
614
+ while (reader.pos < end) {
615
+ const tag = reader.uint32();
616
+ switch (tag >>> 3) {
617
+ case 1:
618
+ message.workspaceId = reader.string();
619
+ break;
620
+ default:
621
+ reader.skipType(tag & 7);
622
+ break;
623
+ }
624
+ }
625
+ return message;
626
+ },
627
+
628
+ fromPartial(object: DeepPartial<GetOwnerTokenRequest>): GetOwnerTokenRequest {
629
+ const message = createBaseGetOwnerTokenRequest();
630
+ message.workspaceId = object.workspaceId ?? "";
631
+ return message;
632
+ },
633
+ };
634
+
635
+ function createBaseGetOwnerTokenResponse(): GetOwnerTokenResponse {
636
+ return { token: "" };
637
+ }
638
+
639
+ export const GetOwnerTokenResponse = {
640
+ encode(message: GetOwnerTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
641
+ if (message.token !== "") {
642
+ writer.uint32(10).string(message.token);
643
+ }
644
+ return writer;
645
+ },
646
+
647
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetOwnerTokenResponse {
648
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
649
+ let end = length === undefined ? reader.len : reader.pos + length;
650
+ const message = createBaseGetOwnerTokenResponse();
651
+ while (reader.pos < end) {
652
+ const tag = reader.uint32();
653
+ switch (tag >>> 3) {
654
+ case 1:
655
+ message.token = reader.string();
656
+ break;
657
+ default:
658
+ reader.skipType(tag & 7);
659
+ break;
660
+ }
661
+ }
662
+ return message;
663
+ },
664
+
665
+ fromPartial(object: DeepPartial<GetOwnerTokenResponse>): GetOwnerTokenResponse {
666
+ const message = createBaseGetOwnerTokenResponse();
667
+ message.token = object.token ?? "";
668
+ return message;
669
+ },
670
+ };
671
+
672
+ function createBaseCreateAndStartWorkspaceRequest(): CreateAndStartWorkspaceRequest {
673
+ return { idempotencyToken: "", contextUrl: undefined, prebuildId: undefined, startSpec: undefined };
674
+ }
675
+
676
+ export const CreateAndStartWorkspaceRequest = {
677
+ encode(message: CreateAndStartWorkspaceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
678
+ if (message.idempotencyToken !== "") {
679
+ writer.uint32(10).string(message.idempotencyToken);
680
+ }
681
+ if (message.contextUrl !== undefined) {
682
+ writer.uint32(18).string(message.contextUrl);
683
+ }
684
+ if (message.prebuildId !== undefined) {
685
+ writer.uint32(26).string(message.prebuildId);
686
+ }
687
+ if (message.startSpec !== undefined) {
688
+ StartWorkspaceSpec.encode(message.startSpec, writer.uint32(42).fork()).ldelim();
689
+ }
690
+ return writer;
691
+ },
692
+
693
+ decode(input: _m0.Reader | Uint8Array, length?: number): CreateAndStartWorkspaceRequest {
694
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
695
+ let end = length === undefined ? reader.len : reader.pos + length;
696
+ const message = createBaseCreateAndStartWorkspaceRequest();
697
+ while (reader.pos < end) {
698
+ const tag = reader.uint32();
699
+ switch (tag >>> 3) {
700
+ case 1:
701
+ message.idempotencyToken = reader.string();
702
+ break;
703
+ case 2:
704
+ message.contextUrl = reader.string();
705
+ break;
706
+ case 3:
707
+ message.prebuildId = reader.string();
708
+ break;
709
+ case 5:
710
+ message.startSpec = StartWorkspaceSpec.decode(reader, reader.uint32());
711
+ break;
712
+ default:
713
+ reader.skipType(tag & 7);
714
+ break;
715
+ }
716
+ }
717
+ return message;
718
+ },
719
+
720
+ fromPartial(object: DeepPartial<CreateAndStartWorkspaceRequest>): CreateAndStartWorkspaceRequest {
721
+ const message = createBaseCreateAndStartWorkspaceRequest();
722
+ message.idempotencyToken = object.idempotencyToken ?? "";
723
+ message.contextUrl = object.contextUrl ?? undefined;
724
+ message.prebuildId = object.prebuildId ?? undefined;
725
+ message.startSpec = (object.startSpec !== undefined && object.startSpec !== null)
726
+ ? StartWorkspaceSpec.fromPartial(object.startSpec)
727
+ : undefined;
728
+ return message;
729
+ },
730
+ };
731
+
732
+ function createBaseCreateAndStartWorkspaceResponse(): CreateAndStartWorkspaceResponse {
733
+ return { workspaceId: "" };
734
+ }
735
+
736
+ export const CreateAndStartWorkspaceResponse = {
737
+ encode(message: CreateAndStartWorkspaceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
738
+ if (message.workspaceId !== "") {
739
+ writer.uint32(10).string(message.workspaceId);
740
+ }
741
+ return writer;
742
+ },
743
+
744
+ decode(input: _m0.Reader | Uint8Array, length?: number): CreateAndStartWorkspaceResponse {
745
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
746
+ let end = length === undefined ? reader.len : reader.pos + length;
747
+ const message = createBaseCreateAndStartWorkspaceResponse();
748
+ while (reader.pos < end) {
749
+ const tag = reader.uint32();
750
+ switch (tag >>> 3) {
751
+ case 1:
752
+ message.workspaceId = reader.string();
753
+ break;
754
+ default:
755
+ reader.skipType(tag & 7);
756
+ break;
757
+ }
758
+ }
759
+ return message;
760
+ },
761
+
762
+ fromPartial(object: DeepPartial<CreateAndStartWorkspaceResponse>): CreateAndStartWorkspaceResponse {
763
+ const message = createBaseCreateAndStartWorkspaceResponse();
764
+ message.workspaceId = object.workspaceId ?? "";
765
+ return message;
766
+ },
767
+ };
768
+
769
+ function createBaseStartWorkspaceRequest(): StartWorkspaceRequest {
770
+ return { idempotencyToken: "", workspaceId: "", spec: undefined };
771
+ }
772
+
773
+ export const StartWorkspaceRequest = {
774
+ encode(message: StartWorkspaceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
775
+ if (message.idempotencyToken !== "") {
776
+ writer.uint32(10).string(message.idempotencyToken);
777
+ }
778
+ if (message.workspaceId !== "") {
779
+ writer.uint32(18).string(message.workspaceId);
780
+ }
781
+ if (message.spec !== undefined) {
782
+ StartWorkspaceSpec.encode(message.spec, writer.uint32(26).fork()).ldelim();
783
+ }
784
+ return writer;
785
+ },
786
+
787
+ decode(input: _m0.Reader | Uint8Array, length?: number): StartWorkspaceRequest {
788
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
789
+ let end = length === undefined ? reader.len : reader.pos + length;
790
+ const message = createBaseStartWorkspaceRequest();
791
+ while (reader.pos < end) {
792
+ const tag = reader.uint32();
793
+ switch (tag >>> 3) {
794
+ case 1:
795
+ message.idempotencyToken = reader.string();
796
+ break;
797
+ case 2:
798
+ message.workspaceId = reader.string();
799
+ break;
800
+ case 3:
801
+ message.spec = StartWorkspaceSpec.decode(reader, reader.uint32());
802
+ break;
803
+ default:
804
+ reader.skipType(tag & 7);
805
+ break;
806
+ }
807
+ }
808
+ return message;
809
+ },
810
+
811
+ fromPartial(object: DeepPartial<StartWorkspaceRequest>): StartWorkspaceRequest {
812
+ const message = createBaseStartWorkspaceRequest();
813
+ message.idempotencyToken = object.idempotencyToken ?? "";
814
+ message.workspaceId = object.workspaceId ?? "";
815
+ message.spec = (object.spec !== undefined && object.spec !== null)
816
+ ? StartWorkspaceSpec.fromPartial(object.spec)
817
+ : undefined;
818
+ return message;
819
+ },
820
+ };
821
+
822
+ function createBaseStartWorkspaceResponse(): StartWorkspaceResponse {
823
+ return { instanceId: "", workspaceUrl: "" };
824
+ }
825
+
826
+ export const StartWorkspaceResponse = {
827
+ encode(message: StartWorkspaceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
828
+ if (message.instanceId !== "") {
829
+ writer.uint32(10).string(message.instanceId);
830
+ }
831
+ if (message.workspaceUrl !== "") {
832
+ writer.uint32(18).string(message.workspaceUrl);
833
+ }
834
+ return writer;
835
+ },
836
+
837
+ decode(input: _m0.Reader | Uint8Array, length?: number): StartWorkspaceResponse {
838
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
839
+ let end = length === undefined ? reader.len : reader.pos + length;
840
+ const message = createBaseStartWorkspaceResponse();
841
+ while (reader.pos < end) {
842
+ const tag = reader.uint32();
843
+ switch (tag >>> 3) {
844
+ case 1:
845
+ message.instanceId = reader.string();
846
+ break;
847
+ case 2:
848
+ message.workspaceUrl = reader.string();
849
+ break;
850
+ default:
851
+ reader.skipType(tag & 7);
852
+ break;
853
+ }
854
+ }
855
+ return message;
856
+ },
857
+
858
+ fromPartial(object: DeepPartial<StartWorkspaceResponse>): StartWorkspaceResponse {
859
+ const message = createBaseStartWorkspaceResponse();
860
+ message.instanceId = object.instanceId ?? "";
861
+ message.workspaceUrl = object.workspaceUrl ?? "";
862
+ return message;
863
+ },
864
+ };
865
+
866
+ function createBaseGetActiveWorkspaceInstanceRequest(): GetActiveWorkspaceInstanceRequest {
867
+ return { workspaceId: "" };
868
+ }
869
+
870
+ export const GetActiveWorkspaceInstanceRequest = {
871
+ encode(message: GetActiveWorkspaceInstanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
872
+ if (message.workspaceId !== "") {
873
+ writer.uint32(10).string(message.workspaceId);
874
+ }
875
+ return writer;
876
+ },
877
+
878
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetActiveWorkspaceInstanceRequest {
879
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
880
+ let end = length === undefined ? reader.len : reader.pos + length;
881
+ const message = createBaseGetActiveWorkspaceInstanceRequest();
882
+ while (reader.pos < end) {
883
+ const tag = reader.uint32();
884
+ switch (tag >>> 3) {
885
+ case 1:
886
+ message.workspaceId = reader.string();
887
+ break;
888
+ default:
889
+ reader.skipType(tag & 7);
890
+ break;
891
+ }
892
+ }
893
+ return message;
894
+ },
895
+
896
+ fromPartial(object: DeepPartial<GetActiveWorkspaceInstanceRequest>): GetActiveWorkspaceInstanceRequest {
897
+ const message = createBaseGetActiveWorkspaceInstanceRequest();
898
+ message.workspaceId = object.workspaceId ?? "";
899
+ return message;
900
+ },
901
+ };
902
+
903
+ function createBaseGetActiveWorkspaceInstanceResponse(): GetActiveWorkspaceInstanceResponse {
904
+ return { instance: undefined };
905
+ }
906
+
907
+ export const GetActiveWorkspaceInstanceResponse = {
908
+ encode(message: GetActiveWorkspaceInstanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
909
+ if (message.instance !== undefined) {
910
+ WorkspaceInstance.encode(message.instance, writer.uint32(10).fork()).ldelim();
911
+ }
912
+ return writer;
913
+ },
914
+
915
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetActiveWorkspaceInstanceResponse {
916
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
917
+ let end = length === undefined ? reader.len : reader.pos + length;
918
+ const message = createBaseGetActiveWorkspaceInstanceResponse();
919
+ while (reader.pos < end) {
920
+ const tag = reader.uint32();
921
+ switch (tag >>> 3) {
922
+ case 1:
923
+ message.instance = WorkspaceInstance.decode(reader, reader.uint32());
924
+ break;
925
+ default:
926
+ reader.skipType(tag & 7);
927
+ break;
928
+ }
929
+ }
930
+ return message;
931
+ },
932
+
933
+ fromPartial(object: DeepPartial<GetActiveWorkspaceInstanceResponse>): GetActiveWorkspaceInstanceResponse {
934
+ const message = createBaseGetActiveWorkspaceInstanceResponse();
935
+ message.instance = (object.instance !== undefined && object.instance !== null)
936
+ ? WorkspaceInstance.fromPartial(object.instance)
937
+ : undefined;
938
+ return message;
939
+ },
940
+ };
941
+
942
+ function createBaseGetWorkspaceInstanceOwnerTokenRequest(): GetWorkspaceInstanceOwnerTokenRequest {
943
+ return { instanceId: "" };
944
+ }
945
+
946
+ export const GetWorkspaceInstanceOwnerTokenRequest = {
947
+ encode(message: GetWorkspaceInstanceOwnerTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
948
+ if (message.instanceId !== "") {
949
+ writer.uint32(10).string(message.instanceId);
950
+ }
951
+ return writer;
952
+ },
953
+
954
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkspaceInstanceOwnerTokenRequest {
955
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
956
+ let end = length === undefined ? reader.len : reader.pos + length;
957
+ const message = createBaseGetWorkspaceInstanceOwnerTokenRequest();
958
+ while (reader.pos < end) {
959
+ const tag = reader.uint32();
960
+ switch (tag >>> 3) {
961
+ case 1:
962
+ message.instanceId = reader.string();
963
+ break;
964
+ default:
965
+ reader.skipType(tag & 7);
966
+ break;
967
+ }
968
+ }
969
+ return message;
970
+ },
971
+
972
+ fromPartial(object: DeepPartial<GetWorkspaceInstanceOwnerTokenRequest>): GetWorkspaceInstanceOwnerTokenRequest {
973
+ const message = createBaseGetWorkspaceInstanceOwnerTokenRequest();
974
+ message.instanceId = object.instanceId ?? "";
975
+ return message;
976
+ },
977
+ };
978
+
979
+ function createBaseGetWorkspaceInstanceOwnerTokenResponse(): GetWorkspaceInstanceOwnerTokenResponse {
980
+ return { ownerToken: "" };
981
+ }
982
+
983
+ export const GetWorkspaceInstanceOwnerTokenResponse = {
984
+ encode(message: GetWorkspaceInstanceOwnerTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
985
+ if (message.ownerToken !== "") {
986
+ writer.uint32(10).string(message.ownerToken);
987
+ }
988
+ return writer;
989
+ },
990
+
991
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetWorkspaceInstanceOwnerTokenResponse {
992
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
993
+ let end = length === undefined ? reader.len : reader.pos + length;
994
+ const message = createBaseGetWorkspaceInstanceOwnerTokenResponse();
995
+ while (reader.pos < end) {
996
+ const tag = reader.uint32();
997
+ switch (tag >>> 3) {
998
+ case 1:
999
+ message.ownerToken = reader.string();
1000
+ break;
1001
+ default:
1002
+ reader.skipType(tag & 7);
1003
+ break;
1004
+ }
1005
+ }
1006
+ return message;
1007
+ },
1008
+
1009
+ fromPartial(object: DeepPartial<GetWorkspaceInstanceOwnerTokenResponse>): GetWorkspaceInstanceOwnerTokenResponse {
1010
+ const message = createBaseGetWorkspaceInstanceOwnerTokenResponse();
1011
+ message.ownerToken = object.ownerToken ?? "";
1012
+ return message;
1013
+ },
1014
+ };
1015
+
1016
+ function createBaseListenToWorkspaceInstanceRequest(): ListenToWorkspaceInstanceRequest {
1017
+ return { instanceId: "" };
1018
+ }
1019
+
1020
+ export const ListenToWorkspaceInstanceRequest = {
1021
+ encode(message: ListenToWorkspaceInstanceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1022
+ if (message.instanceId !== "") {
1023
+ writer.uint32(10).string(message.instanceId);
1024
+ }
1025
+ return writer;
1026
+ },
1027
+
1028
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListenToWorkspaceInstanceRequest {
1029
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1030
+ let end = length === undefined ? reader.len : reader.pos + length;
1031
+ const message = createBaseListenToWorkspaceInstanceRequest();
1032
+ while (reader.pos < end) {
1033
+ const tag = reader.uint32();
1034
+ switch (tag >>> 3) {
1035
+ case 1:
1036
+ message.instanceId = reader.string();
1037
+ break;
1038
+ default:
1039
+ reader.skipType(tag & 7);
1040
+ break;
1041
+ }
1042
+ }
1043
+ return message;
1044
+ },
1045
+
1046
+ fromPartial(object: DeepPartial<ListenToWorkspaceInstanceRequest>): ListenToWorkspaceInstanceRequest {
1047
+ const message = createBaseListenToWorkspaceInstanceRequest();
1048
+ message.instanceId = object.instanceId ?? "";
1049
+ return message;
1050
+ },
1051
+ };
1052
+
1053
+ function createBaseListenToWorkspaceInstanceResponse(): ListenToWorkspaceInstanceResponse {
1054
+ return { instanceStatus: undefined };
1055
+ }
1056
+
1057
+ export const ListenToWorkspaceInstanceResponse = {
1058
+ encode(message: ListenToWorkspaceInstanceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1059
+ if (message.instanceStatus !== undefined) {
1060
+ WorkspaceInstanceStatus.encode(message.instanceStatus, writer.uint32(10).fork()).ldelim();
1061
+ }
1062
+ return writer;
1063
+ },
1064
+
1065
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListenToWorkspaceInstanceResponse {
1066
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1067
+ let end = length === undefined ? reader.len : reader.pos + length;
1068
+ const message = createBaseListenToWorkspaceInstanceResponse();
1069
+ while (reader.pos < end) {
1070
+ const tag = reader.uint32();
1071
+ switch (tag >>> 3) {
1072
+ case 1:
1073
+ message.instanceStatus = WorkspaceInstanceStatus.decode(reader, reader.uint32());
1074
+ break;
1075
+ default:
1076
+ reader.skipType(tag & 7);
1077
+ break;
1078
+ }
1079
+ }
1080
+ return message;
1081
+ },
1082
+
1083
+ fromPartial(object: DeepPartial<ListenToWorkspaceInstanceResponse>): ListenToWorkspaceInstanceResponse {
1084
+ const message = createBaseListenToWorkspaceInstanceResponse();
1085
+ message.instanceStatus = (object.instanceStatus !== undefined && object.instanceStatus !== null)
1086
+ ? WorkspaceInstanceStatus.fromPartial(object.instanceStatus)
1087
+ : undefined;
1088
+ return message;
1089
+ },
1090
+ };
1091
+
1092
+ function createBaseListenToImageBuildLogsRequest(): ListenToImageBuildLogsRequest {
1093
+ return { instanceId: "" };
1094
+ }
1095
+
1096
+ export const ListenToImageBuildLogsRequest = {
1097
+ encode(message: ListenToImageBuildLogsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1098
+ if (message.instanceId !== "") {
1099
+ writer.uint32(10).string(message.instanceId);
1100
+ }
1101
+ return writer;
1102
+ },
1103
+
1104
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListenToImageBuildLogsRequest {
1105
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1106
+ let end = length === undefined ? reader.len : reader.pos + length;
1107
+ const message = createBaseListenToImageBuildLogsRequest();
1108
+ while (reader.pos < end) {
1109
+ const tag = reader.uint32();
1110
+ switch (tag >>> 3) {
1111
+ case 1:
1112
+ message.instanceId = reader.string();
1113
+ break;
1114
+ default:
1115
+ reader.skipType(tag & 7);
1116
+ break;
1117
+ }
1118
+ }
1119
+ return message;
1120
+ },
1121
+
1122
+ fromPartial(object: DeepPartial<ListenToImageBuildLogsRequest>): ListenToImageBuildLogsRequest {
1123
+ const message = createBaseListenToImageBuildLogsRequest();
1124
+ message.instanceId = object.instanceId ?? "";
1125
+ return message;
1126
+ },
1127
+ };
1128
+
1129
+ function createBaseListenToImageBuildLogsResponse(): ListenToImageBuildLogsResponse {
1130
+ return { line: "" };
1131
+ }
1132
+
1133
+ export const ListenToImageBuildLogsResponse = {
1134
+ encode(message: ListenToImageBuildLogsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1135
+ if (message.line !== "") {
1136
+ writer.uint32(10).string(message.line);
1137
+ }
1138
+ return writer;
1139
+ },
1140
+
1141
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListenToImageBuildLogsResponse {
1142
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1143
+ let end = length === undefined ? reader.len : reader.pos + length;
1144
+ const message = createBaseListenToImageBuildLogsResponse();
1145
+ while (reader.pos < end) {
1146
+ const tag = reader.uint32();
1147
+ switch (tag >>> 3) {
1148
+ case 1:
1149
+ message.line = reader.string();
1150
+ break;
1151
+ default:
1152
+ reader.skipType(tag & 7);
1153
+ break;
1154
+ }
1155
+ }
1156
+ return message;
1157
+ },
1158
+
1159
+ fromPartial(object: DeepPartial<ListenToImageBuildLogsResponse>): ListenToImageBuildLogsResponse {
1160
+ const message = createBaseListenToImageBuildLogsResponse();
1161
+ message.line = object.line ?? "";
1162
+ return message;
1163
+ },
1164
+ };
1165
+
1166
+ function createBaseStopWorkspaceRequest(): StopWorkspaceRequest {
1167
+ return { idempotencyToken: "", workspaceId: "" };
1168
+ }
1169
+
1170
+ export const StopWorkspaceRequest = {
1171
+ encode(message: StopWorkspaceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1172
+ if (message.idempotencyToken !== "") {
1173
+ writer.uint32(10).string(message.idempotencyToken);
1174
+ }
1175
+ if (message.workspaceId !== "") {
1176
+ writer.uint32(18).string(message.workspaceId);
1177
+ }
1178
+ return writer;
1179
+ },
1180
+
1181
+ decode(input: _m0.Reader | Uint8Array, length?: number): StopWorkspaceRequest {
1182
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1183
+ let end = length === undefined ? reader.len : reader.pos + length;
1184
+ const message = createBaseStopWorkspaceRequest();
1185
+ while (reader.pos < end) {
1186
+ const tag = reader.uint32();
1187
+ switch (tag >>> 3) {
1188
+ case 1:
1189
+ message.idempotencyToken = reader.string();
1190
+ break;
1191
+ case 2:
1192
+ message.workspaceId = reader.string();
1193
+ break;
1194
+ default:
1195
+ reader.skipType(tag & 7);
1196
+ break;
1197
+ }
1198
+ }
1199
+ return message;
1200
+ },
1201
+
1202
+ fromPartial(object: DeepPartial<StopWorkspaceRequest>): StopWorkspaceRequest {
1203
+ const message = createBaseStopWorkspaceRequest();
1204
+ message.idempotencyToken = object.idempotencyToken ?? "";
1205
+ message.workspaceId = object.workspaceId ?? "";
1206
+ return message;
1207
+ },
1208
+ };
1209
+
1210
+ function createBaseStopWorkspaceResponse(): StopWorkspaceResponse {
1211
+ return {};
1212
+ }
1213
+
1214
+ export const StopWorkspaceResponse = {
1215
+ encode(_: StopWorkspaceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1216
+ return writer;
1217
+ },
1218
+
1219
+ decode(input: _m0.Reader | Uint8Array, length?: number): StopWorkspaceResponse {
1220
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1221
+ let end = length === undefined ? reader.len : reader.pos + length;
1222
+ const message = createBaseStopWorkspaceResponse();
1223
+ while (reader.pos < end) {
1224
+ const tag = reader.uint32();
1225
+ switch (tag >>> 3) {
1226
+ default:
1227
+ reader.skipType(tag & 7);
1228
+ break;
1229
+ }
1230
+ }
1231
+ return message;
1232
+ },
1233
+
1234
+ fromPartial(_: DeepPartial<StopWorkspaceResponse>): StopWorkspaceResponse {
1235
+ const message = createBaseStopWorkspaceResponse();
1236
+ return message;
1237
+ },
1238
+ };
1239
+
1240
+ function createBaseWorkspace(): Workspace {
1241
+ return { workspaceId: "", ownerId: "", projectId: "", context: undefined, description: "" };
1242
+ }
1243
+
1244
+ export const Workspace = {
1245
+ encode(message: Workspace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1246
+ if (message.workspaceId !== "") {
1247
+ writer.uint32(10).string(message.workspaceId);
1248
+ }
1249
+ if (message.ownerId !== "") {
1250
+ writer.uint32(18).string(message.ownerId);
1251
+ }
1252
+ if (message.projectId !== "") {
1253
+ writer.uint32(26).string(message.projectId);
1254
+ }
1255
+ if (message.context !== undefined) {
1256
+ WorkspaceContext.encode(message.context, writer.uint32(34).fork()).ldelim();
1257
+ }
1258
+ if (message.description !== "") {
1259
+ writer.uint32(42).string(message.description);
1260
+ }
1261
+ return writer;
1262
+ },
1263
+
1264
+ decode(input: _m0.Reader | Uint8Array, length?: number): Workspace {
1265
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1266
+ let end = length === undefined ? reader.len : reader.pos + length;
1267
+ const message = createBaseWorkspace();
1268
+ while (reader.pos < end) {
1269
+ const tag = reader.uint32();
1270
+ switch (tag >>> 3) {
1271
+ case 1:
1272
+ message.workspaceId = reader.string();
1273
+ break;
1274
+ case 2:
1275
+ message.ownerId = reader.string();
1276
+ break;
1277
+ case 3:
1278
+ message.projectId = reader.string();
1279
+ break;
1280
+ case 4:
1281
+ message.context = WorkspaceContext.decode(reader, reader.uint32());
1282
+ break;
1283
+ case 5:
1284
+ message.description = reader.string();
1285
+ break;
1286
+ default:
1287
+ reader.skipType(tag & 7);
1288
+ break;
1289
+ }
1290
+ }
1291
+ return message;
1292
+ },
1293
+
1294
+ fromPartial(object: DeepPartial<Workspace>): Workspace {
1295
+ const message = createBaseWorkspace();
1296
+ message.workspaceId = object.workspaceId ?? "";
1297
+ message.ownerId = object.ownerId ?? "";
1298
+ message.projectId = object.projectId ?? "";
1299
+ message.context = (object.context !== undefined && object.context !== null)
1300
+ ? WorkspaceContext.fromPartial(object.context)
1301
+ : undefined;
1302
+ message.description = object.description ?? "";
1303
+ return message;
1304
+ },
1305
+ };
1306
+
1307
+ function createBaseWorkspaceContext(): WorkspaceContext {
1308
+ return { contextUrl: "", git: undefined, prebuild: undefined, snapshot: undefined };
1309
+ }
1310
+
1311
+ export const WorkspaceContext = {
1312
+ encode(message: WorkspaceContext, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1313
+ if (message.contextUrl !== "") {
1314
+ writer.uint32(10).string(message.contextUrl);
1315
+ }
1316
+ if (message.git !== undefined) {
1317
+ WorkspaceContext_Git.encode(message.git, writer.uint32(18).fork()).ldelim();
1318
+ }
1319
+ if (message.prebuild !== undefined) {
1320
+ WorkspaceContext_Prebuild.encode(message.prebuild, writer.uint32(26).fork()).ldelim();
1321
+ }
1322
+ if (message.snapshot !== undefined) {
1323
+ WorkspaceContext_Snapshot.encode(message.snapshot, writer.uint32(34).fork()).ldelim();
1324
+ }
1325
+ return writer;
1326
+ },
1327
+
1328
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceContext {
1329
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1330
+ let end = length === undefined ? reader.len : reader.pos + length;
1331
+ const message = createBaseWorkspaceContext();
1332
+ while (reader.pos < end) {
1333
+ const tag = reader.uint32();
1334
+ switch (tag >>> 3) {
1335
+ case 1:
1336
+ message.contextUrl = reader.string();
1337
+ break;
1338
+ case 2:
1339
+ message.git = WorkspaceContext_Git.decode(reader, reader.uint32());
1340
+ break;
1341
+ case 3:
1342
+ message.prebuild = WorkspaceContext_Prebuild.decode(reader, reader.uint32());
1343
+ break;
1344
+ case 4:
1345
+ message.snapshot = WorkspaceContext_Snapshot.decode(reader, reader.uint32());
1346
+ break;
1347
+ default:
1348
+ reader.skipType(tag & 7);
1349
+ break;
1350
+ }
1351
+ }
1352
+ return message;
1353
+ },
1354
+
1355
+ fromPartial(object: DeepPartial<WorkspaceContext>): WorkspaceContext {
1356
+ const message = createBaseWorkspaceContext();
1357
+ message.contextUrl = object.contextUrl ?? "";
1358
+ message.git = (object.git !== undefined && object.git !== null)
1359
+ ? WorkspaceContext_Git.fromPartial(object.git)
1360
+ : undefined;
1361
+ message.prebuild = (object.prebuild !== undefined && object.prebuild !== null)
1362
+ ? WorkspaceContext_Prebuild.fromPartial(object.prebuild)
1363
+ : undefined;
1364
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1365
+ ? WorkspaceContext_Snapshot.fromPartial(object.snapshot)
1366
+ : undefined;
1367
+ return message;
1368
+ },
1369
+ };
1370
+
1371
+ function createBaseWorkspaceContext_Git(): WorkspaceContext_Git {
1372
+ return { normalizedContextUrl: "", commit: "" };
1373
+ }
1374
+
1375
+ export const WorkspaceContext_Git = {
1376
+ encode(message: WorkspaceContext_Git, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1377
+ if (message.normalizedContextUrl !== "") {
1378
+ writer.uint32(10).string(message.normalizedContextUrl);
1379
+ }
1380
+ if (message.commit !== "") {
1381
+ writer.uint32(18).string(message.commit);
1382
+ }
1383
+ return writer;
1384
+ },
1385
+
1386
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceContext_Git {
1387
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1388
+ let end = length === undefined ? reader.len : reader.pos + length;
1389
+ const message = createBaseWorkspaceContext_Git();
1390
+ while (reader.pos < end) {
1391
+ const tag = reader.uint32();
1392
+ switch (tag >>> 3) {
1393
+ case 1:
1394
+ message.normalizedContextUrl = reader.string();
1395
+ break;
1396
+ case 2:
1397
+ message.commit = reader.string();
1398
+ break;
1399
+ default:
1400
+ reader.skipType(tag & 7);
1401
+ break;
1402
+ }
1403
+ }
1404
+ return message;
1405
+ },
1406
+
1407
+ fromPartial(object: DeepPartial<WorkspaceContext_Git>): WorkspaceContext_Git {
1408
+ const message = createBaseWorkspaceContext_Git();
1409
+ message.normalizedContextUrl = object.normalizedContextUrl ?? "";
1410
+ message.commit = object.commit ?? "";
1411
+ return message;
1412
+ },
1413
+ };
1414
+
1415
+ function createBaseWorkspaceContext_Prebuild(): WorkspaceContext_Prebuild {
1416
+ return { originalContext: undefined, prebuildId: "" };
1417
+ }
1418
+
1419
+ export const WorkspaceContext_Prebuild = {
1420
+ encode(message: WorkspaceContext_Prebuild, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1421
+ if (message.originalContext !== undefined) {
1422
+ WorkspaceContext_Git.encode(message.originalContext, writer.uint32(10).fork()).ldelim();
1423
+ }
1424
+ if (message.prebuildId !== "") {
1425
+ writer.uint32(18).string(message.prebuildId);
1426
+ }
1427
+ return writer;
1428
+ },
1429
+
1430
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceContext_Prebuild {
1431
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1432
+ let end = length === undefined ? reader.len : reader.pos + length;
1433
+ const message = createBaseWorkspaceContext_Prebuild();
1434
+ while (reader.pos < end) {
1435
+ const tag = reader.uint32();
1436
+ switch (tag >>> 3) {
1437
+ case 1:
1438
+ message.originalContext = WorkspaceContext_Git.decode(reader, reader.uint32());
1439
+ break;
1440
+ case 2:
1441
+ message.prebuildId = reader.string();
1442
+ break;
1443
+ default:
1444
+ reader.skipType(tag & 7);
1445
+ break;
1446
+ }
1447
+ }
1448
+ return message;
1449
+ },
1450
+
1451
+ fromPartial(object: DeepPartial<WorkspaceContext_Prebuild>): WorkspaceContext_Prebuild {
1452
+ const message = createBaseWorkspaceContext_Prebuild();
1453
+ message.originalContext = (object.originalContext !== undefined && object.originalContext !== null)
1454
+ ? WorkspaceContext_Git.fromPartial(object.originalContext)
1455
+ : undefined;
1456
+ message.prebuildId = object.prebuildId ?? "";
1457
+ return message;
1458
+ },
1459
+ };
1460
+
1461
+ function createBaseWorkspaceContext_Snapshot(): WorkspaceContext_Snapshot {
1462
+ return { snapshotId: "" };
1463
+ }
1464
+
1465
+ export const WorkspaceContext_Snapshot = {
1466
+ encode(message: WorkspaceContext_Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1467
+ if (message.snapshotId !== "") {
1468
+ writer.uint32(10).string(message.snapshotId);
1469
+ }
1470
+ return writer;
1471
+ },
1472
+
1473
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceContext_Snapshot {
1474
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1475
+ let end = length === undefined ? reader.len : reader.pos + length;
1476
+ const message = createBaseWorkspaceContext_Snapshot();
1477
+ while (reader.pos < end) {
1478
+ const tag = reader.uint32();
1479
+ switch (tag >>> 3) {
1480
+ case 1:
1481
+ message.snapshotId = reader.string();
1482
+ break;
1483
+ default:
1484
+ reader.skipType(tag & 7);
1485
+ break;
1486
+ }
1487
+ }
1488
+ return message;
1489
+ },
1490
+
1491
+ fromPartial(object: DeepPartial<WorkspaceContext_Snapshot>): WorkspaceContext_Snapshot {
1492
+ const message = createBaseWorkspaceContext_Snapshot();
1493
+ message.snapshotId = object.snapshotId ?? "";
1494
+ return message;
1495
+ },
1496
+ };
1497
+
1498
+ function createBaseWorkspaceInstance(): WorkspaceInstance {
1499
+ return { instanceId: "", workspaceId: "", createdAt: undefined, status: undefined };
1500
+ }
1501
+
1502
+ export const WorkspaceInstance = {
1503
+ encode(message: WorkspaceInstance, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1504
+ if (message.instanceId !== "") {
1505
+ writer.uint32(10).string(message.instanceId);
1506
+ }
1507
+ if (message.workspaceId !== "") {
1508
+ writer.uint32(18).string(message.workspaceId);
1509
+ }
1510
+ if (message.createdAt !== undefined) {
1511
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).ldelim();
1512
+ }
1513
+ if (message.status !== undefined) {
1514
+ WorkspaceInstanceStatus.encode(message.status, writer.uint32(34).fork()).ldelim();
1515
+ }
1516
+ return writer;
1517
+ },
1518
+
1519
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceInstance {
1520
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1521
+ let end = length === undefined ? reader.len : reader.pos + length;
1522
+ const message = createBaseWorkspaceInstance();
1523
+ while (reader.pos < end) {
1524
+ const tag = reader.uint32();
1525
+ switch (tag >>> 3) {
1526
+ case 1:
1527
+ message.instanceId = reader.string();
1528
+ break;
1529
+ case 2:
1530
+ message.workspaceId = reader.string();
1531
+ break;
1532
+ case 3:
1533
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1534
+ break;
1535
+ case 4:
1536
+ message.status = WorkspaceInstanceStatus.decode(reader, reader.uint32());
1537
+ break;
1538
+ default:
1539
+ reader.skipType(tag & 7);
1540
+ break;
1541
+ }
1542
+ }
1543
+ return message;
1544
+ },
1545
+
1546
+ fromPartial(object: DeepPartial<WorkspaceInstance>): WorkspaceInstance {
1547
+ const message = createBaseWorkspaceInstance();
1548
+ message.instanceId = object.instanceId ?? "";
1549
+ message.workspaceId = object.workspaceId ?? "";
1550
+ message.createdAt = object.createdAt ?? undefined;
1551
+ message.status = (object.status !== undefined && object.status !== null)
1552
+ ? WorkspaceInstanceStatus.fromPartial(object.status)
1553
+ : undefined;
1554
+ return message;
1555
+ },
1556
+ };
1557
+
1558
+ function createBaseWorkspaceInstanceStatus(): WorkspaceInstanceStatus {
1559
+ return {
1560
+ statusVersion: 0,
1561
+ phase: WorkspaceInstanceStatus_Phase.PHASE_UNSPECIFIED,
1562
+ conditions: undefined,
1563
+ message: "",
1564
+ url: "",
1565
+ admission: AdmissionLevel.ADMISSION_LEVEL_UNSPECIFIED,
1566
+ };
1567
+ }
1568
+
1569
+ export const WorkspaceInstanceStatus = {
1570
+ encode(message: WorkspaceInstanceStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1571
+ if (message.statusVersion !== 0) {
1572
+ writer.uint32(8).uint64(message.statusVersion);
1573
+ }
1574
+ if (message.phase !== WorkspaceInstanceStatus_Phase.PHASE_UNSPECIFIED) {
1575
+ writer.uint32(16).int32(workspaceInstanceStatus_PhaseToNumber(message.phase));
1576
+ }
1577
+ if (message.conditions !== undefined) {
1578
+ WorkspaceInstanceStatus_Conditions.encode(message.conditions, writer.uint32(26).fork()).ldelim();
1579
+ }
1580
+ if (message.message !== "") {
1581
+ writer.uint32(34).string(message.message);
1582
+ }
1583
+ if (message.url !== "") {
1584
+ writer.uint32(42).string(message.url);
1585
+ }
1586
+ if (message.admission !== AdmissionLevel.ADMISSION_LEVEL_UNSPECIFIED) {
1587
+ writer.uint32(48).int32(admissionLevelToNumber(message.admission));
1588
+ }
1589
+ return writer;
1590
+ },
1591
+
1592
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceInstanceStatus {
1593
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1594
+ let end = length === undefined ? reader.len : reader.pos + length;
1595
+ const message = createBaseWorkspaceInstanceStatus();
1596
+ while (reader.pos < end) {
1597
+ const tag = reader.uint32();
1598
+ switch (tag >>> 3) {
1599
+ case 1:
1600
+ message.statusVersion = longToNumber(reader.uint64() as Long);
1601
+ break;
1602
+ case 2:
1603
+ message.phase = workspaceInstanceStatus_PhaseFromJSON(reader.int32());
1604
+ break;
1605
+ case 3:
1606
+ message.conditions = WorkspaceInstanceStatus_Conditions.decode(reader, reader.uint32());
1607
+ break;
1608
+ case 4:
1609
+ message.message = reader.string();
1610
+ break;
1611
+ case 5:
1612
+ message.url = reader.string();
1613
+ break;
1614
+ case 6:
1615
+ message.admission = admissionLevelFromJSON(reader.int32());
1616
+ break;
1617
+ default:
1618
+ reader.skipType(tag & 7);
1619
+ break;
1620
+ }
1621
+ }
1622
+ return message;
1623
+ },
1624
+
1625
+ fromPartial(object: DeepPartial<WorkspaceInstanceStatus>): WorkspaceInstanceStatus {
1626
+ const message = createBaseWorkspaceInstanceStatus();
1627
+ message.statusVersion = object.statusVersion ?? 0;
1628
+ message.phase = object.phase ?? WorkspaceInstanceStatus_Phase.PHASE_UNSPECIFIED;
1629
+ message.conditions = (object.conditions !== undefined && object.conditions !== null)
1630
+ ? WorkspaceInstanceStatus_Conditions.fromPartial(object.conditions)
1631
+ : undefined;
1632
+ message.message = object.message ?? "";
1633
+ message.url = object.url ?? "";
1634
+ message.admission = object.admission ?? AdmissionLevel.ADMISSION_LEVEL_UNSPECIFIED;
1635
+ return message;
1636
+ },
1637
+ };
1638
+
1639
+ function createBaseWorkspaceInstanceStatus_Conditions(): WorkspaceInstanceStatus_Conditions {
1640
+ return { failed: "", timeout: "", firstUserActivity: undefined, stoppedByRequest: undefined };
1641
+ }
1642
+
1643
+ export const WorkspaceInstanceStatus_Conditions = {
1644
+ encode(message: WorkspaceInstanceStatus_Conditions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1645
+ if (message.failed !== "") {
1646
+ writer.uint32(10).string(message.failed);
1647
+ }
1648
+ if (message.timeout !== "") {
1649
+ writer.uint32(18).string(message.timeout);
1650
+ }
1651
+ if (message.firstUserActivity !== undefined) {
1652
+ Timestamp.encode(toTimestamp(message.firstUserActivity), writer.uint32(74).fork()).ldelim();
1653
+ }
1654
+ if (message.stoppedByRequest !== undefined) {
1655
+ writer.uint32(88).bool(message.stoppedByRequest);
1656
+ }
1657
+ return writer;
1658
+ },
1659
+
1660
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceInstanceStatus_Conditions {
1661
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1662
+ let end = length === undefined ? reader.len : reader.pos + length;
1663
+ const message = createBaseWorkspaceInstanceStatus_Conditions();
1664
+ while (reader.pos < end) {
1665
+ const tag = reader.uint32();
1666
+ switch (tag >>> 3) {
1667
+ case 1:
1668
+ message.failed = reader.string();
1669
+ break;
1670
+ case 2:
1671
+ message.timeout = reader.string();
1672
+ break;
1673
+ case 9:
1674
+ message.firstUserActivity = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1675
+ break;
1676
+ case 11:
1677
+ message.stoppedByRequest = reader.bool();
1678
+ break;
1679
+ default:
1680
+ reader.skipType(tag & 7);
1681
+ break;
1682
+ }
1683
+ }
1684
+ return message;
1685
+ },
1686
+
1687
+ fromPartial(object: DeepPartial<WorkspaceInstanceStatus_Conditions>): WorkspaceInstanceStatus_Conditions {
1688
+ const message = createBaseWorkspaceInstanceStatus_Conditions();
1689
+ message.failed = object.failed ?? "";
1690
+ message.timeout = object.timeout ?? "";
1691
+ message.firstUserActivity = object.firstUserActivity ?? undefined;
1692
+ message.stoppedByRequest = object.stoppedByRequest ?? undefined;
1693
+ return message;
1694
+ },
1695
+ };
1696
+
1697
+ function createBaseStartWorkspaceSpec(): StartWorkspaceSpec {
1698
+ return {};
1699
+ }
1700
+
1701
+ export const StartWorkspaceSpec = {
1702
+ encode(_: StartWorkspaceSpec, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1703
+ return writer;
1704
+ },
1705
+
1706
+ decode(input: _m0.Reader | Uint8Array, length?: number): StartWorkspaceSpec {
1707
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1708
+ let end = length === undefined ? reader.len : reader.pos + length;
1709
+ const message = createBaseStartWorkspaceSpec();
1710
+ while (reader.pos < end) {
1711
+ const tag = reader.uint32();
1712
+ switch (tag >>> 3) {
1713
+ default:
1714
+ reader.skipType(tag & 7);
1715
+ break;
1716
+ }
1717
+ }
1718
+ return message;
1719
+ },
1720
+
1721
+ fromPartial(_: DeepPartial<StartWorkspaceSpec>): StartWorkspaceSpec {
1722
+ const message = createBaseStartWorkspaceSpec();
1723
+ return message;
1724
+ },
1725
+ };
1726
+
1727
+ export type WorkspacesServiceDefinition = typeof WorkspacesServiceDefinition;
1728
+ export const WorkspacesServiceDefinition = {
1729
+ name: "WorkspacesService",
1730
+ fullName: "gitpod.v1.WorkspacesService",
1731
+ methods: {
1732
+ /** ListWorkspaces enumerates all workspaces belonging to the authenticated user. */
1733
+ listWorkspaces: {
1734
+ name: "ListWorkspaces",
1735
+ requestType: ListWorkspacesRequest,
1736
+ requestStream: false,
1737
+ responseType: ListWorkspacesResponse,
1738
+ responseStream: false,
1739
+ options: {},
1740
+ },
1741
+ /** GetWorkspace returns a single workspace. */
1742
+ getWorkspace: {
1743
+ name: "GetWorkspace",
1744
+ requestType: GetWorkspaceRequest,
1745
+ requestStream: false,
1746
+ responseType: GetWorkspaceResponse,
1747
+ responseStream: false,
1748
+ options: {},
1749
+ },
1750
+ /** GetOwnerToken returns an owner token. */
1751
+ getOwnerToken: {
1752
+ name: "GetOwnerToken",
1753
+ requestType: GetOwnerTokenRequest,
1754
+ requestStream: false,
1755
+ responseType: GetOwnerTokenResponse,
1756
+ responseStream: false,
1757
+ options: {},
1758
+ },
1759
+ /** CreateAndStartWorkspace creates a new workspace and starts it. */
1760
+ createAndStartWorkspace: {
1761
+ name: "CreateAndStartWorkspace",
1762
+ requestType: CreateAndStartWorkspaceRequest,
1763
+ requestStream: false,
1764
+ responseType: CreateAndStartWorkspaceResponse,
1765
+ responseStream: false,
1766
+ options: {},
1767
+ },
1768
+ /** StartWorkspace starts an existing workspace. */
1769
+ startWorkspace: {
1770
+ name: "StartWorkspace",
1771
+ requestType: StartWorkspaceRequest,
1772
+ requestStream: false,
1773
+ responseType: StartWorkspaceResponse,
1774
+ responseStream: false,
1775
+ options: {},
1776
+ },
1777
+ /**
1778
+ * GetRunningWorkspaceInstance returns the currently active instance of a workspace.
1779
+ * Errors:
1780
+ * FAILED_PRECONDITION: if a workspace does not a currently active instance
1781
+ */
1782
+ getActiveWorkspaceInstance: {
1783
+ name: "GetActiveWorkspaceInstance",
1784
+ requestType: GetActiveWorkspaceInstanceRequest,
1785
+ requestStream: false,
1786
+ responseType: GetActiveWorkspaceInstanceResponse,
1787
+ responseStream: false,
1788
+ options: {},
1789
+ },
1790
+ /**
1791
+ * GetWorkspaceInstanceOwnerToken returns the owner token of a workspace instance.
1792
+ * Note: the owner token is not part of the workspace instance status so that we can scope its access on the
1793
+ * API function level.
1794
+ */
1795
+ getWorkspaceInstanceOwnerToken: {
1796
+ name: "GetWorkspaceInstanceOwnerToken",
1797
+ requestType: GetWorkspaceInstanceOwnerTokenRequest,
1798
+ requestStream: false,
1799
+ responseType: GetWorkspaceInstanceOwnerTokenResponse,
1800
+ responseStream: false,
1801
+ options: {},
1802
+ },
1803
+ /** ListenToWorkspaceInstance listens to workspace instance updates. */
1804
+ listenToWorkspaceInstance: {
1805
+ name: "ListenToWorkspaceInstance",
1806
+ requestType: ListenToWorkspaceInstanceRequest,
1807
+ requestStream: false,
1808
+ responseType: ListenToWorkspaceInstanceResponse,
1809
+ responseStream: true,
1810
+ options: {},
1811
+ },
1812
+ /** ListenToImageBuildLogs streams (currently or previously) running workspace image build logs */
1813
+ listenToImageBuildLogs: {
1814
+ name: "ListenToImageBuildLogs",
1815
+ requestType: ListenToImageBuildLogsRequest,
1816
+ requestStream: false,
1817
+ responseType: ListenToImageBuildLogsResponse,
1818
+ responseStream: true,
1819
+ options: {},
1820
+ },
1821
+ /**
1822
+ * StopWorkspace stops a running workspace (instance).
1823
+ * Errors:
1824
+ * NOT_FOUND: the workspace_id is unkown
1825
+ * FAILED_PRECONDITION: if there's no running instance
1826
+ */
1827
+ stopWorkspace: {
1828
+ name: "StopWorkspace",
1829
+ requestType: StopWorkspaceRequest,
1830
+ requestStream: false,
1831
+ responseType: StopWorkspaceResponse,
1832
+ responseStream: true,
1833
+ options: {},
1834
+ },
1835
+ },
1836
+ } as const;
1837
+
1838
+ export interface WorkspacesServiceServiceImplementation<CallContextExt = {}> {
1839
+ /** ListWorkspaces enumerates all workspaces belonging to the authenticated user. */
1840
+ listWorkspaces(
1841
+ request: ListWorkspacesRequest,
1842
+ context: CallContext & CallContextExt,
1843
+ ): Promise<DeepPartial<ListWorkspacesResponse>>;
1844
+ /** GetWorkspace returns a single workspace. */
1845
+ getWorkspace(
1846
+ request: GetWorkspaceRequest,
1847
+ context: CallContext & CallContextExt,
1848
+ ): Promise<DeepPartial<GetWorkspaceResponse>>;
1849
+ /** GetOwnerToken returns an owner token. */
1850
+ getOwnerToken(
1851
+ request: GetOwnerTokenRequest,
1852
+ context: CallContext & CallContextExt,
1853
+ ): Promise<DeepPartial<GetOwnerTokenResponse>>;
1854
+ /** CreateAndStartWorkspace creates a new workspace and starts it. */
1855
+ createAndStartWorkspace(
1856
+ request: CreateAndStartWorkspaceRequest,
1857
+ context: CallContext & CallContextExt,
1858
+ ): Promise<DeepPartial<CreateAndStartWorkspaceResponse>>;
1859
+ /** StartWorkspace starts an existing workspace. */
1860
+ startWorkspace(
1861
+ request: StartWorkspaceRequest,
1862
+ context: CallContext & CallContextExt,
1863
+ ): Promise<DeepPartial<StartWorkspaceResponse>>;
1864
+ /**
1865
+ * GetRunningWorkspaceInstance returns the currently active instance of a workspace.
1866
+ * Errors:
1867
+ * FAILED_PRECONDITION: if a workspace does not a currently active instance
1868
+ */
1869
+ getActiveWorkspaceInstance(
1870
+ request: GetActiveWorkspaceInstanceRequest,
1871
+ context: CallContext & CallContextExt,
1872
+ ): Promise<DeepPartial<GetActiveWorkspaceInstanceResponse>>;
1873
+ /**
1874
+ * GetWorkspaceInstanceOwnerToken returns the owner token of a workspace instance.
1875
+ * Note: the owner token is not part of the workspace instance status so that we can scope its access on the
1876
+ * API function level.
1877
+ */
1878
+ getWorkspaceInstanceOwnerToken(
1879
+ request: GetWorkspaceInstanceOwnerTokenRequest,
1880
+ context: CallContext & CallContextExt,
1881
+ ): Promise<DeepPartial<GetWorkspaceInstanceOwnerTokenResponse>>;
1882
+ /** ListenToWorkspaceInstance listens to workspace instance updates. */
1883
+ listenToWorkspaceInstance(
1884
+ request: ListenToWorkspaceInstanceRequest,
1885
+ context: CallContext & CallContextExt,
1886
+ ): ServerStreamingMethodResult<DeepPartial<ListenToWorkspaceInstanceResponse>>;
1887
+ /** ListenToImageBuildLogs streams (currently or previously) running workspace image build logs */
1888
+ listenToImageBuildLogs(
1889
+ request: ListenToImageBuildLogsRequest,
1890
+ context: CallContext & CallContextExt,
1891
+ ): ServerStreamingMethodResult<DeepPartial<ListenToImageBuildLogsResponse>>;
1892
+ /**
1893
+ * StopWorkspace stops a running workspace (instance).
1894
+ * Errors:
1895
+ * NOT_FOUND: the workspace_id is unkown
1896
+ * FAILED_PRECONDITION: if there's no running instance
1897
+ */
1898
+ stopWorkspace(
1899
+ request: StopWorkspaceRequest,
1900
+ context: CallContext & CallContextExt,
1901
+ ): ServerStreamingMethodResult<DeepPartial<StopWorkspaceResponse>>;
1902
+ }
1903
+
1904
+ export interface WorkspacesServiceClient<CallOptionsExt = {}> {
1905
+ /** ListWorkspaces enumerates all workspaces belonging to the authenticated user. */
1906
+ listWorkspaces(
1907
+ request: DeepPartial<ListWorkspacesRequest>,
1908
+ options?: CallOptions & CallOptionsExt,
1909
+ ): Promise<ListWorkspacesResponse>;
1910
+ /** GetWorkspace returns a single workspace. */
1911
+ getWorkspace(
1912
+ request: DeepPartial<GetWorkspaceRequest>,
1913
+ options?: CallOptions & CallOptionsExt,
1914
+ ): Promise<GetWorkspaceResponse>;
1915
+ /** GetOwnerToken returns an owner token. */
1916
+ getOwnerToken(
1917
+ request: DeepPartial<GetOwnerTokenRequest>,
1918
+ options?: CallOptions & CallOptionsExt,
1919
+ ): Promise<GetOwnerTokenResponse>;
1920
+ /** CreateAndStartWorkspace creates a new workspace and starts it. */
1921
+ createAndStartWorkspace(
1922
+ request: DeepPartial<CreateAndStartWorkspaceRequest>,
1923
+ options?: CallOptions & CallOptionsExt,
1924
+ ): Promise<CreateAndStartWorkspaceResponse>;
1925
+ /** StartWorkspace starts an existing workspace. */
1926
+ startWorkspace(
1927
+ request: DeepPartial<StartWorkspaceRequest>,
1928
+ options?: CallOptions & CallOptionsExt,
1929
+ ): Promise<StartWorkspaceResponse>;
1930
+ /**
1931
+ * GetRunningWorkspaceInstance returns the currently active instance of a workspace.
1932
+ * Errors:
1933
+ * FAILED_PRECONDITION: if a workspace does not a currently active instance
1934
+ */
1935
+ getActiveWorkspaceInstance(
1936
+ request: DeepPartial<GetActiveWorkspaceInstanceRequest>,
1937
+ options?: CallOptions & CallOptionsExt,
1938
+ ): Promise<GetActiveWorkspaceInstanceResponse>;
1939
+ /**
1940
+ * GetWorkspaceInstanceOwnerToken returns the owner token of a workspace instance.
1941
+ * Note: the owner token is not part of the workspace instance status so that we can scope its access on the
1942
+ * API function level.
1943
+ */
1944
+ getWorkspaceInstanceOwnerToken(
1945
+ request: DeepPartial<GetWorkspaceInstanceOwnerTokenRequest>,
1946
+ options?: CallOptions & CallOptionsExt,
1947
+ ): Promise<GetWorkspaceInstanceOwnerTokenResponse>;
1948
+ /** ListenToWorkspaceInstance listens to workspace instance updates. */
1949
+ listenToWorkspaceInstance(
1950
+ request: DeepPartial<ListenToWorkspaceInstanceRequest>,
1951
+ options?: CallOptions & CallOptionsExt,
1952
+ ): AsyncIterable<ListenToWorkspaceInstanceResponse>;
1953
+ /** ListenToImageBuildLogs streams (currently or previously) running workspace image build logs */
1954
+ listenToImageBuildLogs(
1955
+ request: DeepPartial<ListenToImageBuildLogsRequest>,
1956
+ options?: CallOptions & CallOptionsExt,
1957
+ ): AsyncIterable<ListenToImageBuildLogsResponse>;
1958
+ /**
1959
+ * StopWorkspace stops a running workspace (instance).
1960
+ * Errors:
1961
+ * NOT_FOUND: the workspace_id is unkown
1962
+ * FAILED_PRECONDITION: if there's no running instance
1963
+ */
1964
+ stopWorkspace(
1965
+ request: DeepPartial<StopWorkspaceRequest>,
1966
+ options?: CallOptions & CallOptionsExt,
1967
+ ): AsyncIterable<StopWorkspaceResponse>;
1968
+ }
1969
+
1970
+ export interface DataLoaderOptions {
1971
+ cache?: boolean;
1972
+ }
1973
+
1974
+ export interface DataLoaders {
1975
+ rpcDataLoaderOptions?: DataLoaderOptions;
1976
+ getDataLoader<T>(identifier: string, constructorFn: () => T): T;
1977
+ }
1978
+
1979
+ declare var self: any | undefined;
1980
+ declare var window: any | undefined;
1981
+ declare var global: any | undefined;
1982
+ var globalThis: any = (() => {
1983
+ if (typeof globalThis !== "undefined") {
1984
+ return globalThis;
1985
+ }
1986
+ if (typeof self !== "undefined") {
1987
+ return self;
1988
+ }
1989
+ if (typeof window !== "undefined") {
1990
+ return window;
1991
+ }
1992
+ if (typeof global !== "undefined") {
1993
+ return global;
1994
+ }
1995
+ throw "Unable to locate global object";
1996
+ })();
1997
+
1998
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
1999
+
2000
+ export type DeepPartial<T> = T extends Builtin ? T
2001
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2002
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2003
+ : Partial<T>;
2004
+
2005
+ function toTimestamp(date: Date): Timestamp {
2006
+ const seconds = date.getTime() / 1_000;
2007
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2008
+ return { seconds, nanos };
2009
+ }
2010
+
2011
+ function fromTimestamp(t: Timestamp): Date {
2012
+ let millis = t.seconds * 1_000;
2013
+ millis += t.nanos / 1_000_000;
2014
+ return new Date(millis);
2015
+ }
2016
+
2017
+ function longToNumber(long: Long): number {
2018
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
2019
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2020
+ }
2021
+ return long.toNumber();
2022
+ }
2023
+
2024
+ // If you get a compile-error about 'Constructor<Long> and ... have no overlap',
2025
+ // add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.
2026
+ if (_m0.util.Long !== Long) {
2027
+ _m0.util.Long = Long as any;
2028
+ _m0.configure();
2029
+ }
2030
+
2031
+ export type ServerStreamingMethodResult<Response> = { [Symbol.asyncIterator](): AsyncIterator<Response, void> };