@nebius/js-sdk 0.2.26 → 0.2.27

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.
@@ -0,0 +1,1264 @@
1
+ "use strict";
2
+ /* Generated by Nebius TS generator. DO NOT EDIT! */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TunnelStatus = exports.TunnelSpec = exports.Tunnel = exports.TunnelStatus_State = exports.TunnelService = exports.TunnelServiceBaseClient = exports.TunnelServiceServiceDescription = exports.DeleteTunnelRequest = exports.UpdateTunnelRequest = exports.CreateTunnelRequest = exports.ListTunnelsResponse = exports.ListTunnelRequest = exports.GetTunnelRequest = void 0;
5
+ const index_js_1 = require("../../../../runtime/protos/index.js");
6
+ const util_1 = require("util");
7
+ const protobuf_js_1 = require("../../../protobuf.js");
8
+ const logging_js_1 = require("../../../../runtime/util/logging.js");
9
+ const grpc_js_1 = require("@grpc/grpc-js");
10
+ const request_js_1 = require("../../../../runtime/request.js");
11
+ const operation_js_1 = require("../../../../runtime/operation.js");
12
+ const index_js_2 = require("../../common/v1/index.js");
13
+ const __deprecatedWarned = new Set();
14
+ exports.GetTunnelRequest = {
15
+ $type: "nebius.tunnel.v1.GetTunnelRequest",
16
+ encode(message, writer = new index_js_1.BinaryWriter()) {
17
+ if (message.id !== "") {
18
+ writer.uint32(10).string(message.id);
19
+ }
20
+ if (message[index_js_1.unknownFieldsSymbol]) {
21
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
27
+ const end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseGetTunnelRequest();
29
+ let writer = undefined;
30
+ while (reader.pos < end) {
31
+ const tag = reader.uint32();
32
+ switch (tag >>> 3) {
33
+ case 1: {
34
+ if (tag !== 10)
35
+ break;
36
+ message.id = reader.string();
37
+ continue;
38
+ }
39
+ default:
40
+ break;
41
+ }
42
+ if ((tag & 7) === 4 || tag === 0) {
43
+ break;
44
+ }
45
+ {
46
+ if (!writer)
47
+ writer = new index_js_1.BinaryWriter();
48
+ const skipped = reader.skip(tag & 7, tag >>> 3);
49
+ writer.uint32(tag).raw(skipped);
50
+ }
51
+ }
52
+ if (writer) {
53
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
54
+ }
55
+ return message;
56
+ },
57
+ fromJSON(object) {
58
+ return applyGetTunnelRequestCustom({
59
+ $type: "nebius.tunnel.v1.GetTunnelRequest",
60
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
61
+ ? String(object.id ?? object.id)
62
+ : "",
63
+ });
64
+ },
65
+ toJSON(message, use = "json") {
66
+ const obj = {};
67
+ const pick = (json, pb) => (use === "json" ? json : pb);
68
+ if (message.id !== "") {
69
+ obj[pick("id", "id")] = message.id;
70
+ }
71
+ return obj;
72
+ },
73
+ create(base) {
74
+ return exports.GetTunnelRequest.fromPartial(base ?? {});
75
+ },
76
+ fromPartial(object) {
77
+ const message = createBaseGetTunnelRequest();
78
+ message.id = (object.id !== undefined && object.id !== null)
79
+ ? object.id
80
+ : "";
81
+ return message;
82
+ },
83
+ };
84
+ protobuf_js_1.protoRegistry.registerMessage(exports.GetTunnelRequest);
85
+ function GetTunnelRequestCustomInspect() {
86
+ const parts = [];
87
+ if (this.id !== "")
88
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
89
+ return `${this.$type}(${parts.join(", ")})`;
90
+ }
91
+ function GetTunnelRequestCustomJson() {
92
+ const obj = {
93
+ type: this.$type,
94
+ };
95
+ if (this.id !== "")
96
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
97
+ return obj;
98
+ }
99
+ function applyGetTunnelRequestCustom(message) {
100
+ message[logging_js_1.custom] = GetTunnelRequestCustomInspect;
101
+ message[logging_js_1.customJson] = GetTunnelRequestCustomJson;
102
+ return message;
103
+ }
104
+ function createBaseGetTunnelRequest() {
105
+ const message = {
106
+ $type: "nebius.tunnel.v1.GetTunnelRequest",
107
+ id: "",
108
+ };
109
+ return applyGetTunnelRequestCustom(message);
110
+ }
111
+ exports.ListTunnelRequest = {
112
+ $type: "nebius.tunnel.v1.ListTunnelRequest",
113
+ encode(message, writer = new index_js_1.BinaryWriter()) {
114
+ if (message.parentId !== "") {
115
+ writer.uint32(10).string(message.parentId);
116
+ }
117
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
118
+ writer.uint32(16).int64(message.pageSize.toString());
119
+ }
120
+ if (message.pageToken !== "") {
121
+ writer.uint32(26).string(message.pageToken);
122
+ }
123
+ if (message.filter !== "") {
124
+ writer.uint32(34).string(message.filter);
125
+ }
126
+ if (message[index_js_1.unknownFieldsSymbol]) {
127
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
128
+ }
129
+ return writer;
130
+ },
131
+ decode(input, length) {
132
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
133
+ const end = length === undefined ? reader.len : reader.pos + length;
134
+ const message = createBaseListTunnelRequest();
135
+ let writer = undefined;
136
+ while (reader.pos < end) {
137
+ const tag = reader.uint32();
138
+ switch (tag >>> 3) {
139
+ case 1: {
140
+ if (tag !== 10)
141
+ break;
142
+ message.parentId = reader.string();
143
+ continue;
144
+ }
145
+ case 2: {
146
+ if (tag !== 16)
147
+ break;
148
+ message.pageSize = index_js_1.Long.fromValue(reader.int64());
149
+ continue;
150
+ }
151
+ case 3: {
152
+ if (tag !== 26)
153
+ break;
154
+ message.pageToken = reader.string();
155
+ continue;
156
+ }
157
+ case 4: {
158
+ if (tag !== 34)
159
+ break;
160
+ message.filter = reader.string();
161
+ continue;
162
+ }
163
+ default:
164
+ break;
165
+ }
166
+ if ((tag & 7) === 4 || tag === 0) {
167
+ break;
168
+ }
169
+ {
170
+ if (!writer)
171
+ writer = new index_js_1.BinaryWriter();
172
+ const skipped = reader.skip(tag & 7, tag >>> 3);
173
+ writer.uint32(tag).raw(skipped);
174
+ }
175
+ }
176
+ if (writer) {
177
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
178
+ }
179
+ return message;
180
+ },
181
+ fromJSON(object) {
182
+ return applyListTunnelRequestCustom({
183
+ $type: "nebius.tunnel.v1.ListTunnelRequest",
184
+ parentId: (0, index_js_1.isSet)(object.parentId ?? object.parent_id)
185
+ ? String(object.parentId ?? object.parent_id)
186
+ : "",
187
+ pageSize: (0, index_js_1.isSet)(object.pageSize ?? object.page_size)
188
+ ? index_js_1.Long.fromValue(object.pageSize ?? object.page_size)
189
+ : index_js_1.Long.ZERO,
190
+ pageToken: (0, index_js_1.isSet)(object.pageToken ?? object.page_token)
191
+ ? String(object.pageToken ?? object.page_token)
192
+ : "",
193
+ filter: (0, index_js_1.isSet)(object.filter ?? object.filter)
194
+ ? String(object.filter ?? object.filter)
195
+ : "",
196
+ });
197
+ },
198
+ toJSON(message, use = "json") {
199
+ const obj = {};
200
+ const pick = (json, pb) => (use === "json" ? json : pb);
201
+ if (message.parentId !== "") {
202
+ obj[pick("parentId", "parent_id")] = message.parentId;
203
+ }
204
+ if (!message.pageSize?.isZero?.()) {
205
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_js_1.Long.ZERO).toString();
206
+ }
207
+ if (message.pageToken !== "") {
208
+ obj[pick("pageToken", "page_token")] = message.pageToken;
209
+ }
210
+ if (message.filter !== "") {
211
+ obj[pick("filter", "filter")] = message.filter;
212
+ }
213
+ return obj;
214
+ },
215
+ create(base) {
216
+ return exports.ListTunnelRequest.fromPartial(base ?? {});
217
+ },
218
+ fromPartial(object) {
219
+ const message = createBaseListTunnelRequest();
220
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
221
+ ? object.parentId
222
+ : "";
223
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
224
+ ? index_js_1.Long.fromValue(object.pageSize)
225
+ : index_js_1.Long.ZERO;
226
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
227
+ ? object.pageToken
228
+ : "";
229
+ message.filter = (object.filter !== undefined && object.filter !== null)
230
+ ? object.filter
231
+ : "";
232
+ return message;
233
+ },
234
+ };
235
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListTunnelRequest);
236
+ function ListTunnelRequestCustomInspect() {
237
+ const parts = [];
238
+ if (this.parentId !== "")
239
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
240
+ if (!this.pageSize?.isZero?.())
241
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
242
+ if (this.pageToken !== "")
243
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
244
+ if (this.filter !== "")
245
+ parts.push("filter" + "=" + (0, util_1.inspect)(this.filter));
246
+ return `${this.$type}(${parts.join(", ")})`;
247
+ }
248
+ function ListTunnelRequestCustomJson() {
249
+ const obj = {
250
+ type: this.$type,
251
+ };
252
+ if (this.parentId !== "")
253
+ obj.parentId = (0, logging_js_1.inspectJson)(this.parentId);
254
+ if (!this.pageSize?.isZero?.())
255
+ obj.pageSize = (0, logging_js_1.inspectJson)(this.pageSize);
256
+ if (this.pageToken !== "")
257
+ obj.pageToken = (0, logging_js_1.inspectJson)(this.pageToken);
258
+ if (this.filter !== "")
259
+ obj.filter = (0, logging_js_1.inspectJson)(this.filter);
260
+ return obj;
261
+ }
262
+ function applyListTunnelRequestCustom(message) {
263
+ message[logging_js_1.custom] = ListTunnelRequestCustomInspect;
264
+ message[logging_js_1.customJson] = ListTunnelRequestCustomJson;
265
+ return message;
266
+ }
267
+ function createBaseListTunnelRequest() {
268
+ const message = {
269
+ $type: "nebius.tunnel.v1.ListTunnelRequest",
270
+ parentId: "",
271
+ pageSize: index_js_1.Long.ZERO,
272
+ pageToken: "",
273
+ filter: "",
274
+ };
275
+ return applyListTunnelRequestCustom(message);
276
+ }
277
+ exports.ListTunnelsResponse = {
278
+ $type: "nebius.tunnel.v1.ListTunnelsResponse",
279
+ encode(message, writer = new index_js_1.BinaryWriter()) {
280
+ for (const v of (message.items ?? [])) {
281
+ const w = writer.uint32(10).fork();
282
+ exports.Tunnel.encode(v, w);
283
+ w.join();
284
+ }
285
+ if (message.nextPageToken !== "") {
286
+ writer.uint32(18).string(message.nextPageToken);
287
+ }
288
+ if (message[index_js_1.unknownFieldsSymbol]) {
289
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
290
+ }
291
+ return writer;
292
+ },
293
+ decode(input, length) {
294
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
295
+ const end = length === undefined ? reader.len : reader.pos + length;
296
+ const message = createBaseListTunnelsResponse();
297
+ let writer = undefined;
298
+ while (reader.pos < end) {
299
+ const tag = reader.uint32();
300
+ switch (tag >>> 3) {
301
+ case 1: {
302
+ if (tag !== 10)
303
+ break;
304
+ message.items.push(exports.Tunnel.decode(reader, reader.uint32()));
305
+ continue;
306
+ }
307
+ case 2: {
308
+ if (tag !== 18)
309
+ break;
310
+ message.nextPageToken = reader.string();
311
+ continue;
312
+ }
313
+ default:
314
+ break;
315
+ }
316
+ if ((tag & 7) === 4 || tag === 0) {
317
+ break;
318
+ }
319
+ {
320
+ if (!writer)
321
+ writer = new index_js_1.BinaryWriter();
322
+ const skipped = reader.skip(tag & 7, tag >>> 3);
323
+ writer.uint32(tag).raw(skipped);
324
+ }
325
+ }
326
+ if (writer) {
327
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
328
+ }
329
+ return message;
330
+ },
331
+ fromJSON(object) {
332
+ return applyListTunnelsResponseCustom({
333
+ $type: "nebius.tunnel.v1.ListTunnelsResponse",
334
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
335
+ ? (object.items ?? object.items).map((e) => exports.Tunnel.fromJSON(e))
336
+ : [],
337
+ nextPageToken: (0, index_js_1.isSet)(object.nextPageToken ?? object.next_page_token)
338
+ ? String(object.nextPageToken ?? object.next_page_token)
339
+ : "",
340
+ });
341
+ },
342
+ toJSON(message, use = "json") {
343
+ const obj = {};
344
+ const pick = (json, pb) => (use === "json" ? json : pb);
345
+ if (message.items?.length) {
346
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.Tunnel.toJSON(e, use) : undefined);
347
+ }
348
+ if (message.nextPageToken !== "") {
349
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
350
+ }
351
+ return obj;
352
+ },
353
+ create(base) {
354
+ return exports.ListTunnelsResponse.fromPartial(base ?? {});
355
+ },
356
+ fromPartial(object) {
357
+ const message = createBaseListTunnelsResponse();
358
+ message.items = object.items?.map((e) => exports.Tunnel.fromPartial(e)) || [];
359
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
360
+ ? object.nextPageToken
361
+ : "";
362
+ return message;
363
+ },
364
+ };
365
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListTunnelsResponse);
366
+ function ListTunnelsResponseCustomInspect() {
367
+ const parts = [];
368
+ if ((this.items?.length ?? 0) !== 0)
369
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
370
+ if (this.nextPageToken !== "")
371
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
372
+ return `${this.$type}(${parts.join(", ")})`;
373
+ }
374
+ function ListTunnelsResponseCustomJson() {
375
+ const obj = {
376
+ type: this.$type,
377
+ };
378
+ if ((this.items?.length ?? 0) !== 0)
379
+ obj.items = (0, logging_js_1.inspectJson)(this.items);
380
+ if (this.nextPageToken !== "")
381
+ obj.nextPageToken = (0, logging_js_1.inspectJson)(this.nextPageToken);
382
+ return obj;
383
+ }
384
+ function applyListTunnelsResponseCustom(message) {
385
+ message[logging_js_1.custom] = ListTunnelsResponseCustomInspect;
386
+ message[logging_js_1.customJson] = ListTunnelsResponseCustomJson;
387
+ return message;
388
+ }
389
+ function createBaseListTunnelsResponse() {
390
+ const message = {
391
+ $type: "nebius.tunnel.v1.ListTunnelsResponse",
392
+ items: [],
393
+ nextPageToken: "",
394
+ };
395
+ return applyListTunnelsResponseCustom(message);
396
+ }
397
+ exports.CreateTunnelRequest = {
398
+ $type: "nebius.tunnel.v1.CreateTunnelRequest",
399
+ encode(message, writer = new index_js_1.BinaryWriter()) {
400
+ if (message.metadata !== undefined) {
401
+ const w = writer.uint32(10).fork();
402
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
403
+ w.join();
404
+ }
405
+ if (message.spec !== undefined) {
406
+ const w = writer.uint32(18).fork();
407
+ exports.TunnelSpec.encode(message.spec, w);
408
+ w.join();
409
+ }
410
+ if (message[index_js_1.unknownFieldsSymbol]) {
411
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
412
+ }
413
+ return writer;
414
+ },
415
+ decode(input, length) {
416
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
417
+ const end = length === undefined ? reader.len : reader.pos + length;
418
+ const message = createBaseCreateTunnelRequest();
419
+ let writer = undefined;
420
+ while (reader.pos < end) {
421
+ const tag = reader.uint32();
422
+ switch (tag >>> 3) {
423
+ case 1: {
424
+ if (tag !== 10)
425
+ break;
426
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
427
+ continue;
428
+ }
429
+ case 2: {
430
+ if (tag !== 18)
431
+ break;
432
+ message.spec = exports.TunnelSpec.decode(reader, reader.uint32());
433
+ continue;
434
+ }
435
+ default:
436
+ break;
437
+ }
438
+ if ((tag & 7) === 4 || tag === 0) {
439
+ break;
440
+ }
441
+ {
442
+ if (!writer)
443
+ writer = new index_js_1.BinaryWriter();
444
+ const skipped = reader.skip(tag & 7, tag >>> 3);
445
+ writer.uint32(tag).raw(skipped);
446
+ }
447
+ }
448
+ if (writer) {
449
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
450
+ }
451
+ return message;
452
+ },
453
+ fromJSON(object) {
454
+ return applyCreateTunnelRequestCustom({
455
+ $type: "nebius.tunnel.v1.CreateTunnelRequest",
456
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
457
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
458
+ : undefined,
459
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
460
+ ? exports.TunnelSpec.fromJSON(object.spec ?? object.spec)
461
+ : undefined,
462
+ });
463
+ },
464
+ toJSON(message, use = "json") {
465
+ const obj = {};
466
+ const pick = (json, pb) => (use === "json" ? json : pb);
467
+ if (message.metadata !== undefined) {
468
+ obj[pick("metadata", "metadata")] = message.metadata
469
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
470
+ : undefined;
471
+ }
472
+ if (message.spec !== undefined) {
473
+ obj[pick("spec", "spec")] = message.spec
474
+ ? exports.TunnelSpec.toJSON(message.spec, use)
475
+ : undefined;
476
+ }
477
+ return obj;
478
+ },
479
+ create(base) {
480
+ return exports.CreateTunnelRequest.fromPartial(base ?? {});
481
+ },
482
+ fromPartial(object) {
483
+ const message = createBaseCreateTunnelRequest();
484
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
485
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
486
+ : undefined;
487
+ message.spec = (object.spec !== undefined && object.spec !== null)
488
+ ? exports.TunnelSpec.fromPartial(object.spec)
489
+ : undefined;
490
+ return message;
491
+ },
492
+ };
493
+ protobuf_js_1.protoRegistry.registerMessage(exports.CreateTunnelRequest);
494
+ function CreateTunnelRequestCustomInspect() {
495
+ const parts = [];
496
+ if (this.metadata !== undefined)
497
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
498
+ if (this.spec !== undefined)
499
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
500
+ return `${this.$type}(${parts.join(", ")})`;
501
+ }
502
+ function CreateTunnelRequestCustomJson() {
503
+ const obj = {
504
+ type: this.$type,
505
+ };
506
+ if (this.metadata !== undefined)
507
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
508
+ if (this.spec !== undefined)
509
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
510
+ return obj;
511
+ }
512
+ function applyCreateTunnelRequestCustom(message) {
513
+ message[logging_js_1.custom] = CreateTunnelRequestCustomInspect;
514
+ message[logging_js_1.customJson] = CreateTunnelRequestCustomJson;
515
+ return message;
516
+ }
517
+ function createBaseCreateTunnelRequest() {
518
+ const message = {
519
+ $type: "nebius.tunnel.v1.CreateTunnelRequest",
520
+ metadata: undefined,
521
+ spec: undefined,
522
+ };
523
+ return applyCreateTunnelRequestCustom(message);
524
+ }
525
+ exports.UpdateTunnelRequest = {
526
+ $type: "nebius.tunnel.v1.UpdateTunnelRequest",
527
+ encode(message, writer = new index_js_1.BinaryWriter()) {
528
+ if (message.metadata !== undefined) {
529
+ const w = writer.uint32(10).fork();
530
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
531
+ w.join();
532
+ }
533
+ if (message.spec !== undefined) {
534
+ const w = writer.uint32(18).fork();
535
+ exports.TunnelSpec.encode(message.spec, w);
536
+ w.join();
537
+ }
538
+ if (message[index_js_1.unknownFieldsSymbol]) {
539
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
540
+ }
541
+ return writer;
542
+ },
543
+ decode(input, length) {
544
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
545
+ const end = length === undefined ? reader.len : reader.pos + length;
546
+ const message = createBaseUpdateTunnelRequest();
547
+ let writer = undefined;
548
+ while (reader.pos < end) {
549
+ const tag = reader.uint32();
550
+ switch (tag >>> 3) {
551
+ case 1: {
552
+ if (tag !== 10)
553
+ break;
554
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
555
+ continue;
556
+ }
557
+ case 2: {
558
+ if (tag !== 18)
559
+ break;
560
+ message.spec = exports.TunnelSpec.decode(reader, reader.uint32());
561
+ continue;
562
+ }
563
+ default:
564
+ break;
565
+ }
566
+ if ((tag & 7) === 4 || tag === 0) {
567
+ break;
568
+ }
569
+ {
570
+ if (!writer)
571
+ writer = new index_js_1.BinaryWriter();
572
+ const skipped = reader.skip(tag & 7, tag >>> 3);
573
+ writer.uint32(tag).raw(skipped);
574
+ }
575
+ }
576
+ if (writer) {
577
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
578
+ }
579
+ return message;
580
+ },
581
+ fromJSON(object) {
582
+ return applyUpdateTunnelRequestCustom({
583
+ $type: "nebius.tunnel.v1.UpdateTunnelRequest",
584
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
585
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
586
+ : undefined,
587
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
588
+ ? exports.TunnelSpec.fromJSON(object.spec ?? object.spec)
589
+ : undefined,
590
+ });
591
+ },
592
+ toJSON(message, use = "json") {
593
+ const obj = {};
594
+ const pick = (json, pb) => (use === "json" ? json : pb);
595
+ if (message.metadata !== undefined) {
596
+ obj[pick("metadata", "metadata")] = message.metadata
597
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
598
+ : undefined;
599
+ }
600
+ if (message.spec !== undefined) {
601
+ obj[pick("spec", "spec")] = message.spec
602
+ ? exports.TunnelSpec.toJSON(message.spec, use)
603
+ : undefined;
604
+ }
605
+ return obj;
606
+ },
607
+ create(base) {
608
+ return exports.UpdateTunnelRequest.fromPartial(base ?? {});
609
+ },
610
+ fromPartial(object) {
611
+ const message = createBaseUpdateTunnelRequest();
612
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
613
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
614
+ : undefined;
615
+ message.spec = (object.spec !== undefined && object.spec !== null)
616
+ ? exports.TunnelSpec.fromPartial(object.spec)
617
+ : undefined;
618
+ return message;
619
+ },
620
+ };
621
+ protobuf_js_1.protoRegistry.registerMessage(exports.UpdateTunnelRequest);
622
+ function UpdateTunnelRequestCustomInspect() {
623
+ const parts = [];
624
+ if (this.metadata !== undefined)
625
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
626
+ if (this.spec !== undefined)
627
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
628
+ return `${this.$type}(${parts.join(", ")})`;
629
+ }
630
+ function UpdateTunnelRequestCustomJson() {
631
+ const obj = {
632
+ type: this.$type,
633
+ };
634
+ if (this.metadata !== undefined)
635
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
636
+ if (this.spec !== undefined)
637
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
638
+ return obj;
639
+ }
640
+ function applyUpdateTunnelRequestCustom(message) {
641
+ message[logging_js_1.custom] = UpdateTunnelRequestCustomInspect;
642
+ message[logging_js_1.customJson] = UpdateTunnelRequestCustomJson;
643
+ return message;
644
+ }
645
+ function createBaseUpdateTunnelRequest() {
646
+ const message = {
647
+ $type: "nebius.tunnel.v1.UpdateTunnelRequest",
648
+ metadata: undefined,
649
+ spec: undefined,
650
+ };
651
+ return applyUpdateTunnelRequestCustom(message);
652
+ }
653
+ exports.DeleteTunnelRequest = {
654
+ $type: "nebius.tunnel.v1.DeleteTunnelRequest",
655
+ encode(message, writer = new index_js_1.BinaryWriter()) {
656
+ if (message.id !== "") {
657
+ writer.uint32(10).string(message.id);
658
+ }
659
+ if (message[index_js_1.unknownFieldsSymbol]) {
660
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
661
+ }
662
+ return writer;
663
+ },
664
+ decode(input, length) {
665
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
666
+ const end = length === undefined ? reader.len : reader.pos + length;
667
+ const message = createBaseDeleteTunnelRequest();
668
+ let writer = undefined;
669
+ while (reader.pos < end) {
670
+ const tag = reader.uint32();
671
+ switch (tag >>> 3) {
672
+ case 1: {
673
+ if (tag !== 10)
674
+ break;
675
+ message.id = reader.string();
676
+ continue;
677
+ }
678
+ default:
679
+ break;
680
+ }
681
+ if ((tag & 7) === 4 || tag === 0) {
682
+ break;
683
+ }
684
+ {
685
+ if (!writer)
686
+ writer = new index_js_1.BinaryWriter();
687
+ const skipped = reader.skip(tag & 7, tag >>> 3);
688
+ writer.uint32(tag).raw(skipped);
689
+ }
690
+ }
691
+ if (writer) {
692
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
693
+ }
694
+ return message;
695
+ },
696
+ fromJSON(object) {
697
+ return applyDeleteTunnelRequestCustom({
698
+ $type: "nebius.tunnel.v1.DeleteTunnelRequest",
699
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
700
+ ? String(object.id ?? object.id)
701
+ : "",
702
+ });
703
+ },
704
+ toJSON(message, use = "json") {
705
+ const obj = {};
706
+ const pick = (json, pb) => (use === "json" ? json : pb);
707
+ if (message.id !== "") {
708
+ obj[pick("id", "id")] = message.id;
709
+ }
710
+ return obj;
711
+ },
712
+ create(base) {
713
+ return exports.DeleteTunnelRequest.fromPartial(base ?? {});
714
+ },
715
+ fromPartial(object) {
716
+ const message = createBaseDeleteTunnelRequest();
717
+ message.id = (object.id !== undefined && object.id !== null)
718
+ ? object.id
719
+ : "";
720
+ return message;
721
+ },
722
+ };
723
+ protobuf_js_1.protoRegistry.registerMessage(exports.DeleteTunnelRequest);
724
+ function DeleteTunnelRequestCustomInspect() {
725
+ const parts = [];
726
+ if (this.id !== "")
727
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
728
+ return `${this.$type}(${parts.join(", ")})`;
729
+ }
730
+ function DeleteTunnelRequestCustomJson() {
731
+ const obj = {
732
+ type: this.$type,
733
+ };
734
+ if (this.id !== "")
735
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
736
+ return obj;
737
+ }
738
+ function applyDeleteTunnelRequestCustom(message) {
739
+ message[logging_js_1.custom] = DeleteTunnelRequestCustomInspect;
740
+ message[logging_js_1.customJson] = DeleteTunnelRequestCustomJson;
741
+ return message;
742
+ }
743
+ function createBaseDeleteTunnelRequest() {
744
+ const message = {
745
+ $type: "nebius.tunnel.v1.DeleteTunnelRequest",
746
+ id: "",
747
+ };
748
+ return applyDeleteTunnelRequestCustom(message);
749
+ }
750
+ exports.TunnelServiceServiceDescription = {
751
+ get: {
752
+ path: "/nebius.tunnel.v1.TunnelService/Get",
753
+ requestStream: false,
754
+ responseStream: false,
755
+ requestSerialize: (value) => Buffer.from(exports.GetTunnelRequest.encode(value).finish()),
756
+ sendResetMask: false,
757
+ requestDeserialize: (value) => exports.GetTunnelRequest.decode(value),
758
+ responseSerialize: (value) => Buffer.from(exports.Tunnel.encode(value).finish()),
759
+ responseDeserialize: (value) => exports.Tunnel.decode(value),
760
+ },
761
+ list: {
762
+ path: "/nebius.tunnel.v1.TunnelService/List",
763
+ requestStream: false,
764
+ responseStream: false,
765
+ requestSerialize: (value) => Buffer.from(exports.ListTunnelRequest.encode(value).finish()),
766
+ sendResetMask: false,
767
+ requestDeserialize: (value) => exports.ListTunnelRequest.decode(value),
768
+ responseSerialize: (value) => Buffer.from(exports.ListTunnelsResponse.encode(value).finish()),
769
+ responseDeserialize: (value) => exports.ListTunnelsResponse.decode(value),
770
+ },
771
+ create: {
772
+ path: "/nebius.tunnel.v1.TunnelService/Create",
773
+ requestStream: false,
774
+ responseStream: false,
775
+ requestSerialize: (value) => Buffer.from(exports.CreateTunnelRequest.encode(value).finish()),
776
+ sendResetMask: false,
777
+ requestDeserialize: (value) => exports.CreateTunnelRequest.decode(value),
778
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
779
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
780
+ },
781
+ update: {
782
+ path: "/nebius.tunnel.v1.TunnelService/Update",
783
+ requestStream: false,
784
+ responseStream: false,
785
+ requestSerialize: (value) => Buffer.from(exports.UpdateTunnelRequest.encode(value).finish()),
786
+ sendResetMask: true,
787
+ requestDeserialize: (value) => exports.UpdateTunnelRequest.decode(value),
788
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
789
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
790
+ },
791
+ delete: {
792
+ path: "/nebius.tunnel.v1.TunnelService/Delete",
793
+ requestStream: false,
794
+ responseStream: false,
795
+ requestSerialize: (value) => Buffer.from(exports.DeleteTunnelRequest.encode(value).finish()),
796
+ sendResetMask: false,
797
+ requestDeserialize: (value) => exports.DeleteTunnelRequest.decode(value),
798
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
799
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
800
+ },
801
+ };
802
+ exports.TunnelServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.TunnelServiceServiceDescription, "nebius.tunnel.v1.TunnelService");
803
+ class TunnelService {
804
+ sdk;
805
+ $type = "nebius.tunnel.v1.TunnelService";
806
+ addr;
807
+ spec;
808
+ apiServiceName = "applicationtunnel.mkt";
809
+ constructor(sdk) {
810
+ this.sdk = sdk;
811
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
812
+ this.addr = addr;
813
+ this.spec = exports.TunnelServiceServiceDescription;
814
+ }
815
+ getOperationService() {
816
+ return new index_js_2.OperationService(this.sdk, this.addr);
817
+ }
818
+ get(...args) {
819
+ const spec = this.spec.get;
820
+ const request = args[0];
821
+ const metadata = (args.length > 1 ? args[1] : undefined);
822
+ const options = (args.length > 2 ? args[2] : undefined);
823
+ const deserialize = spec.responseDeserialize;
824
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
825
+ }
826
+ list(...args) {
827
+ const spec = this.spec.list;
828
+ const request = args[0];
829
+ const metadata = (args.length > 1 ? args[1] : undefined);
830
+ const options = (args.length > 2 ? args[2] : undefined);
831
+ const deserialize = spec.responseDeserialize;
832
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
833
+ }
834
+ create(...args) {
835
+ const spec = this.spec.create;
836
+ const request = args[0];
837
+ const metadata = (args.length > 1 ? args[1] : undefined);
838
+ const options = (args.length > 2 ? args[2] : undefined);
839
+ const deserialize = (value) => {
840
+ const resp = spec.responseDeserialize(value);
841
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
842
+ };
843
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
844
+ }
845
+ update(...args) {
846
+ const spec = this.spec.update;
847
+ const request = args[0];
848
+ const metadata = (args.length > 1 ? args[1] : undefined);
849
+ const options = (args.length > 2 ? args[2] : undefined);
850
+ const deserialize = (value) => {
851
+ const resp = spec.responseDeserialize(value);
852
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
853
+ };
854
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
855
+ }
856
+ delete(...args) {
857
+ const spec = this.spec.delete;
858
+ const request = args[0];
859
+ const metadata = (args.length > 1 ? args[1] : undefined);
860
+ const options = (args.length > 2 ? args[2] : undefined);
861
+ const deserialize = (value) => {
862
+ const resp = spec.responseDeserialize(value);
863
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
864
+ };
865
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
866
+ }
867
+ }
868
+ exports.TunnelService = TunnelService;
869
+ const TunnelStatus_State_VALUE_COMMENTS = {
870
+ UNSPECIFIED: " Default unspecified state.\n",
871
+ CREATED: " The tunnel has been created and is active.\n",
872
+ DELETED: " The tunnel has been deleted.\n",
873
+ };
874
+ exports.TunnelStatus_State = (0, index_js_1.createEnum)("nebius.tunnel.v1.TunnelStatus.State", {
875
+ /**
876
+ * Default unspecified state.
877
+ *
878
+ */
879
+ UNSPECIFIED: 0,
880
+ /**
881
+ * The tunnel has been created and is active.
882
+ *
883
+ */
884
+ CREATED: 1,
885
+ /**
886
+ * The tunnel has been deleted.
887
+ *
888
+ */
889
+ DELETED: 2,
890
+ }, TunnelStatus_State_VALUE_COMMENTS);
891
+ protobuf_js_1.protoRegistry.registerEnum(exports.TunnelStatus_State);
892
+ exports.Tunnel = {
893
+ $type: "nebius.tunnel.v1.Tunnel",
894
+ encode(message, writer = new index_js_1.BinaryWriter()) {
895
+ if (message.metadata !== undefined) {
896
+ const w = writer.uint32(10).fork();
897
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
898
+ w.join();
899
+ }
900
+ if (message.spec !== undefined) {
901
+ const w = writer.uint32(18).fork();
902
+ exports.TunnelSpec.encode(message.spec, w);
903
+ w.join();
904
+ }
905
+ if (message.status !== undefined) {
906
+ const w = writer.uint32(26).fork();
907
+ exports.TunnelStatus.encode(message.status, w);
908
+ w.join();
909
+ }
910
+ if (message[index_js_1.unknownFieldsSymbol]) {
911
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
912
+ }
913
+ return writer;
914
+ },
915
+ decode(input, length) {
916
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
917
+ const end = length === undefined ? reader.len : reader.pos + length;
918
+ const message = createBaseTunnel();
919
+ let writer = undefined;
920
+ while (reader.pos < end) {
921
+ const tag = reader.uint32();
922
+ switch (tag >>> 3) {
923
+ case 1: {
924
+ if (tag !== 10)
925
+ break;
926
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
927
+ continue;
928
+ }
929
+ case 2: {
930
+ if (tag !== 18)
931
+ break;
932
+ message.spec = exports.TunnelSpec.decode(reader, reader.uint32());
933
+ continue;
934
+ }
935
+ case 3: {
936
+ if (tag !== 26)
937
+ break;
938
+ message.status = exports.TunnelStatus.decode(reader, reader.uint32());
939
+ continue;
940
+ }
941
+ default:
942
+ break;
943
+ }
944
+ if ((tag & 7) === 4 || tag === 0) {
945
+ break;
946
+ }
947
+ {
948
+ if (!writer)
949
+ writer = new index_js_1.BinaryWriter();
950
+ const skipped = reader.skip(tag & 7, tag >>> 3);
951
+ writer.uint32(tag).raw(skipped);
952
+ }
953
+ }
954
+ if (writer) {
955
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
956
+ }
957
+ return message;
958
+ },
959
+ fromJSON(object) {
960
+ return applyTunnelCustom({
961
+ $type: "nebius.tunnel.v1.Tunnel",
962
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
963
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
964
+ : undefined,
965
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
966
+ ? exports.TunnelSpec.fromJSON(object.spec ?? object.spec)
967
+ : undefined,
968
+ status: (0, index_js_1.isSet)(object.status ?? object.status)
969
+ ? exports.TunnelStatus.fromJSON(object.status ?? object.status)
970
+ : undefined,
971
+ });
972
+ },
973
+ toJSON(message, use = "json") {
974
+ const obj = {};
975
+ const pick = (json, pb) => (use === "json" ? json : pb);
976
+ if (message.metadata !== undefined) {
977
+ obj[pick("metadata", "metadata")] = message.metadata
978
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
979
+ : undefined;
980
+ }
981
+ if (message.spec !== undefined) {
982
+ obj[pick("spec", "spec")] = message.spec
983
+ ? exports.TunnelSpec.toJSON(message.spec, use)
984
+ : undefined;
985
+ }
986
+ if (message.status !== undefined) {
987
+ obj[pick("status", "status")] = message.status
988
+ ? exports.TunnelStatus.toJSON(message.status, use)
989
+ : undefined;
990
+ }
991
+ return obj;
992
+ },
993
+ create(base) {
994
+ return exports.Tunnel.fromPartial(base ?? {});
995
+ },
996
+ fromPartial(object) {
997
+ const message = createBaseTunnel();
998
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
999
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
1000
+ : undefined;
1001
+ message.spec = (object.spec !== undefined && object.spec !== null)
1002
+ ? exports.TunnelSpec.fromPartial(object.spec)
1003
+ : undefined;
1004
+ message.status = (object.status !== undefined && object.status !== null)
1005
+ ? exports.TunnelStatus.fromPartial(object.status)
1006
+ : undefined;
1007
+ return message;
1008
+ },
1009
+ };
1010
+ protobuf_js_1.protoRegistry.registerMessage(exports.Tunnel);
1011
+ function TunnelCustomInspect() {
1012
+ const parts = [];
1013
+ if (this.metadata !== undefined)
1014
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
1015
+ if (this.spec !== undefined)
1016
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
1017
+ if (this.status !== undefined)
1018
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
1019
+ return `${this.$type}(${parts.join(", ")})`;
1020
+ }
1021
+ function TunnelCustomJson() {
1022
+ const obj = {
1023
+ type: this.$type,
1024
+ };
1025
+ if (this.metadata !== undefined)
1026
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
1027
+ if (this.spec !== undefined)
1028
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
1029
+ if (this.status !== undefined)
1030
+ obj.status = (0, logging_js_1.inspectJson)(this.status);
1031
+ return obj;
1032
+ }
1033
+ function applyTunnelCustom(message) {
1034
+ message[logging_js_1.custom] = TunnelCustomInspect;
1035
+ message[logging_js_1.customJson] = TunnelCustomJson;
1036
+ return message;
1037
+ }
1038
+ function createBaseTunnel() {
1039
+ const message = {
1040
+ $type: "nebius.tunnel.v1.Tunnel",
1041
+ metadata: undefined,
1042
+ spec: undefined,
1043
+ status: undefined,
1044
+ };
1045
+ return applyTunnelCustom(message);
1046
+ }
1047
+ exports.TunnelSpec = {
1048
+ $type: "nebius.tunnel.v1.TunnelSpec",
1049
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1050
+ if (message.title !== "") {
1051
+ writer.uint32(10).string(message.title);
1052
+ }
1053
+ if (message.description !== "") {
1054
+ writer.uint32(18).string(message.description);
1055
+ }
1056
+ if (message[index_js_1.unknownFieldsSymbol]) {
1057
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1058
+ }
1059
+ return writer;
1060
+ },
1061
+ decode(input, length) {
1062
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1063
+ const end = length === undefined ? reader.len : reader.pos + length;
1064
+ const message = createBaseTunnelSpec();
1065
+ let writer = undefined;
1066
+ while (reader.pos < end) {
1067
+ const tag = reader.uint32();
1068
+ switch (tag >>> 3) {
1069
+ case 1: {
1070
+ if (tag !== 10)
1071
+ break;
1072
+ message.title = reader.string();
1073
+ continue;
1074
+ }
1075
+ case 2: {
1076
+ if (tag !== 18)
1077
+ break;
1078
+ message.description = reader.string();
1079
+ continue;
1080
+ }
1081
+ default:
1082
+ break;
1083
+ }
1084
+ if ((tag & 7) === 4 || tag === 0) {
1085
+ break;
1086
+ }
1087
+ {
1088
+ if (!writer)
1089
+ writer = new index_js_1.BinaryWriter();
1090
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1091
+ writer.uint32(tag).raw(skipped);
1092
+ }
1093
+ }
1094
+ if (writer) {
1095
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1096
+ }
1097
+ return message;
1098
+ },
1099
+ fromJSON(object) {
1100
+ return applyTunnelSpecCustom({
1101
+ $type: "nebius.tunnel.v1.TunnelSpec",
1102
+ title: (0, index_js_1.isSet)(object.title ?? object.title)
1103
+ ? String(object.title ?? object.title)
1104
+ : "",
1105
+ description: (0, index_js_1.isSet)(object.description ?? object.description)
1106
+ ? String(object.description ?? object.description)
1107
+ : "",
1108
+ });
1109
+ },
1110
+ toJSON(message, use = "json") {
1111
+ const obj = {};
1112
+ const pick = (json, pb) => (use === "json" ? json : pb);
1113
+ if (message.title !== "") {
1114
+ obj[pick("title", "title")] = message.title;
1115
+ }
1116
+ if (message.description !== "") {
1117
+ obj[pick("description", "description")] = message.description;
1118
+ }
1119
+ return obj;
1120
+ },
1121
+ create(base) {
1122
+ return exports.TunnelSpec.fromPartial(base ?? {});
1123
+ },
1124
+ fromPartial(object) {
1125
+ const message = createBaseTunnelSpec();
1126
+ message.title = (object.title !== undefined && object.title !== null)
1127
+ ? object.title
1128
+ : "";
1129
+ message.description = (object.description !== undefined && object.description !== null)
1130
+ ? object.description
1131
+ : "";
1132
+ return message;
1133
+ },
1134
+ };
1135
+ protobuf_js_1.protoRegistry.registerMessage(exports.TunnelSpec);
1136
+ function TunnelSpecCustomInspect() {
1137
+ const parts = [];
1138
+ if (this.title !== "")
1139
+ parts.push("title" + "=" + (0, util_1.inspect)(this.title));
1140
+ if (this.description !== "")
1141
+ parts.push("description" + "=" + (0, util_1.inspect)(this.description));
1142
+ return `${this.$type}(${parts.join(", ")})`;
1143
+ }
1144
+ function TunnelSpecCustomJson() {
1145
+ const obj = {
1146
+ type: this.$type,
1147
+ };
1148
+ if (this.title !== "")
1149
+ obj.title = (0, logging_js_1.inspectJson)(this.title);
1150
+ if (this.description !== "")
1151
+ obj.description = (0, logging_js_1.inspectJson)(this.description);
1152
+ return obj;
1153
+ }
1154
+ function applyTunnelSpecCustom(message) {
1155
+ message[logging_js_1.custom] = TunnelSpecCustomInspect;
1156
+ message[logging_js_1.customJson] = TunnelSpecCustomJson;
1157
+ return message;
1158
+ }
1159
+ function createBaseTunnelSpec() {
1160
+ const message = {
1161
+ $type: "nebius.tunnel.v1.TunnelSpec",
1162
+ title: "",
1163
+ description: "",
1164
+ };
1165
+ return applyTunnelSpecCustom(message);
1166
+ }
1167
+ exports.TunnelStatus = {
1168
+ $type: "nebius.tunnel.v1.TunnelStatus",
1169
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1170
+ if ((message.state ?? exports.TunnelStatus_State.UNSPECIFIED) !== exports.TunnelStatus_State.UNSPECIFIED) {
1171
+ exports.TunnelStatus_State.encodeField(writer, 1, message.state);
1172
+ }
1173
+ if (message[index_js_1.unknownFieldsSymbol]) {
1174
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1175
+ }
1176
+ return writer;
1177
+ },
1178
+ decode(input, length) {
1179
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1180
+ const end = length === undefined ? reader.len : reader.pos + length;
1181
+ const message = createBaseTunnelStatus();
1182
+ let writer = undefined;
1183
+ while (reader.pos < end) {
1184
+ const tag = reader.uint32();
1185
+ switch (tag >>> 3) {
1186
+ case 1: {
1187
+ if (tag !== 8)
1188
+ break;
1189
+ message.state = exports.TunnelStatus_State.fromNumber(reader.int32());
1190
+ continue;
1191
+ }
1192
+ default:
1193
+ break;
1194
+ }
1195
+ if ((tag & 7) === 4 || tag === 0) {
1196
+ break;
1197
+ }
1198
+ {
1199
+ if (!writer)
1200
+ writer = new index_js_1.BinaryWriter();
1201
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1202
+ writer.uint32(tag).raw(skipped);
1203
+ }
1204
+ }
1205
+ if (writer) {
1206
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1207
+ }
1208
+ return message;
1209
+ },
1210
+ fromJSON(object) {
1211
+ return applyTunnelStatusCustom({
1212
+ $type: "nebius.tunnel.v1.TunnelStatus",
1213
+ state: (0, index_js_1.isSet)(object.state ?? object.state)
1214
+ ? exports.TunnelStatus_State.fromJSON(object.state ?? object.state)
1215
+ : exports.TunnelStatus_State.UNSPECIFIED,
1216
+ });
1217
+ },
1218
+ toJSON(message, use = "json") {
1219
+ const obj = {};
1220
+ const pick = (json, pb) => (use === "json" ? json : pb);
1221
+ if ((message.state ?? exports.TunnelStatus_State.UNSPECIFIED) !== exports.TunnelStatus_State.UNSPECIFIED) {
1222
+ obj[pick("state", "state")] = exports.TunnelStatus_State.toJSON(message.state);
1223
+ }
1224
+ return obj;
1225
+ },
1226
+ create(base) {
1227
+ return exports.TunnelStatus.fromPartial(base ?? {});
1228
+ },
1229
+ fromPartial(object) {
1230
+ const message = createBaseTunnelStatus();
1231
+ message.state = (object.state !== undefined && object.state !== null)
1232
+ ? exports.TunnelStatus_State.fromJSON(object.state.name)
1233
+ : exports.TunnelStatus_State.UNSPECIFIED;
1234
+ return message;
1235
+ },
1236
+ };
1237
+ protobuf_js_1.protoRegistry.registerMessage(exports.TunnelStatus);
1238
+ function TunnelStatusCustomInspect() {
1239
+ const parts = [];
1240
+ if (this.state !== undefined)
1241
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
1242
+ return `${this.$type}(${parts.join(", ")})`;
1243
+ }
1244
+ function TunnelStatusCustomJson() {
1245
+ const obj = {
1246
+ type: this.$type,
1247
+ };
1248
+ if (this.state !== undefined)
1249
+ obj.state = (0, logging_js_1.inspectJson)(this.state);
1250
+ return obj;
1251
+ }
1252
+ function applyTunnelStatusCustom(message) {
1253
+ message[logging_js_1.custom] = TunnelStatusCustomInspect;
1254
+ message[logging_js_1.customJson] = TunnelStatusCustomJson;
1255
+ return message;
1256
+ }
1257
+ function createBaseTunnelStatus() {
1258
+ const message = {
1259
+ $type: "nebius.tunnel.v1.TunnelStatus",
1260
+ state: exports.TunnelStatus_State.UNSPECIFIED,
1261
+ };
1262
+ return applyTunnelStatusCustom(message);
1263
+ }
1264
+ //# sourceMappingURL=index.js.map