@nebius/js-sdk 0.1.40 → 0.1.41

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.
@@ -1,2987 +0,0 @@
1
- "use strict";
2
- /* Generated by Nebius TS generator. DO NOT EDIT! */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.JobStatus = exports.JobTemplateSpec = exports.JobContainerSpec = exports.JobSpec = exports.Job = exports.JobResult = exports.JobService = exports.JobServiceBaseClient = exports.JobServiceServiceDescription = exports.ListJobsResponse = exports.CancelJobRequest = exports.CreateJobRequest = exports.EndpointStatus = exports.EndpointTemplateSpec = exports.ProbeSpec = exports.EndpointContainerSpec = exports.EndpointSpec = exports.Endpoint = exports.EndpointService = exports.EndpointServiceBaseClient = exports.EndpointServiceServiceDescription = exports.ListEndpointsResponse = exports.CreateEndpointRequest = void 0;
5
- const index_1 = require("../../../../../runtime/protos/index");
6
- const util_1 = require("util");
7
- const protobuf_1 = require("../../../../protobuf");
8
- const logging_1 = require("../../../../../runtime/util/logging");
9
- const grpc_js_1 = require("@grpc/grpc-js");
10
- const request_1 = require("../../../../../runtime/request");
11
- const operation_1 = require("../../../../../runtime/operation");
12
- const v1_1 = require("../../../common/v1");
13
- const v1alpha1_1 = require("../../v1alpha1");
14
- const resource_1 = require("../../v1alpha1/resource");
15
- const __deprecatedWarned = new Set();
16
- exports.CreateEndpointRequest = {
17
- $type: "nebius.msp.serverless.v1alpha1.CreateEndpointRequest",
18
- encode(message, writer = new index_1.BinaryWriter()) {
19
- if (message.metadata !== undefined) {
20
- const w = writer.uint32(10).fork();
21
- v1_1.ResourceMetadata.encode(message.metadata, w);
22
- w.join();
23
- }
24
- if (message.spec !== undefined) {
25
- const w = writer.uint32(18).fork();
26
- exports.EndpointSpec.encode(message.spec, w);
27
- w.join();
28
- }
29
- if (message.dryRun === true) {
30
- writer.uint32(24).bool(message.dryRun);
31
- }
32
- if (message[index_1.unknownFieldsSymbol]) {
33
- writer.raw(message[index_1.unknownFieldsSymbol]);
34
- }
35
- return writer;
36
- },
37
- decode(input, length) {
38
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
39
- const end = length === undefined ? reader.len : reader.pos + length;
40
- const message = createBaseCreateEndpointRequest();
41
- let writer = undefined;
42
- while (reader.pos < end) {
43
- const tag = reader.uint32();
44
- switch (tag >>> 3) {
45
- case 1: {
46
- if (tag !== 10)
47
- break;
48
- message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
49
- continue;
50
- }
51
- case 2: {
52
- if (tag !== 18)
53
- break;
54
- message.spec = exports.EndpointSpec.decode(reader, reader.uint32());
55
- continue;
56
- }
57
- case 3: {
58
- if (tag !== 24)
59
- break;
60
- message.dryRun = reader.bool();
61
- continue;
62
- }
63
- default:
64
- break;
65
- }
66
- if ((tag & 7) === 4 || tag === 0) {
67
- break;
68
- }
69
- {
70
- if (!writer)
71
- writer = new index_1.BinaryWriter();
72
- const skipped = reader.skip(tag & 7, tag >>> 3);
73
- writer.uint32(tag).raw(skipped);
74
- }
75
- }
76
- if (writer) {
77
- message[index_1.unknownFieldsSymbol] = writer.finish();
78
- }
79
- return message;
80
- },
81
- fromJSON(object) {
82
- return applyCreateEndpointRequestCustom({
83
- $type: "nebius.msp.serverless.v1alpha1.CreateEndpointRequest",
84
- metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
85
- ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
86
- : undefined,
87
- spec: (0, index_1.isSet)(object.spec ?? object.spec)
88
- ? exports.EndpointSpec.fromJSON(object.spec ?? object.spec)
89
- : undefined,
90
- dryRun: (0, index_1.isSet)(object.dryRun ?? object.dry_run)
91
- ? Boolean(object.dryRun ?? object.dry_run)
92
- : false,
93
- });
94
- },
95
- toJSON(message, use = "json") {
96
- const obj = {};
97
- const pick = (json, pb) => (use === "json" ? json : pb);
98
- if (message.metadata !== undefined) {
99
- obj[pick("metadata", "metadata")] = message.metadata
100
- ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
101
- : undefined;
102
- }
103
- if (message.spec !== undefined) {
104
- obj[pick("spec", "spec")] = message.spec
105
- ? exports.EndpointSpec.toJSON(message.spec, use)
106
- : undefined;
107
- }
108
- if (message.dryRun === true) {
109
- obj[pick("dryRun", "dry_run")] = message.dryRun;
110
- }
111
- return obj;
112
- },
113
- create(base) {
114
- return exports.CreateEndpointRequest.fromPartial(base ?? {});
115
- },
116
- fromPartial(object) {
117
- const message = createBaseCreateEndpointRequest();
118
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
119
- ? v1_1.ResourceMetadata.fromPartial(object.metadata)
120
- : undefined;
121
- message.spec = (object.spec !== undefined && object.spec !== null)
122
- ? exports.EndpointSpec.fromPartial(object.spec)
123
- : undefined;
124
- message.dryRun = (object.dryRun !== undefined && object.dryRun !== null)
125
- ? object.dryRun
126
- : false;
127
- return message;
128
- },
129
- };
130
- protobuf_1.protoRegistry.registerMessage(exports.CreateEndpointRequest);
131
- function CreateEndpointRequestCustomInspect() {
132
- const parts = [];
133
- if (this.metadata !== undefined)
134
- parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
135
- if (this.spec !== undefined)
136
- parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
137
- if (this.dryRun === true)
138
- parts.push("dryRun" + "=" + (0, util_1.inspect)(this.dryRun));
139
- return `${this.$type}(${parts.join(", ")})`;
140
- }
141
- function CreateEndpointRequestCustomJson() {
142
- const obj = {
143
- type: this.$type,
144
- };
145
- if (this.metadata !== undefined)
146
- obj.metadata = (0, logging_1.inspectJson)(this.metadata);
147
- if (this.spec !== undefined)
148
- obj.spec = (0, logging_1.inspectJson)(this.spec);
149
- if (this.dryRun === true)
150
- obj.dryRun = (0, logging_1.inspectJson)(this.dryRun);
151
- return obj;
152
- }
153
- function applyCreateEndpointRequestCustom(message) {
154
- message[logging_1.custom] = CreateEndpointRequestCustomInspect;
155
- message[logging_1.customJson] = CreateEndpointRequestCustomJson;
156
- return message;
157
- }
158
- function createBaseCreateEndpointRequest() {
159
- const message = {
160
- $type: "nebius.msp.serverless.v1alpha1.CreateEndpointRequest",
161
- metadata: undefined,
162
- spec: undefined,
163
- dryRun: false,
164
- };
165
- return applyCreateEndpointRequestCustom(message);
166
- }
167
- exports.ListEndpointsResponse = {
168
- $type: "nebius.msp.serverless.v1alpha1.ListEndpointsResponse",
169
- encode(message, writer = new index_1.BinaryWriter()) {
170
- for (const v of (message.items ?? [])) {
171
- const w = writer.uint32(10).fork();
172
- exports.Endpoint.encode(v, w);
173
- w.join();
174
- }
175
- if (message.nextPageToken !== "") {
176
- writer.uint32(18).string(message.nextPageToken);
177
- }
178
- if (message[index_1.unknownFieldsSymbol]) {
179
- writer.raw(message[index_1.unknownFieldsSymbol]);
180
- }
181
- return writer;
182
- },
183
- decode(input, length) {
184
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
185
- const end = length === undefined ? reader.len : reader.pos + length;
186
- const message = createBaseListEndpointsResponse();
187
- let writer = undefined;
188
- while (reader.pos < end) {
189
- const tag = reader.uint32();
190
- switch (tag >>> 3) {
191
- case 1: {
192
- if (tag !== 10)
193
- break;
194
- message.items.push(exports.Endpoint.decode(reader, reader.uint32()));
195
- continue;
196
- }
197
- case 2: {
198
- if (tag !== 18)
199
- break;
200
- message.nextPageToken = reader.string();
201
- continue;
202
- }
203
- default:
204
- break;
205
- }
206
- if ((tag & 7) === 4 || tag === 0) {
207
- break;
208
- }
209
- {
210
- if (!writer)
211
- writer = new index_1.BinaryWriter();
212
- const skipped = reader.skip(tag & 7, tag >>> 3);
213
- writer.uint32(tag).raw(skipped);
214
- }
215
- }
216
- if (writer) {
217
- message[index_1.unknownFieldsSymbol] = writer.finish();
218
- }
219
- return message;
220
- },
221
- fromJSON(object) {
222
- return applyListEndpointsResponseCustom({
223
- $type: "nebius.msp.serverless.v1alpha1.ListEndpointsResponse",
224
- items: globalThis.Array.isArray(object?.items ?? object?.items)
225
- ? (object.items ?? object.items).map((e) => exports.Endpoint.fromJSON(e))
226
- : [],
227
- nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
228
- ? String(object.nextPageToken ?? object.next_page_token)
229
- : "",
230
- });
231
- },
232
- toJSON(message, use = "json") {
233
- const obj = {};
234
- const pick = (json, pb) => (use === "json" ? json : pb);
235
- if (message.items?.length) {
236
- obj[pick("items", "items")] = message.items.map((e) => e ? exports.Endpoint.toJSON(e, use) : undefined);
237
- }
238
- if (message.nextPageToken !== "") {
239
- obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
240
- }
241
- return obj;
242
- },
243
- create(base) {
244
- return exports.ListEndpointsResponse.fromPartial(base ?? {});
245
- },
246
- fromPartial(object) {
247
- const message = createBaseListEndpointsResponse();
248
- message.items = object.items?.map((e) => exports.Endpoint.fromPartial(e)) || [];
249
- message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
250
- ? object.nextPageToken
251
- : "";
252
- return message;
253
- },
254
- };
255
- protobuf_1.protoRegistry.registerMessage(exports.ListEndpointsResponse);
256
- function ListEndpointsResponseCustomInspect() {
257
- const parts = [];
258
- if ((this.items?.length ?? 0) !== 0)
259
- parts.push("items" + "=" + (0, util_1.inspect)(this.items));
260
- if (this.nextPageToken !== "")
261
- parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
262
- return `${this.$type}(${parts.join(", ")})`;
263
- }
264
- function ListEndpointsResponseCustomJson() {
265
- const obj = {
266
- type: this.$type,
267
- };
268
- if ((this.items?.length ?? 0) !== 0)
269
- obj.items = (0, logging_1.inspectJson)(this.items);
270
- if (this.nextPageToken !== "")
271
- obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
272
- return obj;
273
- }
274
- function applyListEndpointsResponseCustom(message) {
275
- message[logging_1.custom] = ListEndpointsResponseCustomInspect;
276
- message[logging_1.customJson] = ListEndpointsResponseCustomJson;
277
- return message;
278
- }
279
- function createBaseListEndpointsResponse() {
280
- const message = {
281
- $type: "nebius.msp.serverless.v1alpha1.ListEndpointsResponse",
282
- items: [],
283
- nextPageToken: "",
284
- };
285
- return applyListEndpointsResponseCustom(message);
286
- }
287
- exports.EndpointServiceServiceDescription = {
288
- get: {
289
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/Get",
290
- requestStream: false,
291
- responseStream: false,
292
- requestSerialize: (value) => Buffer.from(v1alpha1_1.GetRequest.encode(value).finish()),
293
- sendResetMask: false,
294
- requestDeserialize: (value) => v1alpha1_1.GetRequest.decode(value),
295
- responseSerialize: (value) => Buffer.from(exports.Endpoint.encode(value).finish()),
296
- responseDeserialize: (value) => exports.Endpoint.decode(value),
297
- },
298
- getByName: {
299
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/GetByName",
300
- requestStream: false,
301
- responseStream: false,
302
- requestSerialize: (value) => Buffer.from(v1alpha1_1.GetByNameRequest.encode(value).finish()),
303
- sendResetMask: false,
304
- requestDeserialize: (value) => v1alpha1_1.GetByNameRequest.decode(value),
305
- responseSerialize: (value) => Buffer.from(exports.Endpoint.encode(value).finish()),
306
- responseDeserialize: (value) => exports.Endpoint.decode(value),
307
- },
308
- list: {
309
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/List",
310
- requestStream: false,
311
- responseStream: false,
312
- requestSerialize: (value) => Buffer.from(v1alpha1_1.ListRequest.encode(value).finish()),
313
- sendResetMask: false,
314
- requestDeserialize: (value) => v1alpha1_1.ListRequest.decode(value),
315
- responseSerialize: (value) => Buffer.from(exports.ListEndpointsResponse.encode(value).finish()),
316
- responseDeserialize: (value) => exports.ListEndpointsResponse.decode(value),
317
- },
318
- create: {
319
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/Create",
320
- requestStream: false,
321
- responseStream: false,
322
- requestSerialize: (value) => Buffer.from(exports.CreateEndpointRequest.encode(value).finish()),
323
- sendResetMask: false,
324
- requestDeserialize: (value) => exports.CreateEndpointRequest.decode(value),
325
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
326
- responseDeserialize: (value) => v1_1.Operation.decode(value),
327
- },
328
- delete: {
329
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/Delete",
330
- requestStream: false,
331
- responseStream: false,
332
- requestSerialize: (value) => Buffer.from(v1alpha1_1.DeleteRequest.encode(value).finish()),
333
- sendResetMask: false,
334
- requestDeserialize: (value) => v1alpha1_1.DeleteRequest.decode(value),
335
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
336
- responseDeserialize: (value) => v1_1.Operation.decode(value),
337
- },
338
- start: {
339
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/Start",
340
- requestStream: false,
341
- responseStream: false,
342
- requestSerialize: (value) => Buffer.from(v1alpha1_1.StartRequest.encode(value).finish()),
343
- sendResetMask: false,
344
- requestDeserialize: (value) => v1alpha1_1.StartRequest.decode(value),
345
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
346
- responseDeserialize: (value) => v1_1.Operation.decode(value),
347
- },
348
- stop: {
349
- path: "/nebius.msp.serverless.v1alpha1.EndpointService/Stop",
350
- requestStream: false,
351
- responseStream: false,
352
- requestSerialize: (value) => Buffer.from(v1alpha1_1.StopRequest.encode(value).finish()),
353
- sendResetMask: false,
354
- requestDeserialize: (value) => v1alpha1_1.StopRequest.decode(value),
355
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
356
- responseDeserialize: (value) => v1_1.Operation.decode(value),
357
- },
358
- };
359
- exports.EndpointServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.EndpointServiceServiceDescription, "nebius.msp.serverless.v1alpha1.EndpointService");
360
- class EndpointService {
361
- sdk;
362
- $type = "nebius.msp.serverless.v1alpha1.EndpointService";
363
- addr;
364
- spec;
365
- apiServiceName = "apps.msp";
366
- constructor(sdk) {
367
- this.sdk = sdk;
368
- const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
369
- this.addr = addr;
370
- this.spec = exports.EndpointServiceServiceDescription;
371
- }
372
- getOperationService() {
373
- return new v1_1.OperationService(this.sdk, this.addr);
374
- }
375
- get(...args) {
376
- const spec = this.spec.get;
377
- const request = args[0];
378
- const metadata = (args.length > 1 ? args[1] : undefined);
379
- const options = (args.length > 2 ? args[2] : undefined);
380
- const deserialize = spec.responseDeserialize;
381
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
382
- }
383
- getByName(...args) {
384
- const spec = this.spec.getByName;
385
- const request = args[0];
386
- const metadata = (args.length > 1 ? args[1] : undefined);
387
- const options = (args.length > 2 ? args[2] : undefined);
388
- const deserialize = spec.responseDeserialize;
389
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
390
- }
391
- list(...args) {
392
- const spec = this.spec.list;
393
- const request = args[0];
394
- const metadata = (args.length > 1 ? args[1] : undefined);
395
- const options = (args.length > 2 ? args[2] : undefined);
396
- const deserialize = spec.responseDeserialize;
397
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
398
- }
399
- create(...args) {
400
- const spec = this.spec.create;
401
- const request = args[0];
402
- const metadata = (args.length > 1 ? args[1] : undefined);
403
- const options = (args.length > 2 ? args[2] : undefined);
404
- const deserialize = (value) => {
405
- const resp = spec.responseDeserialize(value);
406
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
407
- };
408
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
409
- }
410
- delete(...args) {
411
- const spec = this.spec.delete;
412
- const request = args[0];
413
- const metadata = (args.length > 1 ? args[1] : undefined);
414
- const options = (args.length > 2 ? args[2] : undefined);
415
- const deserialize = (value) => {
416
- const resp = spec.responseDeserialize(value);
417
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
418
- };
419
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
420
- }
421
- start(...args) {
422
- const spec = this.spec.start;
423
- const request = args[0];
424
- const metadata = (args.length > 1 ? args[1] : undefined);
425
- const options = (args.length > 2 ? args[2] : undefined);
426
- const deserialize = (value) => {
427
- const resp = spec.responseDeserialize(value);
428
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
429
- };
430
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
431
- }
432
- stop(...args) {
433
- const spec = this.spec.stop;
434
- const request = args[0];
435
- const metadata = (args.length > 1 ? args[1] : undefined);
436
- const options = (args.length > 2 ? args[2] : undefined);
437
- const deserialize = (value) => {
438
- const resp = spec.responseDeserialize(value);
439
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
440
- };
441
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
442
- }
443
- }
444
- exports.EndpointService = EndpointService;
445
- exports.Endpoint = {
446
- $type: "nebius.msp.serverless.v1alpha1.Endpoint",
447
- encode(message, writer = new index_1.BinaryWriter()) {
448
- if (message.metadata !== undefined) {
449
- const w = writer.uint32(10).fork();
450
- v1_1.ResourceMetadata.encode(message.metadata, w);
451
- w.join();
452
- }
453
- if (message.spec !== undefined) {
454
- const w = writer.uint32(18).fork();
455
- exports.EndpointSpec.encode(message.spec, w);
456
- w.join();
457
- }
458
- if (message.status !== undefined) {
459
- const w = writer.uint32(26).fork();
460
- exports.EndpointStatus.encode(message.status, w);
461
- w.join();
462
- }
463
- if (message[index_1.unknownFieldsSymbol]) {
464
- writer.raw(message[index_1.unknownFieldsSymbol]);
465
- }
466
- return writer;
467
- },
468
- decode(input, length) {
469
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
470
- const end = length === undefined ? reader.len : reader.pos + length;
471
- const message = createBaseEndpoint();
472
- let writer = undefined;
473
- while (reader.pos < end) {
474
- const tag = reader.uint32();
475
- switch (tag >>> 3) {
476
- case 1: {
477
- if (tag !== 10)
478
- break;
479
- message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
480
- continue;
481
- }
482
- case 2: {
483
- if (tag !== 18)
484
- break;
485
- message.spec = exports.EndpointSpec.decode(reader, reader.uint32());
486
- continue;
487
- }
488
- case 3: {
489
- if (tag !== 26)
490
- break;
491
- message.status = exports.EndpointStatus.decode(reader, reader.uint32());
492
- continue;
493
- }
494
- default:
495
- break;
496
- }
497
- if ((tag & 7) === 4 || tag === 0) {
498
- break;
499
- }
500
- {
501
- if (!writer)
502
- writer = new index_1.BinaryWriter();
503
- const skipped = reader.skip(tag & 7, tag >>> 3);
504
- writer.uint32(tag).raw(skipped);
505
- }
506
- }
507
- if (writer) {
508
- message[index_1.unknownFieldsSymbol] = writer.finish();
509
- }
510
- return message;
511
- },
512
- fromJSON(object) {
513
- return applyEndpointCustom({
514
- $type: "nebius.msp.serverless.v1alpha1.Endpoint",
515
- metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
516
- ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
517
- : undefined,
518
- spec: (0, index_1.isSet)(object.spec ?? object.spec)
519
- ? exports.EndpointSpec.fromJSON(object.spec ?? object.spec)
520
- : undefined,
521
- status: (0, index_1.isSet)(object.status ?? object.status)
522
- ? exports.EndpointStatus.fromJSON(object.status ?? object.status)
523
- : undefined,
524
- });
525
- },
526
- toJSON(message, use = "json") {
527
- const obj = {};
528
- const pick = (json, pb) => (use === "json" ? json : pb);
529
- if (message.metadata !== undefined) {
530
- obj[pick("metadata", "metadata")] = message.metadata
531
- ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
532
- : undefined;
533
- }
534
- if (message.spec !== undefined) {
535
- obj[pick("spec", "spec")] = message.spec
536
- ? exports.EndpointSpec.toJSON(message.spec, use)
537
- : undefined;
538
- }
539
- if (message.status !== undefined) {
540
- obj[pick("status", "status")] = message.status
541
- ? exports.EndpointStatus.toJSON(message.status, use)
542
- : undefined;
543
- }
544
- return obj;
545
- },
546
- create(base) {
547
- return exports.Endpoint.fromPartial(base ?? {});
548
- },
549
- fromPartial(object) {
550
- const message = createBaseEndpoint();
551
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
552
- ? v1_1.ResourceMetadata.fromPartial(object.metadata)
553
- : undefined;
554
- message.spec = (object.spec !== undefined && object.spec !== null)
555
- ? exports.EndpointSpec.fromPartial(object.spec)
556
- : undefined;
557
- message.status = (object.status !== undefined && object.status !== null)
558
- ? exports.EndpointStatus.fromPartial(object.status)
559
- : undefined;
560
- return message;
561
- },
562
- };
563
- protobuf_1.protoRegistry.registerMessage(exports.Endpoint);
564
- function EndpointCustomInspect() {
565
- const parts = [];
566
- if (this.metadata !== undefined)
567
- parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
568
- if (this.spec !== undefined)
569
- parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
570
- if (this.status !== undefined)
571
- parts.push("status" + "=" + (0, util_1.inspect)(this.status));
572
- return `${this.$type}(${parts.join(", ")})`;
573
- }
574
- function EndpointCustomJson() {
575
- const obj = {
576
- type: this.$type,
577
- };
578
- if (this.metadata !== undefined)
579
- obj.metadata = (0, logging_1.inspectJson)(this.metadata);
580
- if (this.spec !== undefined)
581
- obj.spec = (0, logging_1.inspectJson)(this.spec);
582
- if (this.status !== undefined)
583
- obj.status = (0, logging_1.inspectJson)(this.status);
584
- return obj;
585
- }
586
- function applyEndpointCustom(message) {
587
- message[logging_1.custom] = EndpointCustomInspect;
588
- message[logging_1.customJson] = EndpointCustomJson;
589
- return message;
590
- }
591
- function createBaseEndpoint() {
592
- const message = {
593
- $type: "nebius.msp.serverless.v1alpha1.Endpoint",
594
- metadata: undefined,
595
- spec: undefined,
596
- status: undefined,
597
- };
598
- return applyEndpointCustom(message);
599
- }
600
- exports.EndpointSpec = {
601
- $type: "nebius.msp.serverless.v1alpha1.EndpointSpec",
602
- encode(message, writer = new index_1.BinaryWriter()) {
603
- if (message.description !== "") {
604
- writer.uint32(10).string(message.description);
605
- }
606
- if (message.networkId !== "") {
607
- writer.uint32(18).string(message.networkId);
608
- }
609
- if (message.username !== "") {
610
- writer.uint32(26).string(message.username);
611
- }
612
- if (message.password !== "") {
613
- writer.uint32(34).string(message.password);
614
- }
615
- if ((message.port ?? 0) !== 0) {
616
- writer.uint32(40).uint32(message.port);
617
- }
618
- if (message.container !== undefined) {
619
- const w = writer.uint32(810).fork();
620
- exports.EndpointContainerSpec.encode(message.container, w);
621
- w.join();
622
- }
623
- if (message[index_1.unknownFieldsSymbol]) {
624
- writer.raw(message[index_1.unknownFieldsSymbol]);
625
- }
626
- return writer;
627
- },
628
- decode(input, length) {
629
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
630
- const end = length === undefined ? reader.len : reader.pos + length;
631
- const message = createBaseEndpointSpec();
632
- let writer = undefined;
633
- while (reader.pos < end) {
634
- const tag = reader.uint32();
635
- switch (tag >>> 3) {
636
- case 1: {
637
- if (tag !== 10)
638
- break;
639
- message.description = reader.string();
640
- continue;
641
- }
642
- case 2: {
643
- if (tag !== 18)
644
- break;
645
- message.networkId = reader.string();
646
- continue;
647
- }
648
- case 3: {
649
- if (tag !== 26)
650
- break;
651
- message.username = reader.string();
652
- continue;
653
- }
654
- case 4: {
655
- if (tag !== 34)
656
- break;
657
- message.password = reader.string();
658
- continue;
659
- }
660
- case 5: {
661
- if (tag !== 40)
662
- break;
663
- message.port = reader.uint32();
664
- continue;
665
- }
666
- case 101: {
667
- if (tag !== 810)
668
- break;
669
- message.container = exports.EndpointContainerSpec.decode(reader, reader.uint32());
670
- continue;
671
- }
672
- default:
673
- break;
674
- }
675
- if ((tag & 7) === 4 || tag === 0) {
676
- break;
677
- }
678
- {
679
- if (!writer)
680
- writer = new index_1.BinaryWriter();
681
- const skipped = reader.skip(tag & 7, tag >>> 3);
682
- writer.uint32(tag).raw(skipped);
683
- }
684
- }
685
- if (writer) {
686
- message[index_1.unknownFieldsSymbol] = writer.finish();
687
- }
688
- return message;
689
- },
690
- fromJSON(object) {
691
- return applyEndpointSpecCustom({
692
- $type: "nebius.msp.serverless.v1alpha1.EndpointSpec",
693
- description: (0, index_1.isSet)(object.description ?? object.description)
694
- ? String(object.description ?? object.description)
695
- : "",
696
- networkId: (0, index_1.isSet)(object.networkId ?? object.network_id)
697
- ? String(object.networkId ?? object.network_id)
698
- : "",
699
- username: (0, index_1.isSet)(object.username ?? object.username)
700
- ? String(object.username ?? object.username)
701
- : "",
702
- password: (0, index_1.isSet)(object.password ?? object.password)
703
- ? String(object.password ?? object.password)
704
- : "",
705
- port: (0, index_1.isSet)(object.port ?? object.port)
706
- ? Number(object.port ?? object.port)
707
- : 0,
708
- container: (0, index_1.isSet)(object.container ?? object.container)
709
- ? exports.EndpointContainerSpec.fromJSON(object.container ?? object.container)
710
- : undefined,
711
- });
712
- },
713
- toJSON(message, use = "json") {
714
- const obj = {};
715
- const pick = (json, pb) => (use === "json" ? json : pb);
716
- if (message.description !== "") {
717
- obj[pick("description", "description")] = message.description;
718
- }
719
- if (message.networkId !== "") {
720
- obj[pick("networkId", "network_id")] = message.networkId;
721
- }
722
- if (message.username !== "") {
723
- obj[pick("username", "username")] = message.username;
724
- }
725
- if (message.password !== "") {
726
- obj[pick("password", "password")] = message.password;
727
- }
728
- if ((message.port ?? 0) !== 0) {
729
- obj[pick("port", "port")] = message.port;
730
- }
731
- if (message.container !== undefined) {
732
- obj[pick("container", "container")] = message.container
733
- ? exports.EndpointContainerSpec.toJSON(message.container, use)
734
- : undefined;
735
- }
736
- return obj;
737
- },
738
- create(base) {
739
- return exports.EndpointSpec.fromPartial(base ?? {});
740
- },
741
- fromPartial(object) {
742
- const message = createBaseEndpointSpec();
743
- message.description = (object.description !== undefined && object.description !== null)
744
- ? object.description
745
- : "";
746
- message.networkId = (object.networkId !== undefined && object.networkId !== null)
747
- ? object.networkId
748
- : "";
749
- message.username = (object.username !== undefined && object.username !== null)
750
- ? object.username
751
- : "";
752
- message.password = (object.password !== undefined && object.password !== null)
753
- ? object.password
754
- : "";
755
- message.port = (object.port !== undefined && object.port !== null)
756
- ? object.port
757
- : 0;
758
- message.container = (object.container !== undefined && object.container !== null)
759
- ? exports.EndpointContainerSpec.fromPartial(object.container)
760
- : undefined;
761
- return message;
762
- },
763
- };
764
- protobuf_1.protoRegistry.registerMessage(exports.EndpointSpec);
765
- function EndpointSpecCustomInspect() {
766
- const parts = [];
767
- if (this.description !== "")
768
- parts.push("description" + "=" + (0, util_1.inspect)(this.description));
769
- if (this.networkId !== "")
770
- parts.push("networkId" + "=" + (0, util_1.inspect)(this.networkId));
771
- if (this.username !== "")
772
- parts.push("username" + "=***");
773
- if (this.password !== "")
774
- parts.push("password" + "=***");
775
- if ((this.port ?? 0) !== 0)
776
- parts.push("port" + "=" + (0, util_1.inspect)(this.port));
777
- if (this.container !== undefined)
778
- parts.push("container" + "=" + (0, util_1.inspect)(this.container));
779
- return `${this.$type}(${parts.join(", ")})`;
780
- }
781
- function EndpointSpecCustomJson() {
782
- const obj = {
783
- type: this.$type,
784
- };
785
- if (this.description !== "")
786
- obj.description = (0, logging_1.inspectJson)(this.description);
787
- if (this.networkId !== "")
788
- obj.networkId = (0, logging_1.inspectJson)(this.networkId);
789
- if (this.username !== "")
790
- obj.username = "***";
791
- if (this.password !== "")
792
- obj.password = "***";
793
- if ((this.port ?? 0) !== 0)
794
- obj.port = (0, logging_1.inspectJson)(this.port);
795
- if (this.container !== undefined)
796
- obj.container = (0, logging_1.inspectJson)(this.container);
797
- return obj;
798
- }
799
- function applyEndpointSpecCustom(message) {
800
- message[logging_1.custom] = EndpointSpecCustomInspect;
801
- message[logging_1.customJson] = EndpointSpecCustomJson;
802
- return message;
803
- }
804
- function createBaseEndpointSpec() {
805
- const message = {
806
- $type: "nebius.msp.serverless.v1alpha1.EndpointSpec",
807
- description: "",
808
- networkId: "",
809
- username: "",
810
- password: "",
811
- port: 0,
812
- container: undefined,
813
- };
814
- return applyEndpointSpecCustom(message);
815
- }
816
- exports.EndpointContainerSpec = {
817
- $type: "nebius.msp.serverless.v1alpha1.EndpointContainerSpec",
818
- encode(message, writer = new index_1.BinaryWriter()) {
819
- if (message.image !== "") {
820
- writer.uint32(10).string(message.image);
821
- }
822
- if (message.replicaCount !== undefined && !message.replicaCount.isZero?.()) {
823
- writer.uint32(16).int64(message.replicaCount.toString());
824
- }
825
- if (message.template !== undefined) {
826
- const w = writer.uint32(26).fork();
827
- exports.EndpointTemplateSpec.encode(message.template, w);
828
- w.join();
829
- }
830
- if (message.command !== "") {
831
- writer.uint32(810).string(message.command);
832
- }
833
- for (const v of (message.args ?? [])) {
834
- writer.uint32(818).string(v);
835
- }
836
- for (const [k, v] of Object.entries(message.envs ?? {})) {
837
- const w = writer.uint32(826).fork();
838
- w.uint32(10).string(k);
839
- w.uint32(18).string(v);
840
- w.join();
841
- }
842
- for (const [k, v] of Object.entries(message.sensitiveEnvs ?? {})) {
843
- const w = writer.uint32(834).fork();
844
- w.uint32(10).string(k);
845
- w.uint32(18).string(v);
846
- w.join();
847
- }
848
- if (message.liveness !== undefined) {
849
- const w = writer.uint32(1610).fork();
850
- exports.ProbeSpec.encode(message.liveness, w);
851
- w.join();
852
- }
853
- if (message[index_1.unknownFieldsSymbol]) {
854
- writer.raw(message[index_1.unknownFieldsSymbol]);
855
- }
856
- return writer;
857
- },
858
- decode(input, length) {
859
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
860
- const end = length === undefined ? reader.len : reader.pos + length;
861
- const message = createBaseEndpointContainerSpec();
862
- let writer = undefined;
863
- while (reader.pos < end) {
864
- const tag = reader.uint32();
865
- switch (tag >>> 3) {
866
- case 1: {
867
- if (tag !== 10)
868
- break;
869
- message.image = reader.string();
870
- continue;
871
- }
872
- case 2: {
873
- if (tag !== 16)
874
- break;
875
- message.replicaCount = index_1.Long.fromValue(reader.int64());
876
- continue;
877
- }
878
- case 3: {
879
- if (tag !== 26)
880
- break;
881
- message.template = exports.EndpointTemplateSpec.decode(reader, reader.uint32());
882
- continue;
883
- }
884
- case 101: {
885
- if (tag !== 810)
886
- break;
887
- message.command = reader.string();
888
- continue;
889
- }
890
- case 102: {
891
- if (tag !== 818)
892
- break;
893
- message.args.push(reader.string());
894
- continue;
895
- }
896
- case 103: {
897
- if (tag !== 826)
898
- break; // wire type guard
899
- const end2 = reader.uint32() + reader.pos;
900
- let key = "";
901
- let value = undefined;
902
- while (reader.pos < end2) {
903
- const tag2 = reader.uint32();
904
- switch (tag2 >>> 3) {
905
- case 1: {
906
- key = reader.string();
907
- continue;
908
- }
909
- case 2: {
910
- value = reader.string();
911
- continue;
912
- }
913
- }
914
- if ((tag2 & 7) === 4 || tag2 === 0)
915
- break;
916
- reader.skip(tag2 & 7);
917
- }
918
- if (value !== undefined) {
919
- const stringKey = String(key);
920
- message.envs[stringKey] = value;
921
- }
922
- continue;
923
- }
924
- case 104: {
925
- if (tag !== 834)
926
- break; // wire type guard
927
- const end2 = reader.uint32() + reader.pos;
928
- let key = "";
929
- let value = undefined;
930
- while (reader.pos < end2) {
931
- const tag2 = reader.uint32();
932
- switch (tag2 >>> 3) {
933
- case 1: {
934
- key = reader.string();
935
- continue;
936
- }
937
- case 2: {
938
- value = reader.string();
939
- continue;
940
- }
941
- }
942
- if ((tag2 & 7) === 4 || tag2 === 0)
943
- break;
944
- reader.skip(tag2 & 7);
945
- }
946
- if (value !== undefined) {
947
- const stringKey = String(key);
948
- message.sensitiveEnvs[stringKey] = value;
949
- }
950
- continue;
951
- }
952
- case 201: {
953
- if (tag !== 1610)
954
- break;
955
- message.liveness = exports.ProbeSpec.decode(reader, reader.uint32());
956
- continue;
957
- }
958
- default:
959
- break;
960
- }
961
- if ((tag & 7) === 4 || tag === 0) {
962
- break;
963
- }
964
- {
965
- if (!writer)
966
- writer = new index_1.BinaryWriter();
967
- const skipped = reader.skip(tag & 7, tag >>> 3);
968
- writer.uint32(tag).raw(skipped);
969
- }
970
- }
971
- if (writer) {
972
- message[index_1.unknownFieldsSymbol] = writer.finish();
973
- }
974
- return message;
975
- },
976
- fromJSON(object) {
977
- return applyEndpointContainerSpecCustom({
978
- $type: "nebius.msp.serverless.v1alpha1.EndpointContainerSpec",
979
- image: (0, index_1.isSet)(object.image ?? object.image)
980
- ? String(object.image ?? object.image)
981
- : "",
982
- replicaCount: (0, index_1.isSet)(object.replicaCount ?? object.replica_count)
983
- ? index_1.Long.fromValue(object.replicaCount ?? object.replica_count)
984
- : index_1.Long.ZERO,
985
- template: (0, index_1.isSet)(object.template ?? object.template)
986
- ? exports.EndpointTemplateSpec.fromJSON(object.template ?? object.template)
987
- : undefined,
988
- command: (0, index_1.isSet)(object.command ?? object.command)
989
- ? String(object.command ?? object.command)
990
- : "",
991
- args: globalThis.Array.isArray(object?.args ?? object?.args)
992
- ? (object.args ?? object.args).map((e) => String(e))
993
- : [],
994
- envs: ((0, index_1.isSet)(object.envs) && typeof object.envs === "object" ? object.envs
995
- : ((0, index_1.isSet)(object.envs) && typeof object.envs === "object" ? object.envs : undefined))
996
- ? Object.entries((object.envs ?? object.envs)).reduce((acc, [key, value]) => {
997
- acc[key] = String(value);
998
- return acc;
999
- }, {})
1000
- : {},
1001
- sensitiveEnvs: ((0, index_1.isSet)(object.sensitiveEnvs) && typeof object.sensitiveEnvs === "object" ? object.sensitiveEnvs
1002
- : ((0, index_1.isSet)(object.sensitive_envs) && typeof object.sensitive_envs === "object" ? object.sensitive_envs : undefined))
1003
- ? Object.entries((object.sensitiveEnvs ?? object.sensitive_envs)).reduce((acc, [key, value]) => {
1004
- acc[key] = String(value);
1005
- return acc;
1006
- }, {})
1007
- : {},
1008
- liveness: (0, index_1.isSet)(object.liveness ?? object.liveness)
1009
- ? exports.ProbeSpec.fromJSON(object.liveness ?? object.liveness)
1010
- : undefined,
1011
- });
1012
- },
1013
- toJSON(message, use = "json") {
1014
- const obj = {};
1015
- const pick = (json, pb) => (use === "json" ? json : pb);
1016
- if (message.image !== "") {
1017
- obj[pick("image", "image")] = message.image;
1018
- }
1019
- if (!message.replicaCount?.isZero?.()) {
1020
- obj[pick("replicaCount", "replica_count")] = (message.replicaCount || index_1.Long.ZERO).toString();
1021
- }
1022
- if (message.template !== undefined) {
1023
- obj[pick("template", "template")] = message.template
1024
- ? exports.EndpointTemplateSpec.toJSON(message.template, use)
1025
- : undefined;
1026
- }
1027
- if (message.command !== "") {
1028
- obj[pick("command", "command")] = message.command;
1029
- }
1030
- if (message.args?.length) {
1031
- obj[pick("args", "args")] = message.args.map((e) => e);
1032
- }
1033
- if (message.envs) {
1034
- const entries = Object.entries(message.envs);
1035
- if (entries.length > 0) {
1036
- obj[pick("envs", "envs")] = {};
1037
- entries.forEach(([k, v]) => {
1038
- obj[pick("envs", "envs")][k] = v;
1039
- });
1040
- }
1041
- }
1042
- if (message.sensitiveEnvs) {
1043
- const entries = Object.entries(message.sensitiveEnvs);
1044
- if (entries.length > 0) {
1045
- obj[pick("sensitiveEnvs", "sensitive_envs")] = {};
1046
- entries.forEach(([k, v]) => {
1047
- obj[pick("sensitiveEnvs", "sensitive_envs")][k] = v;
1048
- });
1049
- }
1050
- }
1051
- if (message.liveness !== undefined) {
1052
- obj[pick("liveness", "liveness")] = message.liveness
1053
- ? exports.ProbeSpec.toJSON(message.liveness, use)
1054
- : undefined;
1055
- }
1056
- return obj;
1057
- },
1058
- create(base) {
1059
- return exports.EndpointContainerSpec.fromPartial(base ?? {});
1060
- },
1061
- fromPartial(object) {
1062
- const message = createBaseEndpointContainerSpec();
1063
- message.image = (object.image !== undefined && object.image !== null)
1064
- ? object.image
1065
- : "";
1066
- message.replicaCount = (object.replicaCount !== undefined && object.replicaCount !== null)
1067
- ? index_1.Long.fromValue(object.replicaCount)
1068
- : index_1.Long.ZERO;
1069
- message.template = (object.template !== undefined && object.template !== null)
1070
- ? exports.EndpointTemplateSpec.fromPartial(object.template)
1071
- : undefined;
1072
- message.command = (object.command !== undefined && object.command !== null)
1073
- ? object.command
1074
- : "";
1075
- message.args = object.args?.map((e) => e) || [];
1076
- message.envs = Object.entries(object.envs ?? {}).reduce((acc, [key, value]) => {
1077
- if (value !== undefined) {
1078
- acc[key] = value;
1079
- }
1080
- return acc;
1081
- }, {});
1082
- message.sensitiveEnvs = Object.entries(object.sensitiveEnvs ?? {}).reduce((acc, [key, value]) => {
1083
- if (value !== undefined) {
1084
- acc[key] = value;
1085
- }
1086
- return acc;
1087
- }, {});
1088
- message.liveness = (object.liveness !== undefined && object.liveness !== null)
1089
- ? exports.ProbeSpec.fromPartial(object.liveness)
1090
- : undefined;
1091
- return message;
1092
- },
1093
- };
1094
- protobuf_1.protoRegistry.registerMessage(exports.EndpointContainerSpec);
1095
- function EndpointContainerSpecCustomInspect() {
1096
- const parts = [];
1097
- if (this.image !== "")
1098
- parts.push("image" + "=" + (0, util_1.inspect)(this.image));
1099
- if (!this.replicaCount?.isZero?.())
1100
- parts.push("replicaCount" + "=" + (0, util_1.inspect)(this.replicaCount));
1101
- if (this.template !== undefined)
1102
- parts.push("template" + "=" + (0, util_1.inspect)(this.template));
1103
- if (this.command !== "")
1104
- parts.push("command" + "=" + (0, util_1.inspect)(this.command));
1105
- if ((this.args?.length ?? 0) !== 0)
1106
- parts.push("args" + "=" + (0, util_1.inspect)(this.args));
1107
- if (Object.keys(this.envs || {}).length)
1108
- parts.push("envs" + "=" + (0, util_1.inspect)(this.envs));
1109
- if (Object.keys(this.sensitiveEnvs || {}).length)
1110
- parts.push("sensitiveEnvs" + "=***");
1111
- if (this.liveness !== undefined)
1112
- parts.push("liveness" + "=" + (0, util_1.inspect)(this.liveness));
1113
- return `${this.$type}(${parts.join(", ")})`;
1114
- }
1115
- function EndpointContainerSpecCustomJson() {
1116
- const obj = {
1117
- type: this.$type,
1118
- };
1119
- if (this.image !== "")
1120
- obj.image = (0, logging_1.inspectJson)(this.image);
1121
- if (!this.replicaCount?.isZero?.())
1122
- obj.replicaCount = (0, logging_1.inspectJson)(this.replicaCount);
1123
- if (this.template !== undefined)
1124
- obj.template = (0, logging_1.inspectJson)(this.template);
1125
- if (this.command !== "")
1126
- obj.command = (0, logging_1.inspectJson)(this.command);
1127
- if ((this.args?.length ?? 0) !== 0)
1128
- obj.args = (0, logging_1.inspectJson)(this.args);
1129
- if (Object.keys(this.envs || {}).length)
1130
- obj.envs = (0, logging_1.inspectJson)(this.envs);
1131
- if (Object.keys(this.sensitiveEnvs || {}).length)
1132
- obj.sensitiveEnvs = "***";
1133
- if (this.liveness !== undefined)
1134
- obj.liveness = (0, logging_1.inspectJson)(this.liveness);
1135
- return obj;
1136
- }
1137
- function applyEndpointContainerSpecCustom(message) {
1138
- message[logging_1.custom] = EndpointContainerSpecCustomInspect;
1139
- message[logging_1.customJson] = EndpointContainerSpecCustomJson;
1140
- return message;
1141
- }
1142
- function createBaseEndpointContainerSpec() {
1143
- const message = {
1144
- $type: "nebius.msp.serverless.v1alpha1.EndpointContainerSpec",
1145
- image: "",
1146
- replicaCount: index_1.Long.ZERO,
1147
- template: undefined,
1148
- command: "",
1149
- args: [],
1150
- envs: {},
1151
- sensitiveEnvs: {},
1152
- liveness: undefined,
1153
- };
1154
- return applyEndpointContainerSpecCustom(message);
1155
- }
1156
- exports.ProbeSpec = {
1157
- $type: "nebius.msp.serverless.v1alpha1.ProbeSpec",
1158
- encode(message, writer = new index_1.BinaryWriter()) {
1159
- if (message.path !== "") {
1160
- writer.uint32(10).string(message.path);
1161
- }
1162
- if (message.delaySeconds !== undefined && !message.delaySeconds.isZero?.()) {
1163
- writer.uint32(40).int64(message.delaySeconds.toString());
1164
- }
1165
- if (message.periodSeconds !== undefined && !message.periodSeconds.isZero?.()) {
1166
- writer.uint32(48).int64(message.periodSeconds.toString());
1167
- }
1168
- if (message.failureThreshold !== undefined && !message.failureThreshold.isZero?.()) {
1169
- writer.uint32(56).int64(message.failureThreshold.toString());
1170
- }
1171
- if (message[index_1.unknownFieldsSymbol]) {
1172
- writer.raw(message[index_1.unknownFieldsSymbol]);
1173
- }
1174
- return writer;
1175
- },
1176
- decode(input, length) {
1177
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1178
- const end = length === undefined ? reader.len : reader.pos + length;
1179
- const message = createBaseProbeSpec();
1180
- let writer = undefined;
1181
- while (reader.pos < end) {
1182
- const tag = reader.uint32();
1183
- switch (tag >>> 3) {
1184
- case 1: {
1185
- if (tag !== 10)
1186
- break;
1187
- message.path = reader.string();
1188
- continue;
1189
- }
1190
- case 5: {
1191
- if (tag !== 40)
1192
- break;
1193
- message.delaySeconds = index_1.Long.fromValue(reader.int64());
1194
- continue;
1195
- }
1196
- case 6: {
1197
- if (tag !== 48)
1198
- break;
1199
- message.periodSeconds = index_1.Long.fromValue(reader.int64());
1200
- continue;
1201
- }
1202
- case 7: {
1203
- if (tag !== 56)
1204
- break;
1205
- message.failureThreshold = index_1.Long.fromValue(reader.int64());
1206
- continue;
1207
- }
1208
- default:
1209
- break;
1210
- }
1211
- if ((tag & 7) === 4 || tag === 0) {
1212
- break;
1213
- }
1214
- {
1215
- if (!writer)
1216
- writer = new index_1.BinaryWriter();
1217
- const skipped = reader.skip(tag & 7, tag >>> 3);
1218
- writer.uint32(tag).raw(skipped);
1219
- }
1220
- }
1221
- if (writer) {
1222
- message[index_1.unknownFieldsSymbol] = writer.finish();
1223
- }
1224
- return message;
1225
- },
1226
- fromJSON(object) {
1227
- return applyProbeSpecCustom({
1228
- $type: "nebius.msp.serverless.v1alpha1.ProbeSpec",
1229
- path: (0, index_1.isSet)(object.path ?? object.path)
1230
- ? String(object.path ?? object.path)
1231
- : "",
1232
- delaySeconds: (0, index_1.isSet)(object.delaySeconds ?? object.delay_seconds)
1233
- ? index_1.Long.fromValue(object.delaySeconds ?? object.delay_seconds)
1234
- : index_1.Long.ZERO,
1235
- periodSeconds: (0, index_1.isSet)(object.periodSeconds ?? object.period_seconds)
1236
- ? index_1.Long.fromValue(object.periodSeconds ?? object.period_seconds)
1237
- : index_1.Long.ZERO,
1238
- failureThreshold: (0, index_1.isSet)(object.failureThreshold ?? object.failure_threshold)
1239
- ? index_1.Long.fromValue(object.failureThreshold ?? object.failure_threshold)
1240
- : index_1.Long.ZERO,
1241
- });
1242
- },
1243
- toJSON(message, use = "json") {
1244
- const obj = {};
1245
- const pick = (json, pb) => (use === "json" ? json : pb);
1246
- if (message.path !== "") {
1247
- obj[pick("path", "path")] = message.path;
1248
- }
1249
- if (!message.delaySeconds?.isZero?.()) {
1250
- obj[pick("delaySeconds", "delay_seconds")] = (message.delaySeconds || index_1.Long.ZERO).toString();
1251
- }
1252
- if (!message.periodSeconds?.isZero?.()) {
1253
- obj[pick("periodSeconds", "period_seconds")] = (message.periodSeconds || index_1.Long.ZERO).toString();
1254
- }
1255
- if (!message.failureThreshold?.isZero?.()) {
1256
- obj[pick("failureThreshold", "failure_threshold")] = (message.failureThreshold || index_1.Long.ZERO).toString();
1257
- }
1258
- return obj;
1259
- },
1260
- create(base) {
1261
- return exports.ProbeSpec.fromPartial(base ?? {});
1262
- },
1263
- fromPartial(object) {
1264
- const message = createBaseProbeSpec();
1265
- message.path = (object.path !== undefined && object.path !== null)
1266
- ? object.path
1267
- : "";
1268
- message.delaySeconds = (object.delaySeconds !== undefined && object.delaySeconds !== null)
1269
- ? index_1.Long.fromValue(object.delaySeconds)
1270
- : index_1.Long.ZERO;
1271
- message.periodSeconds = (object.periodSeconds !== undefined && object.periodSeconds !== null)
1272
- ? index_1.Long.fromValue(object.periodSeconds)
1273
- : index_1.Long.ZERO;
1274
- message.failureThreshold = (object.failureThreshold !== undefined && object.failureThreshold !== null)
1275
- ? index_1.Long.fromValue(object.failureThreshold)
1276
- : index_1.Long.ZERO;
1277
- return message;
1278
- },
1279
- };
1280
- protobuf_1.protoRegistry.registerMessage(exports.ProbeSpec);
1281
- function ProbeSpecCustomInspect() {
1282
- const parts = [];
1283
- if (this.path !== "")
1284
- parts.push("path" + "=" + (0, util_1.inspect)(this.path));
1285
- if (!this.delaySeconds?.isZero?.())
1286
- parts.push("delaySeconds" + "=" + (0, util_1.inspect)(this.delaySeconds));
1287
- if (!this.periodSeconds?.isZero?.())
1288
- parts.push("periodSeconds" + "=" + (0, util_1.inspect)(this.periodSeconds));
1289
- if (!this.failureThreshold?.isZero?.())
1290
- parts.push("failureThreshold" + "=" + (0, util_1.inspect)(this.failureThreshold));
1291
- return `${this.$type}(${parts.join(", ")})`;
1292
- }
1293
- function ProbeSpecCustomJson() {
1294
- const obj = {
1295
- type: this.$type,
1296
- };
1297
- if (this.path !== "")
1298
- obj.path = (0, logging_1.inspectJson)(this.path);
1299
- if (!this.delaySeconds?.isZero?.())
1300
- obj.delaySeconds = (0, logging_1.inspectJson)(this.delaySeconds);
1301
- if (!this.periodSeconds?.isZero?.())
1302
- obj.periodSeconds = (0, logging_1.inspectJson)(this.periodSeconds);
1303
- if (!this.failureThreshold?.isZero?.())
1304
- obj.failureThreshold = (0, logging_1.inspectJson)(this.failureThreshold);
1305
- return obj;
1306
- }
1307
- function applyProbeSpecCustom(message) {
1308
- message[logging_1.custom] = ProbeSpecCustomInspect;
1309
- message[logging_1.customJson] = ProbeSpecCustomJson;
1310
- return message;
1311
- }
1312
- function createBaseProbeSpec() {
1313
- const message = {
1314
- $type: "nebius.msp.serverless.v1alpha1.ProbeSpec",
1315
- path: "",
1316
- delaySeconds: index_1.Long.ZERO,
1317
- periodSeconds: index_1.Long.ZERO,
1318
- failureThreshold: index_1.Long.ZERO,
1319
- };
1320
- return applyProbeSpecCustom(message);
1321
- }
1322
- exports.EndpointTemplateSpec = {
1323
- $type: "nebius.msp.serverless.v1alpha1.EndpointTemplateSpec",
1324
- encode(message, writer = new index_1.BinaryWriter()) {
1325
- if (message.resources !== undefined) {
1326
- const w = writer.uint32(10).fork();
1327
- resource_1.ResourcesSpec.encode(message.resources, w);
1328
- w.join();
1329
- }
1330
- if (message[index_1.unknownFieldsSymbol]) {
1331
- writer.raw(message[index_1.unknownFieldsSymbol]);
1332
- }
1333
- return writer;
1334
- },
1335
- decode(input, length) {
1336
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1337
- const end = length === undefined ? reader.len : reader.pos + length;
1338
- const message = createBaseEndpointTemplateSpec();
1339
- let writer = undefined;
1340
- while (reader.pos < end) {
1341
- const tag = reader.uint32();
1342
- switch (tag >>> 3) {
1343
- case 1: {
1344
- if (tag !== 10)
1345
- break;
1346
- message.resources = resource_1.ResourcesSpec.decode(reader, reader.uint32());
1347
- continue;
1348
- }
1349
- default:
1350
- break;
1351
- }
1352
- if ((tag & 7) === 4 || tag === 0) {
1353
- break;
1354
- }
1355
- {
1356
- if (!writer)
1357
- writer = new index_1.BinaryWriter();
1358
- const skipped = reader.skip(tag & 7, tag >>> 3);
1359
- writer.uint32(tag).raw(skipped);
1360
- }
1361
- }
1362
- if (writer) {
1363
- message[index_1.unknownFieldsSymbol] = writer.finish();
1364
- }
1365
- return message;
1366
- },
1367
- fromJSON(object) {
1368
- return applyEndpointTemplateSpecCustom({
1369
- $type: "nebius.msp.serverless.v1alpha1.EndpointTemplateSpec",
1370
- resources: (0, index_1.isSet)(object.resources ?? object.resources)
1371
- ? resource_1.ResourcesSpec.fromJSON(object.resources ?? object.resources)
1372
- : undefined,
1373
- });
1374
- },
1375
- toJSON(message, use = "json") {
1376
- const obj = {};
1377
- const pick = (json, pb) => (use === "json" ? json : pb);
1378
- if (message.resources !== undefined) {
1379
- obj[pick("resources", "resources")] = message.resources
1380
- ? resource_1.ResourcesSpec.toJSON(message.resources, use)
1381
- : undefined;
1382
- }
1383
- return obj;
1384
- },
1385
- create(base) {
1386
- return exports.EndpointTemplateSpec.fromPartial(base ?? {});
1387
- },
1388
- fromPartial(object) {
1389
- const message = createBaseEndpointTemplateSpec();
1390
- message.resources = (object.resources !== undefined && object.resources !== null)
1391
- ? resource_1.ResourcesSpec.fromPartial(object.resources)
1392
- : undefined;
1393
- return message;
1394
- },
1395
- };
1396
- protobuf_1.protoRegistry.registerMessage(exports.EndpointTemplateSpec);
1397
- function EndpointTemplateSpecCustomInspect() {
1398
- const parts = [];
1399
- if (this.resources !== undefined)
1400
- parts.push("resources" + "=" + (0, util_1.inspect)(this.resources));
1401
- return `${this.$type}(${parts.join(", ")})`;
1402
- }
1403
- function EndpointTemplateSpecCustomJson() {
1404
- const obj = {
1405
- type: this.$type,
1406
- };
1407
- if (this.resources !== undefined)
1408
- obj.resources = (0, logging_1.inspectJson)(this.resources);
1409
- return obj;
1410
- }
1411
- function applyEndpointTemplateSpecCustom(message) {
1412
- message[logging_1.custom] = EndpointTemplateSpecCustomInspect;
1413
- message[logging_1.customJson] = EndpointTemplateSpecCustomJson;
1414
- return message;
1415
- }
1416
- function createBaseEndpointTemplateSpec() {
1417
- const message = {
1418
- $type: "nebius.msp.serverless.v1alpha1.EndpointTemplateSpec",
1419
- resources: undefined,
1420
- };
1421
- return applyEndpointTemplateSpecCustom(message);
1422
- }
1423
- exports.EndpointStatus = {
1424
- $type: "nebius.msp.serverless.v1alpha1.EndpointStatus",
1425
- encode(message, writer = new index_1.BinaryWriter()) {
1426
- if ((message.phase ?? v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) {
1427
- v1alpha1_1.ClusterStatus_Phase.encodeField(writer, 1, message.phase);
1428
- }
1429
- if ((message.state ?? v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) {
1430
- v1alpha1_1.ClusterStatus_State.encodeField(writer, 2, message.state);
1431
- }
1432
- if (message.publicEndpoint !== "") {
1433
- writer.uint32(26).string(message.publicEndpoint);
1434
- }
1435
- if (message[index_1.unknownFieldsSymbol]) {
1436
- writer.raw(message[index_1.unknownFieldsSymbol]);
1437
- }
1438
- return writer;
1439
- },
1440
- decode(input, length) {
1441
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1442
- const end = length === undefined ? reader.len : reader.pos + length;
1443
- const message = createBaseEndpointStatus();
1444
- let writer = undefined;
1445
- while (reader.pos < end) {
1446
- const tag = reader.uint32();
1447
- switch (tag >>> 3) {
1448
- case 1: {
1449
- if (tag !== 8)
1450
- break;
1451
- message.phase = v1alpha1_1.ClusterStatus_Phase.fromNumber(reader.int32());
1452
- continue;
1453
- }
1454
- case 2: {
1455
- if (tag !== 16)
1456
- break;
1457
- message.state = v1alpha1_1.ClusterStatus_State.fromNumber(reader.int32());
1458
- continue;
1459
- }
1460
- case 3: {
1461
- if (tag !== 26)
1462
- break;
1463
- message.publicEndpoint = reader.string();
1464
- continue;
1465
- }
1466
- default:
1467
- break;
1468
- }
1469
- if ((tag & 7) === 4 || tag === 0) {
1470
- break;
1471
- }
1472
- {
1473
- if (!writer)
1474
- writer = new index_1.BinaryWriter();
1475
- const skipped = reader.skip(tag & 7, tag >>> 3);
1476
- writer.uint32(tag).raw(skipped);
1477
- }
1478
- }
1479
- if (writer) {
1480
- message[index_1.unknownFieldsSymbol] = writer.finish();
1481
- }
1482
- return message;
1483
- },
1484
- fromJSON(object) {
1485
- return applyEndpointStatusCustom({
1486
- $type: "nebius.msp.serverless.v1alpha1.EndpointStatus",
1487
- phase: (0, index_1.isSet)(object.phase ?? object.phase)
1488
- ? v1alpha1_1.ClusterStatus_Phase.fromJSON(object.phase ?? object.phase)
1489
- : v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED,
1490
- state: (0, index_1.isSet)(object.state ?? object.state)
1491
- ? v1alpha1_1.ClusterStatus_State.fromJSON(object.state ?? object.state)
1492
- : v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED,
1493
- publicEndpoint: (0, index_1.isSet)(object.publicEndpoint ?? object.public_endpoint)
1494
- ? String(object.publicEndpoint ?? object.public_endpoint)
1495
- : "",
1496
- });
1497
- },
1498
- toJSON(message, use = "json") {
1499
- const obj = {};
1500
- const pick = (json, pb) => (use === "json" ? json : pb);
1501
- if ((message.phase ?? v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) {
1502
- obj[pick("phase", "phase")] = v1alpha1_1.ClusterStatus_Phase.toJSON(message.phase);
1503
- }
1504
- if ((message.state ?? v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) {
1505
- obj[pick("state", "state")] = v1alpha1_1.ClusterStatus_State.toJSON(message.state);
1506
- }
1507
- if (message.publicEndpoint !== "") {
1508
- obj[pick("publicEndpoint", "public_endpoint")] = message.publicEndpoint;
1509
- }
1510
- return obj;
1511
- },
1512
- create(base) {
1513
- return exports.EndpointStatus.fromPartial(base ?? {});
1514
- },
1515
- fromPartial(object) {
1516
- const message = createBaseEndpointStatus();
1517
- message.phase = (object.phase !== undefined && object.phase !== null)
1518
- ? v1alpha1_1.ClusterStatus_Phase.fromJSON(object.phase.name)
1519
- : v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED;
1520
- message.state = (object.state !== undefined && object.state !== null)
1521
- ? v1alpha1_1.ClusterStatus_State.fromJSON(object.state.name)
1522
- : v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED;
1523
- message.publicEndpoint = (object.publicEndpoint !== undefined && object.publicEndpoint !== null)
1524
- ? object.publicEndpoint
1525
- : "";
1526
- return message;
1527
- },
1528
- };
1529
- protobuf_1.protoRegistry.registerMessage(exports.EndpointStatus);
1530
- function EndpointStatusCustomInspect() {
1531
- const parts = [];
1532
- if (this.phase !== undefined)
1533
- parts.push("phase" + "=" + (0, util_1.inspect)(this.phase));
1534
- if (this.state !== undefined)
1535
- parts.push("state" + "=" + (0, util_1.inspect)(this.state));
1536
- if (this.publicEndpoint !== "")
1537
- parts.push("publicEndpoint" + "=" + (0, util_1.inspect)(this.publicEndpoint));
1538
- return `${this.$type}(${parts.join(", ")})`;
1539
- }
1540
- function EndpointStatusCustomJson() {
1541
- const obj = {
1542
- type: this.$type,
1543
- };
1544
- if (this.phase !== undefined)
1545
- obj.phase = (0, logging_1.inspectJson)(this.phase);
1546
- if (this.state !== undefined)
1547
- obj.state = (0, logging_1.inspectJson)(this.state);
1548
- if (this.publicEndpoint !== "")
1549
- obj.publicEndpoint = (0, logging_1.inspectJson)(this.publicEndpoint);
1550
- return obj;
1551
- }
1552
- function applyEndpointStatusCustom(message) {
1553
- message[logging_1.custom] = EndpointStatusCustomInspect;
1554
- message[logging_1.customJson] = EndpointStatusCustomJson;
1555
- return message;
1556
- }
1557
- function createBaseEndpointStatus() {
1558
- const message = {
1559
- $type: "nebius.msp.serverless.v1alpha1.EndpointStatus",
1560
- phase: v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED,
1561
- state: v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED,
1562
- publicEndpoint: "",
1563
- };
1564
- return applyEndpointStatusCustom(message);
1565
- }
1566
- exports.CreateJobRequest = {
1567
- $type: "nebius.msp.serverless.v1alpha1.CreateJobRequest",
1568
- encode(message, writer = new index_1.BinaryWriter()) {
1569
- if (message.metadata !== undefined) {
1570
- const w = writer.uint32(10).fork();
1571
- v1_1.ResourceMetadata.encode(message.metadata, w);
1572
- w.join();
1573
- }
1574
- if (message.spec !== undefined) {
1575
- const w = writer.uint32(18).fork();
1576
- exports.JobSpec.encode(message.spec, w);
1577
- w.join();
1578
- }
1579
- if (message.dryRun === true) {
1580
- writer.uint32(24).bool(message.dryRun);
1581
- }
1582
- if (message[index_1.unknownFieldsSymbol]) {
1583
- writer.raw(message[index_1.unknownFieldsSymbol]);
1584
- }
1585
- return writer;
1586
- },
1587
- decode(input, length) {
1588
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1589
- const end = length === undefined ? reader.len : reader.pos + length;
1590
- const message = createBaseCreateJobRequest();
1591
- let writer = undefined;
1592
- while (reader.pos < end) {
1593
- const tag = reader.uint32();
1594
- switch (tag >>> 3) {
1595
- case 1: {
1596
- if (tag !== 10)
1597
- break;
1598
- message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
1599
- continue;
1600
- }
1601
- case 2: {
1602
- if (tag !== 18)
1603
- break;
1604
- message.spec = exports.JobSpec.decode(reader, reader.uint32());
1605
- continue;
1606
- }
1607
- case 3: {
1608
- if (tag !== 24)
1609
- break;
1610
- message.dryRun = reader.bool();
1611
- continue;
1612
- }
1613
- default:
1614
- break;
1615
- }
1616
- if ((tag & 7) === 4 || tag === 0) {
1617
- break;
1618
- }
1619
- {
1620
- if (!writer)
1621
- writer = new index_1.BinaryWriter();
1622
- const skipped = reader.skip(tag & 7, tag >>> 3);
1623
- writer.uint32(tag).raw(skipped);
1624
- }
1625
- }
1626
- if (writer) {
1627
- message[index_1.unknownFieldsSymbol] = writer.finish();
1628
- }
1629
- return message;
1630
- },
1631
- fromJSON(object) {
1632
- return applyCreateJobRequestCustom({
1633
- $type: "nebius.msp.serverless.v1alpha1.CreateJobRequest",
1634
- metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
1635
- ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
1636
- : undefined,
1637
- spec: (0, index_1.isSet)(object.spec ?? object.spec)
1638
- ? exports.JobSpec.fromJSON(object.spec ?? object.spec)
1639
- : undefined,
1640
- dryRun: (0, index_1.isSet)(object.dryRun ?? object.dry_run)
1641
- ? Boolean(object.dryRun ?? object.dry_run)
1642
- : false,
1643
- });
1644
- },
1645
- toJSON(message, use = "json") {
1646
- const obj = {};
1647
- const pick = (json, pb) => (use === "json" ? json : pb);
1648
- if (message.metadata !== undefined) {
1649
- obj[pick("metadata", "metadata")] = message.metadata
1650
- ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
1651
- : undefined;
1652
- }
1653
- if (message.spec !== undefined) {
1654
- obj[pick("spec", "spec")] = message.spec
1655
- ? exports.JobSpec.toJSON(message.spec, use)
1656
- : undefined;
1657
- }
1658
- if (message.dryRun === true) {
1659
- obj[pick("dryRun", "dry_run")] = message.dryRun;
1660
- }
1661
- return obj;
1662
- },
1663
- create(base) {
1664
- return exports.CreateJobRequest.fromPartial(base ?? {});
1665
- },
1666
- fromPartial(object) {
1667
- const message = createBaseCreateJobRequest();
1668
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
1669
- ? v1_1.ResourceMetadata.fromPartial(object.metadata)
1670
- : undefined;
1671
- message.spec = (object.spec !== undefined && object.spec !== null)
1672
- ? exports.JobSpec.fromPartial(object.spec)
1673
- : undefined;
1674
- message.dryRun = (object.dryRun !== undefined && object.dryRun !== null)
1675
- ? object.dryRun
1676
- : false;
1677
- return message;
1678
- },
1679
- };
1680
- protobuf_1.protoRegistry.registerMessage(exports.CreateJobRequest);
1681
- function CreateJobRequestCustomInspect() {
1682
- const parts = [];
1683
- if (this.metadata !== undefined)
1684
- parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
1685
- if (this.spec !== undefined)
1686
- parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
1687
- if (this.dryRun === true)
1688
- parts.push("dryRun" + "=" + (0, util_1.inspect)(this.dryRun));
1689
- return `${this.$type}(${parts.join(", ")})`;
1690
- }
1691
- function CreateJobRequestCustomJson() {
1692
- const obj = {
1693
- type: this.$type,
1694
- };
1695
- if (this.metadata !== undefined)
1696
- obj.metadata = (0, logging_1.inspectJson)(this.metadata);
1697
- if (this.spec !== undefined)
1698
- obj.spec = (0, logging_1.inspectJson)(this.spec);
1699
- if (this.dryRun === true)
1700
- obj.dryRun = (0, logging_1.inspectJson)(this.dryRun);
1701
- return obj;
1702
- }
1703
- function applyCreateJobRequestCustom(message) {
1704
- message[logging_1.custom] = CreateJobRequestCustomInspect;
1705
- message[logging_1.customJson] = CreateJobRequestCustomJson;
1706
- return message;
1707
- }
1708
- function createBaseCreateJobRequest() {
1709
- const message = {
1710
- $type: "nebius.msp.serverless.v1alpha1.CreateJobRequest",
1711
- metadata: undefined,
1712
- spec: undefined,
1713
- dryRun: false,
1714
- };
1715
- return applyCreateJobRequestCustom(message);
1716
- }
1717
- exports.CancelJobRequest = {
1718
- $type: "nebius.msp.serverless.v1alpha1.CancelJobRequest",
1719
- encode(message, writer = new index_1.BinaryWriter()) {
1720
- if (message.id !== "") {
1721
- writer.uint32(10).string(message.id);
1722
- }
1723
- if (message[index_1.unknownFieldsSymbol]) {
1724
- writer.raw(message[index_1.unknownFieldsSymbol]);
1725
- }
1726
- return writer;
1727
- },
1728
- decode(input, length) {
1729
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1730
- const end = length === undefined ? reader.len : reader.pos + length;
1731
- const message = createBaseCancelJobRequest();
1732
- let writer = undefined;
1733
- while (reader.pos < end) {
1734
- const tag = reader.uint32();
1735
- switch (tag >>> 3) {
1736
- case 1: {
1737
- if (tag !== 10)
1738
- break;
1739
- message.id = reader.string();
1740
- continue;
1741
- }
1742
- default:
1743
- break;
1744
- }
1745
- if ((tag & 7) === 4 || tag === 0) {
1746
- break;
1747
- }
1748
- {
1749
- if (!writer)
1750
- writer = new index_1.BinaryWriter();
1751
- const skipped = reader.skip(tag & 7, tag >>> 3);
1752
- writer.uint32(tag).raw(skipped);
1753
- }
1754
- }
1755
- if (writer) {
1756
- message[index_1.unknownFieldsSymbol] = writer.finish();
1757
- }
1758
- return message;
1759
- },
1760
- fromJSON(object) {
1761
- return applyCancelJobRequestCustom({
1762
- $type: "nebius.msp.serverless.v1alpha1.CancelJobRequest",
1763
- id: (0, index_1.isSet)(object.id ?? object.id)
1764
- ? String(object.id ?? object.id)
1765
- : "",
1766
- });
1767
- },
1768
- toJSON(message, use = "json") {
1769
- const obj = {};
1770
- const pick = (json, pb) => (use === "json" ? json : pb);
1771
- if (message.id !== "") {
1772
- obj[pick("id", "id")] = message.id;
1773
- }
1774
- return obj;
1775
- },
1776
- create(base) {
1777
- return exports.CancelJobRequest.fromPartial(base ?? {});
1778
- },
1779
- fromPartial(object) {
1780
- const message = createBaseCancelJobRequest();
1781
- message.id = (object.id !== undefined && object.id !== null)
1782
- ? object.id
1783
- : "";
1784
- return message;
1785
- },
1786
- };
1787
- protobuf_1.protoRegistry.registerMessage(exports.CancelJobRequest);
1788
- function CancelJobRequestCustomInspect() {
1789
- const parts = [];
1790
- if (this.id !== "")
1791
- parts.push("id" + "=" + (0, util_1.inspect)(this.id));
1792
- return `${this.$type}(${parts.join(", ")})`;
1793
- }
1794
- function CancelJobRequestCustomJson() {
1795
- const obj = {
1796
- type: this.$type,
1797
- };
1798
- if (this.id !== "")
1799
- obj.id = (0, logging_1.inspectJson)(this.id);
1800
- return obj;
1801
- }
1802
- function applyCancelJobRequestCustom(message) {
1803
- message[logging_1.custom] = CancelJobRequestCustomInspect;
1804
- message[logging_1.customJson] = CancelJobRequestCustomJson;
1805
- return message;
1806
- }
1807
- function createBaseCancelJobRequest() {
1808
- const message = {
1809
- $type: "nebius.msp.serverless.v1alpha1.CancelJobRequest",
1810
- id: "",
1811
- };
1812
- return applyCancelJobRequestCustom(message);
1813
- }
1814
- exports.ListJobsResponse = {
1815
- $type: "nebius.msp.serverless.v1alpha1.ListJobsResponse",
1816
- encode(message, writer = new index_1.BinaryWriter()) {
1817
- for (const v of (message.items ?? [])) {
1818
- const w = writer.uint32(10).fork();
1819
- exports.Job.encode(v, w);
1820
- w.join();
1821
- }
1822
- if (message.nextPageToken !== "") {
1823
- writer.uint32(18).string(message.nextPageToken);
1824
- }
1825
- if (message[index_1.unknownFieldsSymbol]) {
1826
- writer.raw(message[index_1.unknownFieldsSymbol]);
1827
- }
1828
- return writer;
1829
- },
1830
- decode(input, length) {
1831
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1832
- const end = length === undefined ? reader.len : reader.pos + length;
1833
- const message = createBaseListJobsResponse();
1834
- let writer = undefined;
1835
- while (reader.pos < end) {
1836
- const tag = reader.uint32();
1837
- switch (tag >>> 3) {
1838
- case 1: {
1839
- if (tag !== 10)
1840
- break;
1841
- message.items.push(exports.Job.decode(reader, reader.uint32()));
1842
- continue;
1843
- }
1844
- case 2: {
1845
- if (tag !== 18)
1846
- break;
1847
- message.nextPageToken = reader.string();
1848
- continue;
1849
- }
1850
- default:
1851
- break;
1852
- }
1853
- if ((tag & 7) === 4 || tag === 0) {
1854
- break;
1855
- }
1856
- {
1857
- if (!writer)
1858
- writer = new index_1.BinaryWriter();
1859
- const skipped = reader.skip(tag & 7, tag >>> 3);
1860
- writer.uint32(tag).raw(skipped);
1861
- }
1862
- }
1863
- if (writer) {
1864
- message[index_1.unknownFieldsSymbol] = writer.finish();
1865
- }
1866
- return message;
1867
- },
1868
- fromJSON(object) {
1869
- return applyListJobsResponseCustom({
1870
- $type: "nebius.msp.serverless.v1alpha1.ListJobsResponse",
1871
- items: globalThis.Array.isArray(object?.items ?? object?.items)
1872
- ? (object.items ?? object.items).map((e) => exports.Job.fromJSON(e))
1873
- : [],
1874
- nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
1875
- ? String(object.nextPageToken ?? object.next_page_token)
1876
- : "",
1877
- });
1878
- },
1879
- toJSON(message, use = "json") {
1880
- const obj = {};
1881
- const pick = (json, pb) => (use === "json" ? json : pb);
1882
- if (message.items?.length) {
1883
- obj[pick("items", "items")] = message.items.map((e) => e ? exports.Job.toJSON(e, use) : undefined);
1884
- }
1885
- if (message.nextPageToken !== "") {
1886
- obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
1887
- }
1888
- return obj;
1889
- },
1890
- create(base) {
1891
- return exports.ListJobsResponse.fromPartial(base ?? {});
1892
- },
1893
- fromPartial(object) {
1894
- const message = createBaseListJobsResponse();
1895
- message.items = object.items?.map((e) => exports.Job.fromPartial(e)) || [];
1896
- message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
1897
- ? object.nextPageToken
1898
- : "";
1899
- return message;
1900
- },
1901
- };
1902
- protobuf_1.protoRegistry.registerMessage(exports.ListJobsResponse);
1903
- function ListJobsResponseCustomInspect() {
1904
- const parts = [];
1905
- if ((this.items?.length ?? 0) !== 0)
1906
- parts.push("items" + "=" + (0, util_1.inspect)(this.items));
1907
- if (this.nextPageToken !== "")
1908
- parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
1909
- return `${this.$type}(${parts.join(", ")})`;
1910
- }
1911
- function ListJobsResponseCustomJson() {
1912
- const obj = {
1913
- type: this.$type,
1914
- };
1915
- if ((this.items?.length ?? 0) !== 0)
1916
- obj.items = (0, logging_1.inspectJson)(this.items);
1917
- if (this.nextPageToken !== "")
1918
- obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
1919
- return obj;
1920
- }
1921
- function applyListJobsResponseCustom(message) {
1922
- message[logging_1.custom] = ListJobsResponseCustomInspect;
1923
- message[logging_1.customJson] = ListJobsResponseCustomJson;
1924
- return message;
1925
- }
1926
- function createBaseListJobsResponse() {
1927
- const message = {
1928
- $type: "nebius.msp.serverless.v1alpha1.ListJobsResponse",
1929
- items: [],
1930
- nextPageToken: "",
1931
- };
1932
- return applyListJobsResponseCustom(message);
1933
- }
1934
- exports.JobServiceServiceDescription = {
1935
- get: {
1936
- path: "/nebius.msp.serverless.v1alpha1.JobService/Get",
1937
- requestStream: false,
1938
- responseStream: false,
1939
- requestSerialize: (value) => Buffer.from(v1alpha1_1.GetRequest.encode(value).finish()),
1940
- sendResetMask: false,
1941
- requestDeserialize: (value) => v1alpha1_1.GetRequest.decode(value),
1942
- responseSerialize: (value) => Buffer.from(exports.Job.encode(value).finish()),
1943
- responseDeserialize: (value) => exports.Job.decode(value),
1944
- },
1945
- list: {
1946
- path: "/nebius.msp.serverless.v1alpha1.JobService/List",
1947
- requestStream: false,
1948
- responseStream: false,
1949
- requestSerialize: (value) => Buffer.from(v1alpha1_1.ListRequest.encode(value).finish()),
1950
- sendResetMask: false,
1951
- requestDeserialize: (value) => v1alpha1_1.ListRequest.decode(value),
1952
- responseSerialize: (value) => Buffer.from(exports.ListJobsResponse.encode(value).finish()),
1953
- responseDeserialize: (value) => exports.ListJobsResponse.decode(value),
1954
- },
1955
- create: {
1956
- path: "/nebius.msp.serverless.v1alpha1.JobService/Create",
1957
- requestStream: false,
1958
- responseStream: false,
1959
- requestSerialize: (value) => Buffer.from(exports.CreateJobRequest.encode(value).finish()),
1960
- sendResetMask: false,
1961
- requestDeserialize: (value) => exports.CreateJobRequest.decode(value),
1962
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
1963
- responseDeserialize: (value) => v1_1.Operation.decode(value),
1964
- },
1965
- delete: {
1966
- path: "/nebius.msp.serverless.v1alpha1.JobService/Delete",
1967
- requestStream: false,
1968
- responseStream: false,
1969
- requestSerialize: (value) => Buffer.from(v1alpha1_1.DeleteRequest.encode(value).finish()),
1970
- sendResetMask: false,
1971
- requestDeserialize: (value) => v1alpha1_1.DeleteRequest.decode(value),
1972
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
1973
- responseDeserialize: (value) => v1_1.Operation.decode(value),
1974
- },
1975
- cancel: {
1976
- path: "/nebius.msp.serverless.v1alpha1.JobService/Cancel",
1977
- requestStream: false,
1978
- responseStream: false,
1979
- requestSerialize: (value) => Buffer.from(exports.CancelJobRequest.encode(value).finish()),
1980
- sendResetMask: false,
1981
- requestDeserialize: (value) => exports.CancelJobRequest.decode(value),
1982
- responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
1983
- responseDeserialize: (value) => v1_1.Operation.decode(value),
1984
- },
1985
- };
1986
- exports.JobServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.JobServiceServiceDescription, "nebius.msp.serverless.v1alpha1.JobService");
1987
- class JobService {
1988
- sdk;
1989
- $type = "nebius.msp.serverless.v1alpha1.JobService";
1990
- addr;
1991
- spec;
1992
- apiServiceName = "apps.msp";
1993
- constructor(sdk) {
1994
- this.sdk = sdk;
1995
- const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
1996
- this.addr = addr;
1997
- this.spec = exports.JobServiceServiceDescription;
1998
- }
1999
- getOperationService() {
2000
- return new v1_1.OperationService(this.sdk, this.addr);
2001
- }
2002
- get(...args) {
2003
- const spec = this.spec.get;
2004
- const request = args[0];
2005
- const metadata = (args.length > 1 ? args[1] : undefined);
2006
- const options = (args.length > 2 ? args[2] : undefined);
2007
- const deserialize = spec.responseDeserialize;
2008
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2009
- }
2010
- list(...args) {
2011
- const spec = this.spec.list;
2012
- const request = args[0];
2013
- const metadata = (args.length > 1 ? args[1] : undefined);
2014
- const options = (args.length > 2 ? args[2] : undefined);
2015
- const deserialize = spec.responseDeserialize;
2016
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2017
- }
2018
- create(...args) {
2019
- const spec = this.spec.create;
2020
- const request = args[0];
2021
- const metadata = (args.length > 1 ? args[1] : undefined);
2022
- const options = (args.length > 2 ? args[2] : undefined);
2023
- const deserialize = (value) => {
2024
- const resp = spec.responseDeserialize(value);
2025
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2026
- };
2027
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2028
- }
2029
- delete(...args) {
2030
- const spec = this.spec.delete;
2031
- const request = args[0];
2032
- const metadata = (args.length > 1 ? args[1] : undefined);
2033
- const options = (args.length > 2 ? args[2] : undefined);
2034
- const deserialize = (value) => {
2035
- const resp = spec.responseDeserialize(value);
2036
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2037
- };
2038
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2039
- }
2040
- cancel(...args) {
2041
- const spec = this.spec.cancel;
2042
- const request = args[0];
2043
- const metadata = (args.length > 1 ? args[1] : undefined);
2044
- const options = (args.length > 2 ? args[2] : undefined);
2045
- const deserialize = (value) => {
2046
- const resp = spec.responseDeserialize(value);
2047
- return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2048
- };
2049
- return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2050
- }
2051
- }
2052
- exports.JobService = JobService;
2053
- const JobResult_VALUE_COMMENTS = {
2054
- JOB_RESULT_UNSPECIFIED: " Job is not finished yet.\n",
2055
- JOB_RESULT_SUCCESS: " Job finished successfully.\n",
2056
- JOB_RESULT_FAILURE: " Job failed.\n",
2057
- JOB_RESULT_CANCELLED: " Job was cancelled.\n",
2058
- };
2059
- exports.JobResult = (0, index_1.createEnum)("nebius.msp.serverless.v1alpha1.JobResult", {
2060
- /**
2061
- * Job is not finished yet.
2062
- *
2063
- */
2064
- JOB_RESULT_UNSPECIFIED: 0,
2065
- /**
2066
- * Job finished successfully.
2067
- *
2068
- */
2069
- JOB_RESULT_SUCCESS: 1,
2070
- /**
2071
- * Job failed.
2072
- *
2073
- */
2074
- JOB_RESULT_FAILURE: 2,
2075
- /**
2076
- * Job was cancelled.
2077
- *
2078
- */
2079
- JOB_RESULT_CANCELLED: 3,
2080
- }, JobResult_VALUE_COMMENTS);
2081
- protobuf_1.protoRegistry.registerEnum(exports.JobResult);
2082
- exports.Job = {
2083
- $type: "nebius.msp.serverless.v1alpha1.Job",
2084
- encode(message, writer = new index_1.BinaryWriter()) {
2085
- if (message.metadata !== undefined) {
2086
- const w = writer.uint32(10).fork();
2087
- v1_1.ResourceMetadata.encode(message.metadata, w);
2088
- w.join();
2089
- }
2090
- if (message.spec !== undefined) {
2091
- const w = writer.uint32(18).fork();
2092
- exports.JobSpec.encode(message.spec, w);
2093
- w.join();
2094
- }
2095
- if (message.status !== undefined) {
2096
- const w = writer.uint32(26).fork();
2097
- exports.JobStatus.encode(message.status, w);
2098
- w.join();
2099
- }
2100
- if (message[index_1.unknownFieldsSymbol]) {
2101
- writer.raw(message[index_1.unknownFieldsSymbol]);
2102
- }
2103
- return writer;
2104
- },
2105
- decode(input, length) {
2106
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2107
- const end = length === undefined ? reader.len : reader.pos + length;
2108
- const message = createBaseJob();
2109
- let writer = undefined;
2110
- while (reader.pos < end) {
2111
- const tag = reader.uint32();
2112
- switch (tag >>> 3) {
2113
- case 1: {
2114
- if (tag !== 10)
2115
- break;
2116
- message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
2117
- continue;
2118
- }
2119
- case 2: {
2120
- if (tag !== 18)
2121
- break;
2122
- message.spec = exports.JobSpec.decode(reader, reader.uint32());
2123
- continue;
2124
- }
2125
- case 3: {
2126
- if (tag !== 26)
2127
- break;
2128
- message.status = exports.JobStatus.decode(reader, reader.uint32());
2129
- continue;
2130
- }
2131
- default:
2132
- break;
2133
- }
2134
- if ((tag & 7) === 4 || tag === 0) {
2135
- break;
2136
- }
2137
- {
2138
- if (!writer)
2139
- writer = new index_1.BinaryWriter();
2140
- const skipped = reader.skip(tag & 7, tag >>> 3);
2141
- writer.uint32(tag).raw(skipped);
2142
- }
2143
- }
2144
- if (writer) {
2145
- message[index_1.unknownFieldsSymbol] = writer.finish();
2146
- }
2147
- return message;
2148
- },
2149
- fromJSON(object) {
2150
- return applyJobCustom({
2151
- $type: "nebius.msp.serverless.v1alpha1.Job",
2152
- metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
2153
- ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
2154
- : undefined,
2155
- spec: (0, index_1.isSet)(object.spec ?? object.spec)
2156
- ? exports.JobSpec.fromJSON(object.spec ?? object.spec)
2157
- : undefined,
2158
- status: (0, index_1.isSet)(object.status ?? object.status)
2159
- ? exports.JobStatus.fromJSON(object.status ?? object.status)
2160
- : undefined,
2161
- });
2162
- },
2163
- toJSON(message, use = "json") {
2164
- const obj = {};
2165
- const pick = (json, pb) => (use === "json" ? json : pb);
2166
- if (message.metadata !== undefined) {
2167
- obj[pick("metadata", "metadata")] = message.metadata
2168
- ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
2169
- : undefined;
2170
- }
2171
- if (message.spec !== undefined) {
2172
- obj[pick("spec", "spec")] = message.spec
2173
- ? exports.JobSpec.toJSON(message.spec, use)
2174
- : undefined;
2175
- }
2176
- if (message.status !== undefined) {
2177
- obj[pick("status", "status")] = message.status
2178
- ? exports.JobStatus.toJSON(message.status, use)
2179
- : undefined;
2180
- }
2181
- return obj;
2182
- },
2183
- create(base) {
2184
- return exports.Job.fromPartial(base ?? {});
2185
- },
2186
- fromPartial(object) {
2187
- const message = createBaseJob();
2188
- message.metadata = (object.metadata !== undefined && object.metadata !== null)
2189
- ? v1_1.ResourceMetadata.fromPartial(object.metadata)
2190
- : undefined;
2191
- message.spec = (object.spec !== undefined && object.spec !== null)
2192
- ? exports.JobSpec.fromPartial(object.spec)
2193
- : undefined;
2194
- message.status = (object.status !== undefined && object.status !== null)
2195
- ? exports.JobStatus.fromPartial(object.status)
2196
- : undefined;
2197
- return message;
2198
- },
2199
- };
2200
- protobuf_1.protoRegistry.registerMessage(exports.Job);
2201
- function JobCustomInspect() {
2202
- const parts = [];
2203
- if (this.metadata !== undefined)
2204
- parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
2205
- if (this.spec !== undefined)
2206
- parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
2207
- if (this.status !== undefined)
2208
- parts.push("status" + "=" + (0, util_1.inspect)(this.status));
2209
- return `${this.$type}(${parts.join(", ")})`;
2210
- }
2211
- function JobCustomJson() {
2212
- const obj = {
2213
- type: this.$type,
2214
- };
2215
- if (this.metadata !== undefined)
2216
- obj.metadata = (0, logging_1.inspectJson)(this.metadata);
2217
- if (this.spec !== undefined)
2218
- obj.spec = (0, logging_1.inspectJson)(this.spec);
2219
- if (this.status !== undefined)
2220
- obj.status = (0, logging_1.inspectJson)(this.status);
2221
- return obj;
2222
- }
2223
- function applyJobCustom(message) {
2224
- message[logging_1.custom] = JobCustomInspect;
2225
- message[logging_1.customJson] = JobCustomJson;
2226
- return message;
2227
- }
2228
- function createBaseJob() {
2229
- const message = {
2230
- $type: "nebius.msp.serverless.v1alpha1.Job",
2231
- metadata: undefined,
2232
- spec: undefined,
2233
- status: undefined,
2234
- };
2235
- return applyJobCustom(message);
2236
- }
2237
- exports.JobSpec = {
2238
- $type: "nebius.msp.serverless.v1alpha1.JobSpec",
2239
- encode(message, writer = new index_1.BinaryWriter()) {
2240
- if (message.description !== "") {
2241
- writer.uint32(10).string(message.description);
2242
- }
2243
- if (message.networkId !== "") {
2244
- writer.uint32(18).string(message.networkId);
2245
- }
2246
- if (message.container !== undefined) {
2247
- const w = writer.uint32(810).fork();
2248
- exports.JobContainerSpec.encode(message.container, w);
2249
- w.join();
2250
- }
2251
- if (message[index_1.unknownFieldsSymbol]) {
2252
- writer.raw(message[index_1.unknownFieldsSymbol]);
2253
- }
2254
- return writer;
2255
- },
2256
- decode(input, length) {
2257
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2258
- const end = length === undefined ? reader.len : reader.pos + length;
2259
- const message = createBaseJobSpec();
2260
- let writer = undefined;
2261
- while (reader.pos < end) {
2262
- const tag = reader.uint32();
2263
- switch (tag >>> 3) {
2264
- case 1: {
2265
- if (tag !== 10)
2266
- break;
2267
- message.description = reader.string();
2268
- continue;
2269
- }
2270
- case 2: {
2271
- if (tag !== 18)
2272
- break;
2273
- message.networkId = reader.string();
2274
- continue;
2275
- }
2276
- case 101: {
2277
- if (tag !== 810)
2278
- break;
2279
- message.container = exports.JobContainerSpec.decode(reader, reader.uint32());
2280
- continue;
2281
- }
2282
- default:
2283
- break;
2284
- }
2285
- if ((tag & 7) === 4 || tag === 0) {
2286
- break;
2287
- }
2288
- {
2289
- if (!writer)
2290
- writer = new index_1.BinaryWriter();
2291
- const skipped = reader.skip(tag & 7, tag >>> 3);
2292
- writer.uint32(tag).raw(skipped);
2293
- }
2294
- }
2295
- if (writer) {
2296
- message[index_1.unknownFieldsSymbol] = writer.finish();
2297
- }
2298
- return message;
2299
- },
2300
- fromJSON(object) {
2301
- return applyJobSpecCustom({
2302
- $type: "nebius.msp.serverless.v1alpha1.JobSpec",
2303
- description: (0, index_1.isSet)(object.description ?? object.description)
2304
- ? String(object.description ?? object.description)
2305
- : "",
2306
- networkId: (0, index_1.isSet)(object.networkId ?? object.network_id)
2307
- ? String(object.networkId ?? object.network_id)
2308
- : "",
2309
- container: (0, index_1.isSet)(object.container ?? object.container)
2310
- ? exports.JobContainerSpec.fromJSON(object.container ?? object.container)
2311
- : undefined,
2312
- });
2313
- },
2314
- toJSON(message, use = "json") {
2315
- const obj = {};
2316
- const pick = (json, pb) => (use === "json" ? json : pb);
2317
- if (message.description !== "") {
2318
- obj[pick("description", "description")] = message.description;
2319
- }
2320
- if (message.networkId !== "") {
2321
- obj[pick("networkId", "network_id")] = message.networkId;
2322
- }
2323
- if (message.container !== undefined) {
2324
- obj[pick("container", "container")] = message.container
2325
- ? exports.JobContainerSpec.toJSON(message.container, use)
2326
- : undefined;
2327
- }
2328
- return obj;
2329
- },
2330
- create(base) {
2331
- return exports.JobSpec.fromPartial(base ?? {});
2332
- },
2333
- fromPartial(object) {
2334
- const message = createBaseJobSpec();
2335
- message.description = (object.description !== undefined && object.description !== null)
2336
- ? object.description
2337
- : "";
2338
- message.networkId = (object.networkId !== undefined && object.networkId !== null)
2339
- ? object.networkId
2340
- : "";
2341
- message.container = (object.container !== undefined && object.container !== null)
2342
- ? exports.JobContainerSpec.fromPartial(object.container)
2343
- : undefined;
2344
- return message;
2345
- },
2346
- };
2347
- protobuf_1.protoRegistry.registerMessage(exports.JobSpec);
2348
- function JobSpecCustomInspect() {
2349
- const parts = [];
2350
- if (this.description !== "")
2351
- parts.push("description" + "=" + (0, util_1.inspect)(this.description));
2352
- if (this.networkId !== "")
2353
- parts.push("networkId" + "=" + (0, util_1.inspect)(this.networkId));
2354
- if (this.container !== undefined)
2355
- parts.push("container" + "=" + (0, util_1.inspect)(this.container));
2356
- return `${this.$type}(${parts.join(", ")})`;
2357
- }
2358
- function JobSpecCustomJson() {
2359
- const obj = {
2360
- type: this.$type,
2361
- };
2362
- if (this.description !== "")
2363
- obj.description = (0, logging_1.inspectJson)(this.description);
2364
- if (this.networkId !== "")
2365
- obj.networkId = (0, logging_1.inspectJson)(this.networkId);
2366
- if (this.container !== undefined)
2367
- obj.container = (0, logging_1.inspectJson)(this.container);
2368
- return obj;
2369
- }
2370
- function applyJobSpecCustom(message) {
2371
- message[logging_1.custom] = JobSpecCustomInspect;
2372
- message[logging_1.customJson] = JobSpecCustomJson;
2373
- return message;
2374
- }
2375
- function createBaseJobSpec() {
2376
- const message = {
2377
- $type: "nebius.msp.serverless.v1alpha1.JobSpec",
2378
- description: "",
2379
- networkId: "",
2380
- container: undefined,
2381
- };
2382
- return applyJobSpecCustom(message);
2383
- }
2384
- exports.JobContainerSpec = {
2385
- $type: "nebius.msp.serverless.v1alpha1.JobContainerSpec",
2386
- encode(message, writer = new index_1.BinaryWriter()) {
2387
- if (message.image !== "") {
2388
- writer.uint32(10).string(message.image);
2389
- }
2390
- if (message.replicaCount !== undefined && !message.replicaCount.isZero?.()) {
2391
- writer.uint32(16).int64(message.replicaCount.toString());
2392
- }
2393
- if (message.template !== undefined) {
2394
- const w = writer.uint32(26).fork();
2395
- exports.JobTemplateSpec.encode(message.template, w);
2396
- w.join();
2397
- }
2398
- if (message.command !== "") {
2399
- writer.uint32(810).string(message.command);
2400
- }
2401
- for (const v of (message.args ?? [])) {
2402
- writer.uint32(818).string(v);
2403
- }
2404
- for (const [k, v] of Object.entries(message.envs ?? {})) {
2405
- const w = writer.uint32(826).fork();
2406
- w.uint32(10).string(k);
2407
- w.uint32(18).string(v);
2408
- w.join();
2409
- }
2410
- for (const [k, v] of Object.entries(message.sensitiveEnvs ?? {})) {
2411
- const w = writer.uint32(834).fork();
2412
- w.uint32(10).string(k);
2413
- w.uint32(18).string(v);
2414
- w.join();
2415
- }
2416
- if (message.timeoutSeconds !== undefined && !message.timeoutSeconds.isZero?.()) {
2417
- writer.uint32(1608).int64(message.timeoutSeconds.toString());
2418
- }
2419
- if (message.maxRetries !== undefined && !message.maxRetries.isZero?.()) {
2420
- writer.uint32(1616).int64(message.maxRetries.toString());
2421
- }
2422
- if (message[index_1.unknownFieldsSymbol]) {
2423
- writer.raw(message[index_1.unknownFieldsSymbol]);
2424
- }
2425
- return writer;
2426
- },
2427
- decode(input, length) {
2428
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2429
- const end = length === undefined ? reader.len : reader.pos + length;
2430
- const message = createBaseJobContainerSpec();
2431
- let writer = undefined;
2432
- while (reader.pos < end) {
2433
- const tag = reader.uint32();
2434
- switch (tag >>> 3) {
2435
- case 1: {
2436
- if (tag !== 10)
2437
- break;
2438
- message.image = reader.string();
2439
- continue;
2440
- }
2441
- case 2: {
2442
- if (tag !== 16)
2443
- break;
2444
- message.replicaCount = index_1.Long.fromValue(reader.int64());
2445
- continue;
2446
- }
2447
- case 3: {
2448
- if (tag !== 26)
2449
- break;
2450
- message.template = exports.JobTemplateSpec.decode(reader, reader.uint32());
2451
- continue;
2452
- }
2453
- case 101: {
2454
- if (tag !== 810)
2455
- break;
2456
- message.command = reader.string();
2457
- continue;
2458
- }
2459
- case 102: {
2460
- if (tag !== 818)
2461
- break;
2462
- message.args.push(reader.string());
2463
- continue;
2464
- }
2465
- case 103: {
2466
- if (tag !== 826)
2467
- break; // wire type guard
2468
- const end2 = reader.uint32() + reader.pos;
2469
- let key = "";
2470
- let value = undefined;
2471
- while (reader.pos < end2) {
2472
- const tag2 = reader.uint32();
2473
- switch (tag2 >>> 3) {
2474
- case 1: {
2475
- key = reader.string();
2476
- continue;
2477
- }
2478
- case 2: {
2479
- value = reader.string();
2480
- continue;
2481
- }
2482
- }
2483
- if ((tag2 & 7) === 4 || tag2 === 0)
2484
- break;
2485
- reader.skip(tag2 & 7);
2486
- }
2487
- if (value !== undefined) {
2488
- const stringKey = String(key);
2489
- message.envs[stringKey] = value;
2490
- }
2491
- continue;
2492
- }
2493
- case 104: {
2494
- if (tag !== 834)
2495
- break; // wire type guard
2496
- const end2 = reader.uint32() + reader.pos;
2497
- let key = "";
2498
- let value = undefined;
2499
- while (reader.pos < end2) {
2500
- const tag2 = reader.uint32();
2501
- switch (tag2 >>> 3) {
2502
- case 1: {
2503
- key = reader.string();
2504
- continue;
2505
- }
2506
- case 2: {
2507
- value = reader.string();
2508
- continue;
2509
- }
2510
- }
2511
- if ((tag2 & 7) === 4 || tag2 === 0)
2512
- break;
2513
- reader.skip(tag2 & 7);
2514
- }
2515
- if (value !== undefined) {
2516
- const stringKey = String(key);
2517
- message.sensitiveEnvs[stringKey] = value;
2518
- }
2519
- continue;
2520
- }
2521
- case 201: {
2522
- if (tag !== 1608)
2523
- break;
2524
- message.timeoutSeconds = index_1.Long.fromValue(reader.int64());
2525
- continue;
2526
- }
2527
- case 202: {
2528
- if (tag !== 1616)
2529
- break;
2530
- message.maxRetries = index_1.Long.fromValue(reader.int64());
2531
- continue;
2532
- }
2533
- default:
2534
- break;
2535
- }
2536
- if ((tag & 7) === 4 || tag === 0) {
2537
- break;
2538
- }
2539
- {
2540
- if (!writer)
2541
- writer = new index_1.BinaryWriter();
2542
- const skipped = reader.skip(tag & 7, tag >>> 3);
2543
- writer.uint32(tag).raw(skipped);
2544
- }
2545
- }
2546
- if (writer) {
2547
- message[index_1.unknownFieldsSymbol] = writer.finish();
2548
- }
2549
- return message;
2550
- },
2551
- fromJSON(object) {
2552
- return applyJobContainerSpecCustom({
2553
- $type: "nebius.msp.serverless.v1alpha1.JobContainerSpec",
2554
- image: (0, index_1.isSet)(object.image ?? object.image)
2555
- ? String(object.image ?? object.image)
2556
- : "",
2557
- replicaCount: (0, index_1.isSet)(object.replicaCount ?? object.replica_count)
2558
- ? index_1.Long.fromValue(object.replicaCount ?? object.replica_count)
2559
- : index_1.Long.ZERO,
2560
- template: (0, index_1.isSet)(object.template ?? object.template)
2561
- ? exports.JobTemplateSpec.fromJSON(object.template ?? object.template)
2562
- : undefined,
2563
- command: (0, index_1.isSet)(object.command ?? object.command)
2564
- ? String(object.command ?? object.command)
2565
- : "",
2566
- args: globalThis.Array.isArray(object?.args ?? object?.args)
2567
- ? (object.args ?? object.args).map((e) => String(e))
2568
- : [],
2569
- envs: ((0, index_1.isSet)(object.envs) && typeof object.envs === "object" ? object.envs
2570
- : ((0, index_1.isSet)(object.envs) && typeof object.envs === "object" ? object.envs : undefined))
2571
- ? Object.entries((object.envs ?? object.envs)).reduce((acc, [key, value]) => {
2572
- acc[key] = String(value);
2573
- return acc;
2574
- }, {})
2575
- : {},
2576
- sensitiveEnvs: ((0, index_1.isSet)(object.sensitiveEnvs) && typeof object.sensitiveEnvs === "object" ? object.sensitiveEnvs
2577
- : ((0, index_1.isSet)(object.sensitive_envs) && typeof object.sensitive_envs === "object" ? object.sensitive_envs : undefined))
2578
- ? Object.entries((object.sensitiveEnvs ?? object.sensitive_envs)).reduce((acc, [key, value]) => {
2579
- acc[key] = String(value);
2580
- return acc;
2581
- }, {})
2582
- : {},
2583
- timeoutSeconds: (0, index_1.isSet)(object.timeoutSeconds ?? object.timeout_seconds)
2584
- ? index_1.Long.fromValue(object.timeoutSeconds ?? object.timeout_seconds)
2585
- : index_1.Long.ZERO,
2586
- maxRetries: (0, index_1.isSet)(object.maxRetries ?? object.max_retries)
2587
- ? index_1.Long.fromValue(object.maxRetries ?? object.max_retries)
2588
- : index_1.Long.ZERO,
2589
- });
2590
- },
2591
- toJSON(message, use = "json") {
2592
- const obj = {};
2593
- const pick = (json, pb) => (use === "json" ? json : pb);
2594
- if (message.image !== "") {
2595
- obj[pick("image", "image")] = message.image;
2596
- }
2597
- if (!message.replicaCount?.isZero?.()) {
2598
- obj[pick("replicaCount", "replica_count")] = (message.replicaCount || index_1.Long.ZERO).toString();
2599
- }
2600
- if (message.template !== undefined) {
2601
- obj[pick("template", "template")] = message.template
2602
- ? exports.JobTemplateSpec.toJSON(message.template, use)
2603
- : undefined;
2604
- }
2605
- if (message.command !== "") {
2606
- obj[pick("command", "command")] = message.command;
2607
- }
2608
- if (message.args?.length) {
2609
- obj[pick("args", "args")] = message.args.map((e) => e);
2610
- }
2611
- if (message.envs) {
2612
- const entries = Object.entries(message.envs);
2613
- if (entries.length > 0) {
2614
- obj[pick("envs", "envs")] = {};
2615
- entries.forEach(([k, v]) => {
2616
- obj[pick("envs", "envs")][k] = v;
2617
- });
2618
- }
2619
- }
2620
- if (message.sensitiveEnvs) {
2621
- const entries = Object.entries(message.sensitiveEnvs);
2622
- if (entries.length > 0) {
2623
- obj[pick("sensitiveEnvs", "sensitive_envs")] = {};
2624
- entries.forEach(([k, v]) => {
2625
- obj[pick("sensitiveEnvs", "sensitive_envs")][k] = v;
2626
- });
2627
- }
2628
- }
2629
- if (!message.timeoutSeconds?.isZero?.()) {
2630
- obj[pick("timeoutSeconds", "timeout_seconds")] = (message.timeoutSeconds || index_1.Long.ZERO).toString();
2631
- }
2632
- if (!message.maxRetries?.isZero?.()) {
2633
- obj[pick("maxRetries", "max_retries")] = (message.maxRetries || index_1.Long.ZERO).toString();
2634
- }
2635
- return obj;
2636
- },
2637
- create(base) {
2638
- return exports.JobContainerSpec.fromPartial(base ?? {});
2639
- },
2640
- fromPartial(object) {
2641
- const message = createBaseJobContainerSpec();
2642
- message.image = (object.image !== undefined && object.image !== null)
2643
- ? object.image
2644
- : "";
2645
- message.replicaCount = (object.replicaCount !== undefined && object.replicaCount !== null)
2646
- ? index_1.Long.fromValue(object.replicaCount)
2647
- : index_1.Long.ZERO;
2648
- message.template = (object.template !== undefined && object.template !== null)
2649
- ? exports.JobTemplateSpec.fromPartial(object.template)
2650
- : undefined;
2651
- message.command = (object.command !== undefined && object.command !== null)
2652
- ? object.command
2653
- : "";
2654
- message.args = object.args?.map((e) => e) || [];
2655
- message.envs = Object.entries(object.envs ?? {}).reduce((acc, [key, value]) => {
2656
- if (value !== undefined) {
2657
- acc[key] = value;
2658
- }
2659
- return acc;
2660
- }, {});
2661
- message.sensitiveEnvs = Object.entries(object.sensitiveEnvs ?? {}).reduce((acc, [key, value]) => {
2662
- if (value !== undefined) {
2663
- acc[key] = value;
2664
- }
2665
- return acc;
2666
- }, {});
2667
- message.timeoutSeconds = (object.timeoutSeconds !== undefined && object.timeoutSeconds !== null)
2668
- ? index_1.Long.fromValue(object.timeoutSeconds)
2669
- : index_1.Long.ZERO;
2670
- message.maxRetries = (object.maxRetries !== undefined && object.maxRetries !== null)
2671
- ? index_1.Long.fromValue(object.maxRetries)
2672
- : index_1.Long.ZERO;
2673
- return message;
2674
- },
2675
- };
2676
- protobuf_1.protoRegistry.registerMessage(exports.JobContainerSpec);
2677
- function JobContainerSpecCustomInspect() {
2678
- const parts = [];
2679
- if (this.image !== "")
2680
- parts.push("image" + "=" + (0, util_1.inspect)(this.image));
2681
- if (!this.replicaCount?.isZero?.())
2682
- parts.push("replicaCount" + "=" + (0, util_1.inspect)(this.replicaCount));
2683
- if (this.template !== undefined)
2684
- parts.push("template" + "=" + (0, util_1.inspect)(this.template));
2685
- if (this.command !== "")
2686
- parts.push("command" + "=" + (0, util_1.inspect)(this.command));
2687
- if ((this.args?.length ?? 0) !== 0)
2688
- parts.push("args" + "=" + (0, util_1.inspect)(this.args));
2689
- if (Object.keys(this.envs || {}).length)
2690
- parts.push("envs" + "=" + (0, util_1.inspect)(this.envs));
2691
- if (Object.keys(this.sensitiveEnvs || {}).length)
2692
- parts.push("sensitiveEnvs" + "=***");
2693
- if (!this.timeoutSeconds?.isZero?.())
2694
- parts.push("timeoutSeconds" + "=" + (0, util_1.inspect)(this.timeoutSeconds));
2695
- if (!this.maxRetries?.isZero?.())
2696
- parts.push("maxRetries" + "=" + (0, util_1.inspect)(this.maxRetries));
2697
- return `${this.$type}(${parts.join(", ")})`;
2698
- }
2699
- function JobContainerSpecCustomJson() {
2700
- const obj = {
2701
- type: this.$type,
2702
- };
2703
- if (this.image !== "")
2704
- obj.image = (0, logging_1.inspectJson)(this.image);
2705
- if (!this.replicaCount?.isZero?.())
2706
- obj.replicaCount = (0, logging_1.inspectJson)(this.replicaCount);
2707
- if (this.template !== undefined)
2708
- obj.template = (0, logging_1.inspectJson)(this.template);
2709
- if (this.command !== "")
2710
- obj.command = (0, logging_1.inspectJson)(this.command);
2711
- if ((this.args?.length ?? 0) !== 0)
2712
- obj.args = (0, logging_1.inspectJson)(this.args);
2713
- if (Object.keys(this.envs || {}).length)
2714
- obj.envs = (0, logging_1.inspectJson)(this.envs);
2715
- if (Object.keys(this.sensitiveEnvs || {}).length)
2716
- obj.sensitiveEnvs = "***";
2717
- if (!this.timeoutSeconds?.isZero?.())
2718
- obj.timeoutSeconds = (0, logging_1.inspectJson)(this.timeoutSeconds);
2719
- if (!this.maxRetries?.isZero?.())
2720
- obj.maxRetries = (0, logging_1.inspectJson)(this.maxRetries);
2721
- return obj;
2722
- }
2723
- function applyJobContainerSpecCustom(message) {
2724
- message[logging_1.custom] = JobContainerSpecCustomInspect;
2725
- message[logging_1.customJson] = JobContainerSpecCustomJson;
2726
- return message;
2727
- }
2728
- function createBaseJobContainerSpec() {
2729
- const message = {
2730
- $type: "nebius.msp.serverless.v1alpha1.JobContainerSpec",
2731
- image: "",
2732
- replicaCount: index_1.Long.ZERO,
2733
- template: undefined,
2734
- command: "",
2735
- args: [],
2736
- envs: {},
2737
- sensitiveEnvs: {},
2738
- timeoutSeconds: index_1.Long.ZERO,
2739
- maxRetries: index_1.Long.ZERO,
2740
- };
2741
- return applyJobContainerSpecCustom(message);
2742
- }
2743
- exports.JobTemplateSpec = {
2744
- $type: "nebius.msp.serverless.v1alpha1.JobTemplateSpec",
2745
- encode(message, writer = new index_1.BinaryWriter()) {
2746
- if (message.resources !== undefined) {
2747
- const w = writer.uint32(10).fork();
2748
- resource_1.ResourcesSpec.encode(message.resources, w);
2749
- w.join();
2750
- }
2751
- if (message[index_1.unknownFieldsSymbol]) {
2752
- writer.raw(message[index_1.unknownFieldsSymbol]);
2753
- }
2754
- return writer;
2755
- },
2756
- decode(input, length) {
2757
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2758
- const end = length === undefined ? reader.len : reader.pos + length;
2759
- const message = createBaseJobTemplateSpec();
2760
- let writer = undefined;
2761
- while (reader.pos < end) {
2762
- const tag = reader.uint32();
2763
- switch (tag >>> 3) {
2764
- case 1: {
2765
- if (tag !== 10)
2766
- break;
2767
- message.resources = resource_1.ResourcesSpec.decode(reader, reader.uint32());
2768
- continue;
2769
- }
2770
- default:
2771
- break;
2772
- }
2773
- if ((tag & 7) === 4 || tag === 0) {
2774
- break;
2775
- }
2776
- {
2777
- if (!writer)
2778
- writer = new index_1.BinaryWriter();
2779
- const skipped = reader.skip(tag & 7, tag >>> 3);
2780
- writer.uint32(tag).raw(skipped);
2781
- }
2782
- }
2783
- if (writer) {
2784
- message[index_1.unknownFieldsSymbol] = writer.finish();
2785
- }
2786
- return message;
2787
- },
2788
- fromJSON(object) {
2789
- return applyJobTemplateSpecCustom({
2790
- $type: "nebius.msp.serverless.v1alpha1.JobTemplateSpec",
2791
- resources: (0, index_1.isSet)(object.resources ?? object.resources)
2792
- ? resource_1.ResourcesSpec.fromJSON(object.resources ?? object.resources)
2793
- : undefined,
2794
- });
2795
- },
2796
- toJSON(message, use = "json") {
2797
- const obj = {};
2798
- const pick = (json, pb) => (use === "json" ? json : pb);
2799
- if (message.resources !== undefined) {
2800
- obj[pick("resources", "resources")] = message.resources
2801
- ? resource_1.ResourcesSpec.toJSON(message.resources, use)
2802
- : undefined;
2803
- }
2804
- return obj;
2805
- },
2806
- create(base) {
2807
- return exports.JobTemplateSpec.fromPartial(base ?? {});
2808
- },
2809
- fromPartial(object) {
2810
- const message = createBaseJobTemplateSpec();
2811
- message.resources = (object.resources !== undefined && object.resources !== null)
2812
- ? resource_1.ResourcesSpec.fromPartial(object.resources)
2813
- : undefined;
2814
- return message;
2815
- },
2816
- };
2817
- protobuf_1.protoRegistry.registerMessage(exports.JobTemplateSpec);
2818
- function JobTemplateSpecCustomInspect() {
2819
- const parts = [];
2820
- if (this.resources !== undefined)
2821
- parts.push("resources" + "=" + (0, util_1.inspect)(this.resources));
2822
- return `${this.$type}(${parts.join(", ")})`;
2823
- }
2824
- function JobTemplateSpecCustomJson() {
2825
- const obj = {
2826
- type: this.$type,
2827
- };
2828
- if (this.resources !== undefined)
2829
- obj.resources = (0, logging_1.inspectJson)(this.resources);
2830
- return obj;
2831
- }
2832
- function applyJobTemplateSpecCustom(message) {
2833
- message[logging_1.custom] = JobTemplateSpecCustomInspect;
2834
- message[logging_1.customJson] = JobTemplateSpecCustomJson;
2835
- return message;
2836
- }
2837
- function createBaseJobTemplateSpec() {
2838
- const message = {
2839
- $type: "nebius.msp.serverless.v1alpha1.JobTemplateSpec",
2840
- resources: undefined,
2841
- };
2842
- return applyJobTemplateSpecCustom(message);
2843
- }
2844
- exports.JobStatus = {
2845
- $type: "nebius.msp.serverless.v1alpha1.JobStatus",
2846
- encode(message, writer = new index_1.BinaryWriter()) {
2847
- if ((message.phase ?? v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) {
2848
- v1alpha1_1.ClusterStatus_Phase.encodeField(writer, 1, message.phase);
2849
- }
2850
- if ((message.state ?? v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) {
2851
- v1alpha1_1.ClusterStatus_State.encodeField(writer, 2, message.state);
2852
- }
2853
- if ((message.result ?? exports.JobResult.JOB_RESULT_UNSPECIFIED) !== exports.JobResult.JOB_RESULT_UNSPECIFIED) {
2854
- exports.JobResult.encodeField(writer, 3, message.result);
2855
- }
2856
- if (message[index_1.unknownFieldsSymbol]) {
2857
- writer.raw(message[index_1.unknownFieldsSymbol]);
2858
- }
2859
- return writer;
2860
- },
2861
- decode(input, length) {
2862
- const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2863
- const end = length === undefined ? reader.len : reader.pos + length;
2864
- const message = createBaseJobStatus();
2865
- let writer = undefined;
2866
- while (reader.pos < end) {
2867
- const tag = reader.uint32();
2868
- switch (tag >>> 3) {
2869
- case 1: {
2870
- if (tag !== 8)
2871
- break;
2872
- message.phase = v1alpha1_1.ClusterStatus_Phase.fromNumber(reader.int32());
2873
- continue;
2874
- }
2875
- case 2: {
2876
- if (tag !== 16)
2877
- break;
2878
- message.state = v1alpha1_1.ClusterStatus_State.fromNumber(reader.int32());
2879
- continue;
2880
- }
2881
- case 3: {
2882
- if (tag !== 24)
2883
- break;
2884
- message.result = exports.JobResult.fromNumber(reader.int32());
2885
- continue;
2886
- }
2887
- default:
2888
- break;
2889
- }
2890
- if ((tag & 7) === 4 || tag === 0) {
2891
- break;
2892
- }
2893
- {
2894
- if (!writer)
2895
- writer = new index_1.BinaryWriter();
2896
- const skipped = reader.skip(tag & 7, tag >>> 3);
2897
- writer.uint32(tag).raw(skipped);
2898
- }
2899
- }
2900
- if (writer) {
2901
- message[index_1.unknownFieldsSymbol] = writer.finish();
2902
- }
2903
- return message;
2904
- },
2905
- fromJSON(object) {
2906
- return applyJobStatusCustom({
2907
- $type: "nebius.msp.serverless.v1alpha1.JobStatus",
2908
- phase: (0, index_1.isSet)(object.phase ?? object.phase)
2909
- ? v1alpha1_1.ClusterStatus_Phase.fromJSON(object.phase ?? object.phase)
2910
- : v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED,
2911
- state: (0, index_1.isSet)(object.state ?? object.state)
2912
- ? v1alpha1_1.ClusterStatus_State.fromJSON(object.state ?? object.state)
2913
- : v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED,
2914
- result: (0, index_1.isSet)(object.result ?? object.result)
2915
- ? exports.JobResult.fromJSON(object.result ?? object.result)
2916
- : exports.JobResult.JOB_RESULT_UNSPECIFIED,
2917
- });
2918
- },
2919
- toJSON(message, use = "json") {
2920
- const obj = {};
2921
- const pick = (json, pb) => (use === "json" ? json : pb);
2922
- if ((message.phase ?? v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED) {
2923
- obj[pick("phase", "phase")] = v1alpha1_1.ClusterStatus_Phase.toJSON(message.phase);
2924
- }
2925
- if ((message.state ?? v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) !== v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED) {
2926
- obj[pick("state", "state")] = v1alpha1_1.ClusterStatus_State.toJSON(message.state);
2927
- }
2928
- if ((message.result ?? exports.JobResult.JOB_RESULT_UNSPECIFIED) !== exports.JobResult.JOB_RESULT_UNSPECIFIED) {
2929
- obj[pick("result", "result")] = exports.JobResult.toJSON(message.result);
2930
- }
2931
- return obj;
2932
- },
2933
- create(base) {
2934
- return exports.JobStatus.fromPartial(base ?? {});
2935
- },
2936
- fromPartial(object) {
2937
- const message = createBaseJobStatus();
2938
- message.phase = (object.phase !== undefined && object.phase !== null)
2939
- ? v1alpha1_1.ClusterStatus_Phase.fromJSON(object.phase.name)
2940
- : v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED;
2941
- message.state = (object.state !== undefined && object.state !== null)
2942
- ? v1alpha1_1.ClusterStatus_State.fromJSON(object.state.name)
2943
- : v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED;
2944
- message.result = (object.result !== undefined && object.result !== null)
2945
- ? exports.JobResult.fromJSON(object.result.name)
2946
- : exports.JobResult.JOB_RESULT_UNSPECIFIED;
2947
- return message;
2948
- },
2949
- };
2950
- protobuf_1.protoRegistry.registerMessage(exports.JobStatus);
2951
- function JobStatusCustomInspect() {
2952
- const parts = [];
2953
- if (this.phase !== undefined)
2954
- parts.push("phase" + "=" + (0, util_1.inspect)(this.phase));
2955
- if (this.state !== undefined)
2956
- parts.push("state" + "=" + (0, util_1.inspect)(this.state));
2957
- if (this.result !== undefined)
2958
- parts.push("result" + "=" + (0, util_1.inspect)(this.result));
2959
- return `${this.$type}(${parts.join(", ")})`;
2960
- }
2961
- function JobStatusCustomJson() {
2962
- const obj = {
2963
- type: this.$type,
2964
- };
2965
- if (this.phase !== undefined)
2966
- obj.phase = (0, logging_1.inspectJson)(this.phase);
2967
- if (this.state !== undefined)
2968
- obj.state = (0, logging_1.inspectJson)(this.state);
2969
- if (this.result !== undefined)
2970
- obj.result = (0, logging_1.inspectJson)(this.result);
2971
- return obj;
2972
- }
2973
- function applyJobStatusCustom(message) {
2974
- message[logging_1.custom] = JobStatusCustomInspect;
2975
- message[logging_1.customJson] = JobStatusCustomJson;
2976
- return message;
2977
- }
2978
- function createBaseJobStatus() {
2979
- const message = {
2980
- $type: "nebius.msp.serverless.v1alpha1.JobStatus",
2981
- phase: v1alpha1_1.ClusterStatus_Phase.PHASE_UNSPECIFIED,
2982
- state: v1alpha1_1.ClusterStatus_State.STATE_UNSPECIFIED,
2983
- result: exports.JobResult.JOB_RESULT_UNSPECIFIED,
2984
- };
2985
- return applyJobStatusCustom(message);
2986
- }
2987
- //# sourceMappingURL=index.js.map