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