@nebius/js-sdk 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,1684 @@
1
1
  "use strict";
2
2
  /* Generated by Nebius TS generator. DO NOT EDIT! */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ResourceAffinity = exports.ResourceAffinityComputeV1 = exports.ResourceAdviceStatus_Availability = exports.ResourceAdviceStatus = exports.ComputeInstanceDetails_Preset_Resources = exports.ComputeInstanceDetails_Preset = exports.ComputeInstanceDetails = exports.ResourceAdviceSpec = exports.ResourceAdvice = exports.ResourceAdviceStatus_Availability_AvailabilityLevel = exports.ResourceAdviceStatus_Availability_DataState = exports.ResourceAdviceService = exports.ResourceAdviceServiceBaseClient = exports.ResourceAdviceServiceServiceDescription = exports.ListResourceAdviceResponse = exports.ListResourceAdviceRequest = exports.CapacityInterval = exports.CapacityIntervalStatus = exports.CapacityIntervalSpec = exports.CapacityIntervalStatus_State = exports.CapacityIntervalService = exports.CapacityIntervalServiceBaseClient = exports.CapacityIntervalServiceServiceDescription = exports.ListCapacityIntervalsResponse = exports.ListCapacityIntervalsRequest = exports.GetCapacityIntervalRequest = exports.CapacityBlockGroup = exports.CapacityBlockGroupStatus = exports.CurrentContinuousInterval = exports.CapacityBlockGroupSpec = exports.CapacityBlockGroupStatus_UsageState = exports.CapacityBlockGroupStatus_State = exports.CurrentContinuousInterval_State = exports.CapacityBlockGroupService = exports.CapacityBlockGroupServiceBaseClient = exports.CapacityBlockGroupServiceServiceDescription = exports.ListCapacityBlockGroupResourcesResponse = exports.ListCapacityBlockGroupResourcesRequest = exports.ListCapacityBlockGroupsResponse = exports.ListCapacityBlockGroupsRequest = exports.GetCapacityBlockGroupByResourceAffinityRequest = exports.GetCapacityBlockGroupRequest = void 0;
4
+ exports.ResourceAdvice = exports.ResourceAdviceStatus_Availability_AvailabilityLevel = exports.ResourceAdviceStatus_Availability_DataState = exports.ResourceAdviceService = exports.ResourceAdviceServiceBaseClient = exports.ResourceAdviceServiceServiceDescription = exports.ListResourceAdviceResponse = exports.ListResourceAdviceRequest = exports.CapacityInterval = exports.CapacityIntervalStatus = exports.CapacityIntervalSpec = exports.CapacityIntervalStatus_State = exports.CapacityIntervalService = exports.CapacityIntervalServiceBaseClient = exports.CapacityIntervalServiceServiceDescription = exports.ListCapacityIntervalsResponse = exports.ListCapacityIntervalsRequest = exports.GetCapacityIntervalRequest = exports.CapacityBlockGroup = exports.CapacityBlockGroupStatus = exports.CurrentContinuousInterval = exports.CapacityBlockGroupSpec = exports.CapacityBlockGroupStatus_UsageState = exports.CapacityBlockGroupStatus_State = exports.CurrentContinuousInterval_State = exports.CapacityBlockGroupService = exports.CapacityBlockGroupServiceBaseClient = exports.CapacityBlockGroupServiceServiceDescription = exports.ListCapacityBlockGroupResourcesResponse = exports.ListCapacityBlockGroupResourcesRequest = exports.ListCapacityBlockGroupsResponse = exports.ListCapacityBlockGroupsRequest = exports.GetCapacityBlockGroupByResourceAffinityRequest = exports.GetCapacityBlockGroupRequest = exports.CapacityAllowanceStatus = exports.CapacityAllowanceSpec = exports.CapacityAllowance = exports.CapacityAllowanceStatus_UsageState = exports.CapacityAllowanceStatus_State = exports.CapacityAllowanceService = exports.CapacityAllowanceServiceBaseClient = exports.CapacityAllowanceServiceServiceDescription = exports.DeleteCapacityAllowanceRequest = exports.UpdateCapacityAllowanceRequest = exports.CreateCapacityAllowanceRequest = exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest = exports.GetCapacityAllowanceRequest = exports.ListCapacityAllowancesByCapacityBlockGroupRequest = exports.ListCapacityAllowancesResponse = exports.ListCapacityAllowancesRequest = void 0;
5
+ exports.ResourceAffinity = exports.ResourceAffinityComputeV1 = exports.ResourceAdviceStatus_Availability = exports.ResourceAdviceStatus = exports.ComputeInstanceDetails_Preset_Resources = exports.ComputeInstanceDetails_Preset = exports.ComputeInstanceDetails = exports.ResourceAdviceSpec = void 0;
5
6
  const index_js_1 = require("../../../../runtime/protos/index.js");
6
7
  const util_1 = require("util");
7
8
  const protobuf_js_1 = require("../../../protobuf.js");
8
9
  const logging_js_1 = require("../../../../runtime/util/logging.js");
9
10
  const grpc_js_1 = require("@grpc/grpc-js");
10
11
  const request_js_1 = require("../../../../runtime/request.js");
12
+ const operation_js_1 = require("../../../../runtime/operation.js");
11
13
  const index_js_2 = require("../../common/v1/index.js");
12
14
  const __deprecatedWarned = new Set();
15
+ exports.ListCapacityAllowancesRequest = {
16
+ $type: "nebius.capacity.v1.ListCapacityAllowancesRequest",
17
+ encode(message, writer = new index_js_1.BinaryWriter()) {
18
+ if (message.parentId !== "") {
19
+ writer.uint32(10).string(message.parentId);
20
+ }
21
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
22
+ writer.uint32(16).int64(message.pageSize.toString());
23
+ }
24
+ if (message.pageToken !== "") {
25
+ writer.uint32(26).string(message.pageToken);
26
+ }
27
+ if (message[index_js_1.unknownFieldsSymbol]) {
28
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
29
+ }
30
+ return writer;
31
+ },
32
+ decode(input, length) {
33
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
34
+ const end = length === undefined ? reader.len : reader.pos + length;
35
+ const message = createBaseListCapacityAllowancesRequest();
36
+ let writer = undefined;
37
+ while (reader.pos < end) {
38
+ const tag = reader.uint32();
39
+ switch (tag >>> 3) {
40
+ case 1: {
41
+ if (tag !== 10)
42
+ break;
43
+ message.parentId = reader.string();
44
+ continue;
45
+ }
46
+ case 2: {
47
+ if (tag !== 16)
48
+ break;
49
+ message.pageSize = index_js_1.Long.fromValue(reader.int64());
50
+ continue;
51
+ }
52
+ case 3: {
53
+ if (tag !== 26)
54
+ break;
55
+ message.pageToken = reader.string();
56
+ continue;
57
+ }
58
+ default:
59
+ break;
60
+ }
61
+ if ((tag & 7) === 4 || tag === 0) {
62
+ break;
63
+ }
64
+ {
65
+ if (!writer)
66
+ writer = new index_js_1.BinaryWriter();
67
+ const skipped = reader.skip(tag & 7, tag >>> 3);
68
+ writer.uint32(tag).raw(skipped);
69
+ }
70
+ }
71
+ if (writer) {
72
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
73
+ }
74
+ return message;
75
+ },
76
+ fromJSON(object) {
77
+ return applyListCapacityAllowancesRequestCustom({
78
+ $type: "nebius.capacity.v1.ListCapacityAllowancesRequest",
79
+ parentId: (0, index_js_1.isSet)(object.parentId ?? object.parent_id)
80
+ ? String(object.parentId ?? object.parent_id)
81
+ : "",
82
+ pageSize: (0, index_js_1.isSet)(object.pageSize ?? object.page_size)
83
+ ? index_js_1.Long.fromValue(object.pageSize ?? object.page_size)
84
+ : index_js_1.Long.ZERO,
85
+ pageToken: (0, index_js_1.isSet)(object.pageToken ?? object.page_token)
86
+ ? String(object.pageToken ?? object.page_token)
87
+ : "",
88
+ });
89
+ },
90
+ toJSON(message, use = "json") {
91
+ const obj = {};
92
+ const pick = (json, pb) => (use === "json" ? json : pb);
93
+ if (message.parentId !== "") {
94
+ obj[pick("parentId", "parent_id")] = message.parentId;
95
+ }
96
+ if (!message.pageSize?.isZero?.()) {
97
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_js_1.Long.ZERO).toString();
98
+ }
99
+ if (message.pageToken !== "") {
100
+ obj[pick("pageToken", "page_token")] = message.pageToken;
101
+ }
102
+ return obj;
103
+ },
104
+ create(base) {
105
+ return exports.ListCapacityAllowancesRequest.fromPartial(base ?? {});
106
+ },
107
+ fromPartial(object) {
108
+ const message = createBaseListCapacityAllowancesRequest();
109
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
110
+ ? object.parentId
111
+ : "";
112
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
113
+ ? index_js_1.Long.fromValue(object.pageSize)
114
+ : index_js_1.Long.ZERO;
115
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
116
+ ? object.pageToken
117
+ : "";
118
+ return message;
119
+ },
120
+ };
121
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListCapacityAllowancesRequest);
122
+ function ListCapacityAllowancesRequestCustomInspect() {
123
+ const parts = [];
124
+ if (this.parentId !== "")
125
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
126
+ if (!this.pageSize?.isZero?.())
127
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
128
+ if (this.pageToken !== "")
129
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
130
+ return `${this.$type}(${parts.join(", ")})`;
131
+ }
132
+ function ListCapacityAllowancesRequestCustomJson() {
133
+ const obj = {
134
+ type: this.$type,
135
+ };
136
+ if (this.parentId !== "")
137
+ obj.parentId = (0, logging_js_1.inspectJson)(this.parentId);
138
+ if (!this.pageSize?.isZero?.())
139
+ obj.pageSize = (0, logging_js_1.inspectJson)(this.pageSize);
140
+ if (this.pageToken !== "")
141
+ obj.pageToken = (0, logging_js_1.inspectJson)(this.pageToken);
142
+ return obj;
143
+ }
144
+ function applyListCapacityAllowancesRequestCustom(message) {
145
+ message[logging_js_1.custom] = ListCapacityAllowancesRequestCustomInspect;
146
+ message[logging_js_1.customJson] = ListCapacityAllowancesRequestCustomJson;
147
+ return message;
148
+ }
149
+ function createBaseListCapacityAllowancesRequest() {
150
+ const message = {
151
+ $type: "nebius.capacity.v1.ListCapacityAllowancesRequest",
152
+ parentId: "",
153
+ pageSize: index_js_1.Long.ZERO,
154
+ pageToken: "",
155
+ };
156
+ return applyListCapacityAllowancesRequestCustom(message);
157
+ }
158
+ exports.ListCapacityAllowancesResponse = {
159
+ $type: "nebius.capacity.v1.ListCapacityAllowancesResponse",
160
+ encode(message, writer = new index_js_1.BinaryWriter()) {
161
+ for (const v of (message.items ?? [])) {
162
+ const w = writer.uint32(10).fork();
163
+ exports.CapacityAllowance.encode(v, w);
164
+ w.join();
165
+ }
166
+ if (message.nextPageToken !== "") {
167
+ writer.uint32(18).string(message.nextPageToken);
168
+ }
169
+ if (message[index_js_1.unknownFieldsSymbol]) {
170
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
171
+ }
172
+ return writer;
173
+ },
174
+ decode(input, length) {
175
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
176
+ const end = length === undefined ? reader.len : reader.pos + length;
177
+ const message = createBaseListCapacityAllowancesResponse();
178
+ let writer = undefined;
179
+ while (reader.pos < end) {
180
+ const tag = reader.uint32();
181
+ switch (tag >>> 3) {
182
+ case 1: {
183
+ if (tag !== 10)
184
+ break;
185
+ message.items.push(exports.CapacityAllowance.decode(reader, reader.uint32()));
186
+ continue;
187
+ }
188
+ case 2: {
189
+ if (tag !== 18)
190
+ break;
191
+ message.nextPageToken = reader.string();
192
+ continue;
193
+ }
194
+ default:
195
+ break;
196
+ }
197
+ if ((tag & 7) === 4 || tag === 0) {
198
+ break;
199
+ }
200
+ {
201
+ if (!writer)
202
+ writer = new index_js_1.BinaryWriter();
203
+ const skipped = reader.skip(tag & 7, tag >>> 3);
204
+ writer.uint32(tag).raw(skipped);
205
+ }
206
+ }
207
+ if (writer) {
208
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
209
+ }
210
+ return message;
211
+ },
212
+ fromJSON(object) {
213
+ return applyListCapacityAllowancesResponseCustom({
214
+ $type: "nebius.capacity.v1.ListCapacityAllowancesResponse",
215
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
216
+ ? (object.items ?? object.items).map((e) => exports.CapacityAllowance.fromJSON(e))
217
+ : [],
218
+ nextPageToken: (0, index_js_1.isSet)(object.nextPageToken ?? object.next_page_token)
219
+ ? String(object.nextPageToken ?? object.next_page_token)
220
+ : "",
221
+ });
222
+ },
223
+ toJSON(message, use = "json") {
224
+ const obj = {};
225
+ const pick = (json, pb) => (use === "json" ? json : pb);
226
+ if (message.items?.length) {
227
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.CapacityAllowance.toJSON(e, use) : undefined);
228
+ }
229
+ if (message.nextPageToken !== "") {
230
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
231
+ }
232
+ return obj;
233
+ },
234
+ create(base) {
235
+ return exports.ListCapacityAllowancesResponse.fromPartial(base ?? {});
236
+ },
237
+ fromPartial(object) {
238
+ const message = createBaseListCapacityAllowancesResponse();
239
+ message.items = object.items?.map((e) => exports.CapacityAllowance.fromPartial(e)) || [];
240
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
241
+ ? object.nextPageToken
242
+ : "";
243
+ return message;
244
+ },
245
+ };
246
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListCapacityAllowancesResponse);
247
+ function ListCapacityAllowancesResponseCustomInspect() {
248
+ const parts = [];
249
+ if ((this.items?.length ?? 0) !== 0)
250
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
251
+ if (this.nextPageToken !== "")
252
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
253
+ return `${this.$type}(${parts.join(", ")})`;
254
+ }
255
+ function ListCapacityAllowancesResponseCustomJson() {
256
+ const obj = {
257
+ type: this.$type,
258
+ };
259
+ if ((this.items?.length ?? 0) !== 0)
260
+ obj.items = (0, logging_js_1.inspectJson)(this.items);
261
+ if (this.nextPageToken !== "")
262
+ obj.nextPageToken = (0, logging_js_1.inspectJson)(this.nextPageToken);
263
+ return obj;
264
+ }
265
+ function applyListCapacityAllowancesResponseCustom(message) {
266
+ message[logging_js_1.custom] = ListCapacityAllowancesResponseCustomInspect;
267
+ message[logging_js_1.customJson] = ListCapacityAllowancesResponseCustomJson;
268
+ return message;
269
+ }
270
+ function createBaseListCapacityAllowancesResponse() {
271
+ const message = {
272
+ $type: "nebius.capacity.v1.ListCapacityAllowancesResponse",
273
+ items: [],
274
+ nextPageToken: "",
275
+ };
276
+ return applyListCapacityAllowancesResponseCustom(message);
277
+ }
278
+ exports.ListCapacityAllowancesByCapacityBlockGroupRequest = {
279
+ $type: "nebius.capacity.v1.ListCapacityAllowancesByCapacityBlockGroupRequest",
280
+ encode(message, writer = new index_js_1.BinaryWriter()) {
281
+ if (message.capacityBlockGroupId !== "") {
282
+ writer.uint32(10).string(message.capacityBlockGroupId);
283
+ }
284
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
285
+ writer.uint32(16).int64(message.pageSize.toString());
286
+ }
287
+ if (message.pageToken !== "") {
288
+ writer.uint32(26).string(message.pageToken);
289
+ }
290
+ if (message[index_js_1.unknownFieldsSymbol]) {
291
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
292
+ }
293
+ return writer;
294
+ },
295
+ decode(input, length) {
296
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
297
+ const end = length === undefined ? reader.len : reader.pos + length;
298
+ const message = createBaseListCapacityAllowancesByCapacityBlockGroupRequest();
299
+ let writer = undefined;
300
+ while (reader.pos < end) {
301
+ const tag = reader.uint32();
302
+ switch (tag >>> 3) {
303
+ case 1: {
304
+ if (tag !== 10)
305
+ break;
306
+ message.capacityBlockGroupId = reader.string();
307
+ continue;
308
+ }
309
+ case 2: {
310
+ if (tag !== 16)
311
+ break;
312
+ message.pageSize = index_js_1.Long.fromValue(reader.int64());
313
+ continue;
314
+ }
315
+ case 3: {
316
+ if (tag !== 26)
317
+ break;
318
+ message.pageToken = reader.string();
319
+ continue;
320
+ }
321
+ default:
322
+ break;
323
+ }
324
+ if ((tag & 7) === 4 || tag === 0) {
325
+ break;
326
+ }
327
+ {
328
+ if (!writer)
329
+ writer = new index_js_1.BinaryWriter();
330
+ const skipped = reader.skip(tag & 7, tag >>> 3);
331
+ writer.uint32(tag).raw(skipped);
332
+ }
333
+ }
334
+ if (writer) {
335
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
336
+ }
337
+ return message;
338
+ },
339
+ fromJSON(object) {
340
+ return applyListCapacityAllowancesByCapacityBlockGroupRequestCustom({
341
+ $type: "nebius.capacity.v1.ListCapacityAllowancesByCapacityBlockGroupRequest",
342
+ capacityBlockGroupId: (0, index_js_1.isSet)(object.capacityBlockGroupId ?? object.capacity_block_group_id)
343
+ ? String(object.capacityBlockGroupId ?? object.capacity_block_group_id)
344
+ : "",
345
+ pageSize: (0, index_js_1.isSet)(object.pageSize ?? object.page_size)
346
+ ? index_js_1.Long.fromValue(object.pageSize ?? object.page_size)
347
+ : index_js_1.Long.ZERO,
348
+ pageToken: (0, index_js_1.isSet)(object.pageToken ?? object.page_token)
349
+ ? String(object.pageToken ?? object.page_token)
350
+ : "",
351
+ });
352
+ },
353
+ toJSON(message, use = "json") {
354
+ const obj = {};
355
+ const pick = (json, pb) => (use === "json" ? json : pb);
356
+ if (message.capacityBlockGroupId !== "") {
357
+ obj[pick("capacityBlockGroupId", "capacity_block_group_id")] = message.capacityBlockGroupId;
358
+ }
359
+ if (!message.pageSize?.isZero?.()) {
360
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_js_1.Long.ZERO).toString();
361
+ }
362
+ if (message.pageToken !== "") {
363
+ obj[pick("pageToken", "page_token")] = message.pageToken;
364
+ }
365
+ return obj;
366
+ },
367
+ create(base) {
368
+ return exports.ListCapacityAllowancesByCapacityBlockGroupRequest.fromPartial(base ?? {});
369
+ },
370
+ fromPartial(object) {
371
+ const message = createBaseListCapacityAllowancesByCapacityBlockGroupRequest();
372
+ message.capacityBlockGroupId = (object.capacityBlockGroupId !== undefined && object.capacityBlockGroupId !== null)
373
+ ? object.capacityBlockGroupId
374
+ : "";
375
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
376
+ ? index_js_1.Long.fromValue(object.pageSize)
377
+ : index_js_1.Long.ZERO;
378
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
379
+ ? object.pageToken
380
+ : "";
381
+ return message;
382
+ },
383
+ };
384
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListCapacityAllowancesByCapacityBlockGroupRequest);
385
+ function ListCapacityAllowancesByCapacityBlockGroupRequestCustomInspect() {
386
+ const parts = [];
387
+ if (this.capacityBlockGroupId !== "")
388
+ parts.push("capacityBlockGroupId" + "=" + (0, util_1.inspect)(this.capacityBlockGroupId));
389
+ if (!this.pageSize?.isZero?.())
390
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
391
+ if (this.pageToken !== "")
392
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
393
+ return `${this.$type}(${parts.join(", ")})`;
394
+ }
395
+ function ListCapacityAllowancesByCapacityBlockGroupRequestCustomJson() {
396
+ const obj = {
397
+ type: this.$type,
398
+ };
399
+ if (this.capacityBlockGroupId !== "")
400
+ obj.capacityBlockGroupId = (0, logging_js_1.inspectJson)(this.capacityBlockGroupId);
401
+ if (!this.pageSize?.isZero?.())
402
+ obj.pageSize = (0, logging_js_1.inspectJson)(this.pageSize);
403
+ if (this.pageToken !== "")
404
+ obj.pageToken = (0, logging_js_1.inspectJson)(this.pageToken);
405
+ return obj;
406
+ }
407
+ function applyListCapacityAllowancesByCapacityBlockGroupRequestCustom(message) {
408
+ message[logging_js_1.custom] = ListCapacityAllowancesByCapacityBlockGroupRequestCustomInspect;
409
+ message[logging_js_1.customJson] = ListCapacityAllowancesByCapacityBlockGroupRequestCustomJson;
410
+ return message;
411
+ }
412
+ function createBaseListCapacityAllowancesByCapacityBlockGroupRequest() {
413
+ const message = {
414
+ $type: "nebius.capacity.v1.ListCapacityAllowancesByCapacityBlockGroupRequest",
415
+ capacityBlockGroupId: "",
416
+ pageSize: index_js_1.Long.ZERO,
417
+ pageToken: "",
418
+ };
419
+ return applyListCapacityAllowancesByCapacityBlockGroupRequestCustom(message);
420
+ }
421
+ exports.GetCapacityAllowanceRequest = {
422
+ $type: "nebius.capacity.v1.GetCapacityAllowanceRequest",
423
+ encode(message, writer = new index_js_1.BinaryWriter()) {
424
+ if (message.id !== "") {
425
+ writer.uint32(10).string(message.id);
426
+ }
427
+ if (message[index_js_1.unknownFieldsSymbol]) {
428
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
429
+ }
430
+ return writer;
431
+ },
432
+ decode(input, length) {
433
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
434
+ const end = length === undefined ? reader.len : reader.pos + length;
435
+ const message = createBaseGetCapacityAllowanceRequest();
436
+ let writer = undefined;
437
+ while (reader.pos < end) {
438
+ const tag = reader.uint32();
439
+ switch (tag >>> 3) {
440
+ case 1: {
441
+ if (tag !== 10)
442
+ break;
443
+ message.id = reader.string();
444
+ continue;
445
+ }
446
+ default:
447
+ break;
448
+ }
449
+ if ((tag & 7) === 4 || tag === 0) {
450
+ break;
451
+ }
452
+ {
453
+ if (!writer)
454
+ writer = new index_js_1.BinaryWriter();
455
+ const skipped = reader.skip(tag & 7, tag >>> 3);
456
+ writer.uint32(tag).raw(skipped);
457
+ }
458
+ }
459
+ if (writer) {
460
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
461
+ }
462
+ return message;
463
+ },
464
+ fromJSON(object) {
465
+ return applyGetCapacityAllowanceRequestCustom({
466
+ $type: "nebius.capacity.v1.GetCapacityAllowanceRequest",
467
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
468
+ ? String(object.id ?? object.id)
469
+ : "",
470
+ });
471
+ },
472
+ toJSON(message, use = "json") {
473
+ const obj = {};
474
+ const pick = (json, pb) => (use === "json" ? json : pb);
475
+ if (message.id !== "") {
476
+ obj[pick("id", "id")] = message.id;
477
+ }
478
+ return obj;
479
+ },
480
+ create(base) {
481
+ return exports.GetCapacityAllowanceRequest.fromPartial(base ?? {});
482
+ },
483
+ fromPartial(object) {
484
+ const message = createBaseGetCapacityAllowanceRequest();
485
+ message.id = (object.id !== undefined && object.id !== null)
486
+ ? object.id
487
+ : "";
488
+ return message;
489
+ },
490
+ };
491
+ protobuf_js_1.protoRegistry.registerMessage(exports.GetCapacityAllowanceRequest);
492
+ function GetCapacityAllowanceRequestCustomInspect() {
493
+ const parts = [];
494
+ if (this.id !== "")
495
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
496
+ return `${this.$type}(${parts.join(", ")})`;
497
+ }
498
+ function GetCapacityAllowanceRequestCustomJson() {
499
+ const obj = {
500
+ type: this.$type,
501
+ };
502
+ if (this.id !== "")
503
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
504
+ return obj;
505
+ }
506
+ function applyGetCapacityAllowanceRequestCustom(message) {
507
+ message[logging_js_1.custom] = GetCapacityAllowanceRequestCustomInspect;
508
+ message[logging_js_1.customJson] = GetCapacityAllowanceRequestCustomJson;
509
+ return message;
510
+ }
511
+ function createBaseGetCapacityAllowanceRequest() {
512
+ const message = {
513
+ $type: "nebius.capacity.v1.GetCapacityAllowanceRequest",
514
+ id: "",
515
+ };
516
+ return applyGetCapacityAllowanceRequestCustom(message);
517
+ }
518
+ exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest = {
519
+ $type: "nebius.capacity.v1.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest",
520
+ encode(message, writer = new index_js_1.BinaryWriter()) {
521
+ if (message.parentId !== "") {
522
+ writer.uint32(10).string(message.parentId);
523
+ }
524
+ if (message.capacityBlockGroupId !== "") {
525
+ writer.uint32(18).string(message.capacityBlockGroupId);
526
+ }
527
+ if (message[index_js_1.unknownFieldsSymbol]) {
528
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
529
+ }
530
+ return writer;
531
+ },
532
+ decode(input, length) {
533
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
534
+ const end = length === undefined ? reader.len : reader.pos + length;
535
+ const message = createBaseGetCapacityAllowanceByParentAndCapacityBlockGroupRequest();
536
+ let writer = undefined;
537
+ while (reader.pos < end) {
538
+ const tag = reader.uint32();
539
+ switch (tag >>> 3) {
540
+ case 1: {
541
+ if (tag !== 10)
542
+ break;
543
+ message.parentId = reader.string();
544
+ continue;
545
+ }
546
+ case 2: {
547
+ if (tag !== 18)
548
+ break;
549
+ message.capacityBlockGroupId = reader.string();
550
+ continue;
551
+ }
552
+ default:
553
+ break;
554
+ }
555
+ if ((tag & 7) === 4 || tag === 0) {
556
+ break;
557
+ }
558
+ {
559
+ if (!writer)
560
+ writer = new index_js_1.BinaryWriter();
561
+ const skipped = reader.skip(tag & 7, tag >>> 3);
562
+ writer.uint32(tag).raw(skipped);
563
+ }
564
+ }
565
+ if (writer) {
566
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
567
+ }
568
+ return message;
569
+ },
570
+ fromJSON(object) {
571
+ return applyGetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustom({
572
+ $type: "nebius.capacity.v1.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest",
573
+ parentId: (0, index_js_1.isSet)(object.parentId ?? object.parent_id)
574
+ ? String(object.parentId ?? object.parent_id)
575
+ : "",
576
+ capacityBlockGroupId: (0, index_js_1.isSet)(object.capacityBlockGroupId ?? object.capacity_block_group_id)
577
+ ? String(object.capacityBlockGroupId ?? object.capacity_block_group_id)
578
+ : "",
579
+ });
580
+ },
581
+ toJSON(message, use = "json") {
582
+ const obj = {};
583
+ const pick = (json, pb) => (use === "json" ? json : pb);
584
+ if (message.parentId !== "") {
585
+ obj[pick("parentId", "parent_id")] = message.parentId;
586
+ }
587
+ if (message.capacityBlockGroupId !== "") {
588
+ obj[pick("capacityBlockGroupId", "capacity_block_group_id")] = message.capacityBlockGroupId;
589
+ }
590
+ return obj;
591
+ },
592
+ create(base) {
593
+ return exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest.fromPartial(base ?? {});
594
+ },
595
+ fromPartial(object) {
596
+ const message = createBaseGetCapacityAllowanceByParentAndCapacityBlockGroupRequest();
597
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
598
+ ? object.parentId
599
+ : "";
600
+ message.capacityBlockGroupId = (object.capacityBlockGroupId !== undefined && object.capacityBlockGroupId !== null)
601
+ ? object.capacityBlockGroupId
602
+ : "";
603
+ return message;
604
+ },
605
+ };
606
+ protobuf_js_1.protoRegistry.registerMessage(exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest);
607
+ function GetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustomInspect() {
608
+ const parts = [];
609
+ if (this.parentId !== "")
610
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
611
+ if (this.capacityBlockGroupId !== "")
612
+ parts.push("capacityBlockGroupId" + "=" + (0, util_1.inspect)(this.capacityBlockGroupId));
613
+ return `${this.$type}(${parts.join(", ")})`;
614
+ }
615
+ function GetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustomJson() {
616
+ const obj = {
617
+ type: this.$type,
618
+ };
619
+ if (this.parentId !== "")
620
+ obj.parentId = (0, logging_js_1.inspectJson)(this.parentId);
621
+ if (this.capacityBlockGroupId !== "")
622
+ obj.capacityBlockGroupId = (0, logging_js_1.inspectJson)(this.capacityBlockGroupId);
623
+ return obj;
624
+ }
625
+ function applyGetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustom(message) {
626
+ message[logging_js_1.custom] = GetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustomInspect;
627
+ message[logging_js_1.customJson] = GetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustomJson;
628
+ return message;
629
+ }
630
+ function createBaseGetCapacityAllowanceByParentAndCapacityBlockGroupRequest() {
631
+ const message = {
632
+ $type: "nebius.capacity.v1.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest",
633
+ parentId: "",
634
+ capacityBlockGroupId: "",
635
+ };
636
+ return applyGetCapacityAllowanceByParentAndCapacityBlockGroupRequestCustom(message);
637
+ }
638
+ exports.CreateCapacityAllowanceRequest = {
639
+ $type: "nebius.capacity.v1.CreateCapacityAllowanceRequest",
640
+ encode(message, writer = new index_js_1.BinaryWriter()) {
641
+ if (message.metadata !== undefined) {
642
+ const w = writer.uint32(10).fork();
643
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
644
+ w.join();
645
+ }
646
+ if (message.spec !== undefined) {
647
+ const w = writer.uint32(18).fork();
648
+ exports.CapacityAllowanceSpec.encode(message.spec, w);
649
+ w.join();
650
+ }
651
+ if (message[index_js_1.unknownFieldsSymbol]) {
652
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
653
+ }
654
+ return writer;
655
+ },
656
+ decode(input, length) {
657
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
658
+ const end = length === undefined ? reader.len : reader.pos + length;
659
+ const message = createBaseCreateCapacityAllowanceRequest();
660
+ let writer = undefined;
661
+ while (reader.pos < end) {
662
+ const tag = reader.uint32();
663
+ switch (tag >>> 3) {
664
+ case 1: {
665
+ if (tag !== 10)
666
+ break;
667
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
668
+ continue;
669
+ }
670
+ case 2: {
671
+ if (tag !== 18)
672
+ break;
673
+ message.spec = exports.CapacityAllowanceSpec.decode(reader, reader.uint32());
674
+ continue;
675
+ }
676
+ default:
677
+ break;
678
+ }
679
+ if ((tag & 7) === 4 || tag === 0) {
680
+ break;
681
+ }
682
+ {
683
+ if (!writer)
684
+ writer = new index_js_1.BinaryWriter();
685
+ const skipped = reader.skip(tag & 7, tag >>> 3);
686
+ writer.uint32(tag).raw(skipped);
687
+ }
688
+ }
689
+ if (writer) {
690
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
691
+ }
692
+ return message;
693
+ },
694
+ fromJSON(object) {
695
+ return applyCreateCapacityAllowanceRequestCustom({
696
+ $type: "nebius.capacity.v1.CreateCapacityAllowanceRequest",
697
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
698
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
699
+ : undefined,
700
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
701
+ ? exports.CapacityAllowanceSpec.fromJSON(object.spec ?? object.spec)
702
+ : undefined,
703
+ });
704
+ },
705
+ toJSON(message, use = "json") {
706
+ const obj = {};
707
+ const pick = (json, pb) => (use === "json" ? json : pb);
708
+ if (message.metadata !== undefined) {
709
+ obj[pick("metadata", "metadata")] = message.metadata
710
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
711
+ : undefined;
712
+ }
713
+ if (message.spec !== undefined) {
714
+ obj[pick("spec", "spec")] = message.spec
715
+ ? exports.CapacityAllowanceSpec.toJSON(message.spec, use)
716
+ : undefined;
717
+ }
718
+ return obj;
719
+ },
720
+ create(base) {
721
+ return exports.CreateCapacityAllowanceRequest.fromPartial(base ?? {});
722
+ },
723
+ fromPartial(object) {
724
+ const message = createBaseCreateCapacityAllowanceRequest();
725
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
726
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
727
+ : undefined;
728
+ message.spec = (object.spec !== undefined && object.spec !== null)
729
+ ? exports.CapacityAllowanceSpec.fromPartial(object.spec)
730
+ : undefined;
731
+ return message;
732
+ },
733
+ };
734
+ protobuf_js_1.protoRegistry.registerMessage(exports.CreateCapacityAllowanceRequest);
735
+ function CreateCapacityAllowanceRequestCustomInspect() {
736
+ const parts = [];
737
+ if (this.metadata !== undefined)
738
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
739
+ if (this.spec !== undefined)
740
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
741
+ return `${this.$type}(${parts.join(", ")})`;
742
+ }
743
+ function CreateCapacityAllowanceRequestCustomJson() {
744
+ const obj = {
745
+ type: this.$type,
746
+ };
747
+ if (this.metadata !== undefined)
748
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
749
+ if (this.spec !== undefined)
750
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
751
+ return obj;
752
+ }
753
+ function applyCreateCapacityAllowanceRequestCustom(message) {
754
+ message[logging_js_1.custom] = CreateCapacityAllowanceRequestCustomInspect;
755
+ message[logging_js_1.customJson] = CreateCapacityAllowanceRequestCustomJson;
756
+ return message;
757
+ }
758
+ function createBaseCreateCapacityAllowanceRequest() {
759
+ const message = {
760
+ $type: "nebius.capacity.v1.CreateCapacityAllowanceRequest",
761
+ metadata: undefined,
762
+ spec: undefined,
763
+ };
764
+ return applyCreateCapacityAllowanceRequestCustom(message);
765
+ }
766
+ exports.UpdateCapacityAllowanceRequest = {
767
+ $type: "nebius.capacity.v1.UpdateCapacityAllowanceRequest",
768
+ encode(message, writer = new index_js_1.BinaryWriter()) {
769
+ if (message.metadata !== undefined) {
770
+ const w = writer.uint32(10).fork();
771
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
772
+ w.join();
773
+ }
774
+ if (message.spec !== undefined) {
775
+ const w = writer.uint32(18).fork();
776
+ exports.CapacityAllowanceSpec.encode(message.spec, w);
777
+ w.join();
778
+ }
779
+ if (message[index_js_1.unknownFieldsSymbol]) {
780
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
781
+ }
782
+ return writer;
783
+ },
784
+ decode(input, length) {
785
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
786
+ const end = length === undefined ? reader.len : reader.pos + length;
787
+ const message = createBaseUpdateCapacityAllowanceRequest();
788
+ let writer = undefined;
789
+ while (reader.pos < end) {
790
+ const tag = reader.uint32();
791
+ switch (tag >>> 3) {
792
+ case 1: {
793
+ if (tag !== 10)
794
+ break;
795
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
796
+ continue;
797
+ }
798
+ case 2: {
799
+ if (tag !== 18)
800
+ break;
801
+ message.spec = exports.CapacityAllowanceSpec.decode(reader, reader.uint32());
802
+ continue;
803
+ }
804
+ default:
805
+ break;
806
+ }
807
+ if ((tag & 7) === 4 || tag === 0) {
808
+ break;
809
+ }
810
+ {
811
+ if (!writer)
812
+ writer = new index_js_1.BinaryWriter();
813
+ const skipped = reader.skip(tag & 7, tag >>> 3);
814
+ writer.uint32(tag).raw(skipped);
815
+ }
816
+ }
817
+ if (writer) {
818
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
819
+ }
820
+ return message;
821
+ },
822
+ fromJSON(object) {
823
+ return applyUpdateCapacityAllowanceRequestCustom({
824
+ $type: "nebius.capacity.v1.UpdateCapacityAllowanceRequest",
825
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
826
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
827
+ : undefined,
828
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
829
+ ? exports.CapacityAllowanceSpec.fromJSON(object.spec ?? object.spec)
830
+ : undefined,
831
+ });
832
+ },
833
+ toJSON(message, use = "json") {
834
+ const obj = {};
835
+ const pick = (json, pb) => (use === "json" ? json : pb);
836
+ if (message.metadata !== undefined) {
837
+ obj[pick("metadata", "metadata")] = message.metadata
838
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
839
+ : undefined;
840
+ }
841
+ if (message.spec !== undefined) {
842
+ obj[pick("spec", "spec")] = message.spec
843
+ ? exports.CapacityAllowanceSpec.toJSON(message.spec, use)
844
+ : undefined;
845
+ }
846
+ return obj;
847
+ },
848
+ create(base) {
849
+ return exports.UpdateCapacityAllowanceRequest.fromPartial(base ?? {});
850
+ },
851
+ fromPartial(object) {
852
+ const message = createBaseUpdateCapacityAllowanceRequest();
853
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
854
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
855
+ : undefined;
856
+ message.spec = (object.spec !== undefined && object.spec !== null)
857
+ ? exports.CapacityAllowanceSpec.fromPartial(object.spec)
858
+ : undefined;
859
+ return message;
860
+ },
861
+ };
862
+ protobuf_js_1.protoRegistry.registerMessage(exports.UpdateCapacityAllowanceRequest);
863
+ function UpdateCapacityAllowanceRequestCustomInspect() {
864
+ const parts = [];
865
+ if (this.metadata !== undefined)
866
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
867
+ if (this.spec !== undefined)
868
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
869
+ return `${this.$type}(${parts.join(", ")})`;
870
+ }
871
+ function UpdateCapacityAllowanceRequestCustomJson() {
872
+ const obj = {
873
+ type: this.$type,
874
+ };
875
+ if (this.metadata !== undefined)
876
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
877
+ if (this.spec !== undefined)
878
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
879
+ return obj;
880
+ }
881
+ function applyUpdateCapacityAllowanceRequestCustom(message) {
882
+ message[logging_js_1.custom] = UpdateCapacityAllowanceRequestCustomInspect;
883
+ message[logging_js_1.customJson] = UpdateCapacityAllowanceRequestCustomJson;
884
+ return message;
885
+ }
886
+ function createBaseUpdateCapacityAllowanceRequest() {
887
+ const message = {
888
+ $type: "nebius.capacity.v1.UpdateCapacityAllowanceRequest",
889
+ metadata: undefined,
890
+ spec: undefined,
891
+ };
892
+ return applyUpdateCapacityAllowanceRequestCustom(message);
893
+ }
894
+ exports.DeleteCapacityAllowanceRequest = {
895
+ $type: "nebius.capacity.v1.DeleteCapacityAllowanceRequest",
896
+ encode(message, writer = new index_js_1.BinaryWriter()) {
897
+ if (message.id !== "") {
898
+ writer.uint32(10).string(message.id);
899
+ }
900
+ if (message[index_js_1.unknownFieldsSymbol]) {
901
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
902
+ }
903
+ return writer;
904
+ },
905
+ decode(input, length) {
906
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
907
+ const end = length === undefined ? reader.len : reader.pos + length;
908
+ const message = createBaseDeleteCapacityAllowanceRequest();
909
+ let writer = undefined;
910
+ while (reader.pos < end) {
911
+ const tag = reader.uint32();
912
+ switch (tag >>> 3) {
913
+ case 1: {
914
+ if (tag !== 10)
915
+ break;
916
+ message.id = reader.string();
917
+ continue;
918
+ }
919
+ default:
920
+ break;
921
+ }
922
+ if ((tag & 7) === 4 || tag === 0) {
923
+ break;
924
+ }
925
+ {
926
+ if (!writer)
927
+ writer = new index_js_1.BinaryWriter();
928
+ const skipped = reader.skip(tag & 7, tag >>> 3);
929
+ writer.uint32(tag).raw(skipped);
930
+ }
931
+ }
932
+ if (writer) {
933
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
934
+ }
935
+ return message;
936
+ },
937
+ fromJSON(object) {
938
+ return applyDeleteCapacityAllowanceRequestCustom({
939
+ $type: "nebius.capacity.v1.DeleteCapacityAllowanceRequest",
940
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
941
+ ? String(object.id ?? object.id)
942
+ : "",
943
+ });
944
+ },
945
+ toJSON(message, use = "json") {
946
+ const obj = {};
947
+ const pick = (json, pb) => (use === "json" ? json : pb);
948
+ if (message.id !== "") {
949
+ obj[pick("id", "id")] = message.id;
950
+ }
951
+ return obj;
952
+ },
953
+ create(base) {
954
+ return exports.DeleteCapacityAllowanceRequest.fromPartial(base ?? {});
955
+ },
956
+ fromPartial(object) {
957
+ const message = createBaseDeleteCapacityAllowanceRequest();
958
+ message.id = (object.id !== undefined && object.id !== null)
959
+ ? object.id
960
+ : "";
961
+ return message;
962
+ },
963
+ };
964
+ protobuf_js_1.protoRegistry.registerMessage(exports.DeleteCapacityAllowanceRequest);
965
+ function DeleteCapacityAllowanceRequestCustomInspect() {
966
+ const parts = [];
967
+ if (this.id !== "")
968
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
969
+ return `${this.$type}(${parts.join(", ")})`;
970
+ }
971
+ function DeleteCapacityAllowanceRequestCustomJson() {
972
+ const obj = {
973
+ type: this.$type,
974
+ };
975
+ if (this.id !== "")
976
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
977
+ return obj;
978
+ }
979
+ function applyDeleteCapacityAllowanceRequestCustom(message) {
980
+ message[logging_js_1.custom] = DeleteCapacityAllowanceRequestCustomInspect;
981
+ message[logging_js_1.customJson] = DeleteCapacityAllowanceRequestCustomJson;
982
+ return message;
983
+ }
984
+ function createBaseDeleteCapacityAllowanceRequest() {
985
+ const message = {
986
+ $type: "nebius.capacity.v1.DeleteCapacityAllowanceRequest",
987
+ id: "",
988
+ };
989
+ return applyDeleteCapacityAllowanceRequestCustom(message);
990
+ }
991
+ exports.CapacityAllowanceServiceServiceDescription = {
992
+ list: {
993
+ path: "/nebius.capacity.v1.CapacityAllowanceService/List",
994
+ requestStream: false,
995
+ responseStream: false,
996
+ requestSerialize: (value) => Buffer.from(exports.ListCapacityAllowancesRequest.encode(value).finish()),
997
+ sendResetMask: false,
998
+ requestDeserialize: (value) => exports.ListCapacityAllowancesRequest.decode(value),
999
+ responseSerialize: (value) => Buffer.from(exports.ListCapacityAllowancesResponse.encode(value).finish()),
1000
+ responseDeserialize: (value) => exports.ListCapacityAllowancesResponse.decode(value),
1001
+ },
1002
+ listByCapacityBlockGroup: {
1003
+ path: "/nebius.capacity.v1.CapacityAllowanceService/ListByCapacityBlockGroup",
1004
+ requestStream: false,
1005
+ responseStream: false,
1006
+ requestSerialize: (value) => Buffer.from(exports.ListCapacityAllowancesByCapacityBlockGroupRequest.encode(value).finish()),
1007
+ sendResetMask: false,
1008
+ requestDeserialize: (value) => exports.ListCapacityAllowancesByCapacityBlockGroupRequest.decode(value),
1009
+ responseSerialize: (value) => Buffer.from(exports.ListCapacityAllowancesResponse.encode(value).finish()),
1010
+ responseDeserialize: (value) => exports.ListCapacityAllowancesResponse.decode(value),
1011
+ },
1012
+ get: {
1013
+ path: "/nebius.capacity.v1.CapacityAllowanceService/Get",
1014
+ requestStream: false,
1015
+ responseStream: false,
1016
+ requestSerialize: (value) => Buffer.from(exports.GetCapacityAllowanceRequest.encode(value).finish()),
1017
+ sendResetMask: false,
1018
+ requestDeserialize: (value) => exports.GetCapacityAllowanceRequest.decode(value),
1019
+ responseSerialize: (value) => Buffer.from(exports.CapacityAllowance.encode(value).finish()),
1020
+ responseDeserialize: (value) => exports.CapacityAllowance.decode(value),
1021
+ },
1022
+ getByParentAndCapacityBlockGroup: {
1023
+ path: "/nebius.capacity.v1.CapacityAllowanceService/GetByParentAndCapacityBlockGroup",
1024
+ requestStream: false,
1025
+ responseStream: false,
1026
+ requestSerialize: (value) => Buffer.from(exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest.encode(value).finish()),
1027
+ sendResetMask: false,
1028
+ requestDeserialize: (value) => exports.GetCapacityAllowanceByParentAndCapacityBlockGroupRequest.decode(value),
1029
+ responseSerialize: (value) => Buffer.from(exports.CapacityAllowance.encode(value).finish()),
1030
+ responseDeserialize: (value) => exports.CapacityAllowance.decode(value),
1031
+ },
1032
+ create: {
1033
+ path: "/nebius.capacity.v1.CapacityAllowanceService/Create",
1034
+ requestStream: false,
1035
+ responseStream: false,
1036
+ requestSerialize: (value) => Buffer.from(exports.CreateCapacityAllowanceRequest.encode(value).finish()),
1037
+ sendResetMask: false,
1038
+ requestDeserialize: (value) => exports.CreateCapacityAllowanceRequest.decode(value),
1039
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
1040
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
1041
+ },
1042
+ update: {
1043
+ path: "/nebius.capacity.v1.CapacityAllowanceService/Update",
1044
+ requestStream: false,
1045
+ responseStream: false,
1046
+ requestSerialize: (value) => Buffer.from(exports.UpdateCapacityAllowanceRequest.encode(value).finish()),
1047
+ sendResetMask: true,
1048
+ requestDeserialize: (value) => exports.UpdateCapacityAllowanceRequest.decode(value),
1049
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
1050
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
1051
+ },
1052
+ delete: {
1053
+ path: "/nebius.capacity.v1.CapacityAllowanceService/Delete",
1054
+ requestStream: false,
1055
+ responseStream: false,
1056
+ requestSerialize: (value) => Buffer.from(exports.DeleteCapacityAllowanceRequest.encode(value).finish()),
1057
+ sendResetMask: false,
1058
+ requestDeserialize: (value) => exports.DeleteCapacityAllowanceRequest.decode(value),
1059
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
1060
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
1061
+ },
1062
+ };
1063
+ exports.CapacityAllowanceServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.CapacityAllowanceServiceServiceDescription, "nebius.capacity.v1.CapacityAllowanceService");
1064
+ class CapacityAllowanceService {
1065
+ sdk;
1066
+ $type = "nebius.capacity.v1.CapacityAllowanceService";
1067
+ addr;
1068
+ spec;
1069
+ apiServiceName = "capacity-blocks.billing-cpl";
1070
+ constructor(sdk) {
1071
+ this.sdk = sdk;
1072
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
1073
+ this.addr = addr;
1074
+ this.spec = exports.CapacityAllowanceServiceServiceDescription;
1075
+ }
1076
+ getOperationService() {
1077
+ return new index_js_2.OperationService(this.sdk, this.addr);
1078
+ }
1079
+ list(...args) {
1080
+ const spec = this.spec.list;
1081
+ const request = args[0];
1082
+ const metadata = (args.length > 1 ? args[1] : undefined);
1083
+ const options = (args.length > 2 ? args[2] : undefined);
1084
+ const deserialize = spec.responseDeserialize;
1085
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1086
+ }
1087
+ listByCapacityBlockGroup(...args) {
1088
+ const spec = this.spec.listByCapacityBlockGroup;
1089
+ const request = args[0];
1090
+ const metadata = (args.length > 1 ? args[1] : undefined);
1091
+ const options = (args.length > 2 ? args[2] : undefined);
1092
+ const deserialize = spec.responseDeserialize;
1093
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1094
+ }
1095
+ get(...args) {
1096
+ const spec = this.spec.get;
1097
+ const request = args[0];
1098
+ const metadata = (args.length > 1 ? args[1] : undefined);
1099
+ const options = (args.length > 2 ? args[2] : undefined);
1100
+ const deserialize = spec.responseDeserialize;
1101
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1102
+ }
1103
+ getByParentAndCapacityBlockGroup(...args) {
1104
+ const spec = this.spec.getByParentAndCapacityBlockGroup;
1105
+ const request = args[0];
1106
+ const metadata = (args.length > 1 ? args[1] : undefined);
1107
+ const options = (args.length > 2 ? args[2] : undefined);
1108
+ const deserialize = spec.responseDeserialize;
1109
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1110
+ }
1111
+ create(...args) {
1112
+ const spec = this.spec.create;
1113
+ const request = args[0];
1114
+ const metadata = (args.length > 1 ? args[1] : undefined);
1115
+ const options = (args.length > 2 ? args[2] : undefined);
1116
+ const deserialize = (value) => {
1117
+ const resp = spec.responseDeserialize(value);
1118
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
1119
+ };
1120
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1121
+ }
1122
+ update(...args) {
1123
+ const spec = this.spec.update;
1124
+ const request = args[0];
1125
+ const metadata = (args.length > 1 ? args[1] : undefined);
1126
+ const options = (args.length > 2 ? args[2] : undefined);
1127
+ const deserialize = (value) => {
1128
+ const resp = spec.responseDeserialize(value);
1129
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
1130
+ };
1131
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1132
+ }
1133
+ delete(...args) {
1134
+ const spec = this.spec.delete;
1135
+ const request = args[0];
1136
+ const metadata = (args.length > 1 ? args[1] : undefined);
1137
+ const options = (args.length > 2 ? args[2] : undefined);
1138
+ const deserialize = (value) => {
1139
+ const resp = spec.responseDeserialize(value);
1140
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
1141
+ };
1142
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1143
+ }
1144
+ }
1145
+ exports.CapacityAllowanceService = CapacityAllowanceService;
1146
+ const CapacityAllowanceStatus_State_VALUE_COMMENTS = {
1147
+ STATE_PROVISIONING: " Capacity Allowance is being allocated; the process can take up to several minutes.\n",
1148
+ STATE_ACTIVE: " Capacity Allowance is allocated and can be used.\n",
1149
+ STATE_CONTAINER_DELETED: " The container of the Capacity Allowance is deleted. Capacity Allowance cannot be changed.\n",
1150
+ };
1151
+ exports.CapacityAllowanceStatus_State = (0, index_js_1.createEnum)("nebius.capacity.v1.CapacityAllowanceStatus.State", {
1152
+ STATE_UNSPECIFIED: 0,
1153
+ /**
1154
+ * Capacity Allowance is being allocated; the process can take up to several minutes.
1155
+ *
1156
+ */
1157
+ STATE_PROVISIONING: 1,
1158
+ /**
1159
+ * Capacity Allowance is allocated and can be used.
1160
+ *
1161
+ */
1162
+ STATE_ACTIVE: 2,
1163
+ /**
1164
+ * The container of the Capacity Allowance is deleted. Capacity Allowance cannot be changed.
1165
+ *
1166
+ */
1167
+ STATE_CONTAINER_DELETED: 100,
1168
+ }, CapacityAllowanceStatus_State_VALUE_COMMENTS);
1169
+ protobuf_js_1.protoRegistry.registerEnum(exports.CapacityAllowanceStatus_State);
1170
+ const CapacityAllowanceStatus_UsageState_VALUE_COMMENTS = {
1171
+ USAGE_STATE_USED: " Capacity allowance is actively in use.\n",
1172
+ USAGE_STATE_NOT_USED: " Capacity allowance is not currently in use.\n",
1173
+ USAGE_STATE_UNKNOWN: " Capacity allowance region is unreachable, the current usage is therefore unknown.\n Please, retry the request later.\n",
1174
+ };
1175
+ exports.CapacityAllowanceStatus_UsageState = (0, index_js_1.createEnum)("nebius.capacity.v1.CapacityAllowanceStatus.UsageState", {
1176
+ USAGE_STATE_UNSPECIFIED: 0,
1177
+ /**
1178
+ * Capacity allowance is actively in use.
1179
+ *
1180
+ */
1181
+ USAGE_STATE_USED: 1,
1182
+ /**
1183
+ * Capacity allowance is not currently in use.
1184
+ *
1185
+ */
1186
+ USAGE_STATE_NOT_USED: 2,
1187
+ /**
1188
+ * Capacity allowance region is unreachable, the current usage is therefore unknown.
1189
+ * Please, retry the request later.
1190
+ *
1191
+ */
1192
+ USAGE_STATE_UNKNOWN: 3,
1193
+ }, CapacityAllowanceStatus_UsageState_VALUE_COMMENTS);
1194
+ protobuf_js_1.protoRegistry.registerEnum(exports.CapacityAllowanceStatus_UsageState);
1195
+ exports.CapacityAllowance = {
1196
+ $type: "nebius.capacity.v1.CapacityAllowance",
1197
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1198
+ if (message.metadata !== undefined) {
1199
+ const w = writer.uint32(10).fork();
1200
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
1201
+ w.join();
1202
+ }
1203
+ if (message.spec !== undefined) {
1204
+ const w = writer.uint32(18).fork();
1205
+ exports.CapacityAllowanceSpec.encode(message.spec, w);
1206
+ w.join();
1207
+ }
1208
+ if (message.status !== undefined) {
1209
+ const w = writer.uint32(26).fork();
1210
+ exports.CapacityAllowanceStatus.encode(message.status, w);
1211
+ w.join();
1212
+ }
1213
+ if (message[index_js_1.unknownFieldsSymbol]) {
1214
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1215
+ }
1216
+ return writer;
1217
+ },
1218
+ decode(input, length) {
1219
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1220
+ const end = length === undefined ? reader.len : reader.pos + length;
1221
+ const message = createBaseCapacityAllowance();
1222
+ let writer = undefined;
1223
+ while (reader.pos < end) {
1224
+ const tag = reader.uint32();
1225
+ switch (tag >>> 3) {
1226
+ case 1: {
1227
+ if (tag !== 10)
1228
+ break;
1229
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
1230
+ continue;
1231
+ }
1232
+ case 2: {
1233
+ if (tag !== 18)
1234
+ break;
1235
+ message.spec = exports.CapacityAllowanceSpec.decode(reader, reader.uint32());
1236
+ continue;
1237
+ }
1238
+ case 3: {
1239
+ if (tag !== 26)
1240
+ break;
1241
+ message.status = exports.CapacityAllowanceStatus.decode(reader, reader.uint32());
1242
+ continue;
1243
+ }
1244
+ default:
1245
+ break;
1246
+ }
1247
+ if ((tag & 7) === 4 || tag === 0) {
1248
+ break;
1249
+ }
1250
+ {
1251
+ if (!writer)
1252
+ writer = new index_js_1.BinaryWriter();
1253
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1254
+ writer.uint32(tag).raw(skipped);
1255
+ }
1256
+ }
1257
+ if (writer) {
1258
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1259
+ }
1260
+ return message;
1261
+ },
1262
+ fromJSON(object) {
1263
+ return applyCapacityAllowanceCustom({
1264
+ $type: "nebius.capacity.v1.CapacityAllowance",
1265
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
1266
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
1267
+ : undefined,
1268
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
1269
+ ? exports.CapacityAllowanceSpec.fromJSON(object.spec ?? object.spec)
1270
+ : undefined,
1271
+ status: (0, index_js_1.isSet)(object.status ?? object.status)
1272
+ ? exports.CapacityAllowanceStatus.fromJSON(object.status ?? object.status)
1273
+ : undefined,
1274
+ });
1275
+ },
1276
+ toJSON(message, use = "json") {
1277
+ const obj = {};
1278
+ const pick = (json, pb) => (use === "json" ? json : pb);
1279
+ if (message.metadata !== undefined) {
1280
+ obj[pick("metadata", "metadata")] = message.metadata
1281
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
1282
+ : undefined;
1283
+ }
1284
+ if (message.spec !== undefined) {
1285
+ obj[pick("spec", "spec")] = message.spec
1286
+ ? exports.CapacityAllowanceSpec.toJSON(message.spec, use)
1287
+ : undefined;
1288
+ }
1289
+ if (message.status !== undefined) {
1290
+ obj[pick("status", "status")] = message.status
1291
+ ? exports.CapacityAllowanceStatus.toJSON(message.status, use)
1292
+ : undefined;
1293
+ }
1294
+ return obj;
1295
+ },
1296
+ create(base) {
1297
+ return exports.CapacityAllowance.fromPartial(base ?? {});
1298
+ },
1299
+ fromPartial(object) {
1300
+ const message = createBaseCapacityAllowance();
1301
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
1302
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
1303
+ : undefined;
1304
+ message.spec = (object.spec !== undefined && object.spec !== null)
1305
+ ? exports.CapacityAllowanceSpec.fromPartial(object.spec)
1306
+ : undefined;
1307
+ message.status = (object.status !== undefined && object.status !== null)
1308
+ ? exports.CapacityAllowanceStatus.fromPartial(object.status)
1309
+ : undefined;
1310
+ return message;
1311
+ },
1312
+ };
1313
+ protobuf_js_1.protoRegistry.registerMessage(exports.CapacityAllowance);
1314
+ function CapacityAllowanceCustomInspect() {
1315
+ const parts = [];
1316
+ if (this.metadata !== undefined)
1317
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
1318
+ if (this.spec !== undefined)
1319
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
1320
+ if (this.status !== undefined)
1321
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
1322
+ return `${this.$type}(${parts.join(", ")})`;
1323
+ }
1324
+ function CapacityAllowanceCustomJson() {
1325
+ const obj = {
1326
+ type: this.$type,
1327
+ };
1328
+ if (this.metadata !== undefined)
1329
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
1330
+ if (this.spec !== undefined)
1331
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
1332
+ if (this.status !== undefined)
1333
+ obj.status = (0, logging_js_1.inspectJson)(this.status);
1334
+ return obj;
1335
+ }
1336
+ function applyCapacityAllowanceCustom(message) {
1337
+ message[logging_js_1.custom] = CapacityAllowanceCustomInspect;
1338
+ message[logging_js_1.customJson] = CapacityAllowanceCustomJson;
1339
+ return message;
1340
+ }
1341
+ function createBaseCapacityAllowance() {
1342
+ const message = {
1343
+ $type: "nebius.capacity.v1.CapacityAllowance",
1344
+ metadata: undefined,
1345
+ spec: undefined,
1346
+ status: undefined,
1347
+ };
1348
+ return applyCapacityAllowanceCustom(message);
1349
+ }
1350
+ exports.CapacityAllowanceSpec = {
1351
+ $type: "nebius.capacity.v1.CapacityAllowanceSpec",
1352
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1353
+ if (message.capacityBlockGroupId !== "") {
1354
+ writer.uint32(10).string(message.capacityBlockGroupId);
1355
+ }
1356
+ if (message.limit !== undefined) {
1357
+ writer.uint32(16).uint64(message.limit.toString());
1358
+ }
1359
+ if (message[index_js_1.unknownFieldsSymbol]) {
1360
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1361
+ }
1362
+ return writer;
1363
+ },
1364
+ decode(input, length) {
1365
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1366
+ const end = length === undefined ? reader.len : reader.pos + length;
1367
+ const message = createBaseCapacityAllowanceSpec();
1368
+ let writer = undefined;
1369
+ while (reader.pos < end) {
1370
+ const tag = reader.uint32();
1371
+ switch (tag >>> 3) {
1372
+ case 1: {
1373
+ if (tag !== 10)
1374
+ break;
1375
+ message.capacityBlockGroupId = reader.string();
1376
+ continue;
1377
+ }
1378
+ case 2: {
1379
+ if (tag !== 16)
1380
+ break;
1381
+ message.limit = index_js_1.Long.fromValue(reader.uint64());
1382
+ continue;
1383
+ }
1384
+ default:
1385
+ break;
1386
+ }
1387
+ if ((tag & 7) === 4 || tag === 0) {
1388
+ break;
1389
+ }
1390
+ {
1391
+ if (!writer)
1392
+ writer = new index_js_1.BinaryWriter();
1393
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1394
+ writer.uint32(tag).raw(skipped);
1395
+ }
1396
+ }
1397
+ if (writer) {
1398
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1399
+ }
1400
+ return message;
1401
+ },
1402
+ fromJSON(object) {
1403
+ return applyCapacityAllowanceSpecCustom({
1404
+ $type: "nebius.capacity.v1.CapacityAllowanceSpec",
1405
+ capacityBlockGroupId: (0, index_js_1.isSet)(object.capacityBlockGroupId ?? object.capacity_block_group_id)
1406
+ ? String(object.capacityBlockGroupId ?? object.capacity_block_group_id)
1407
+ : "",
1408
+ limit: (0, index_js_1.isSet)(object.limit ?? object.limit)
1409
+ ? index_js_1.Long.fromValue(object.limit ?? object.limit)
1410
+ : undefined,
1411
+ });
1412
+ },
1413
+ toJSON(message, use = "json") {
1414
+ const obj = {};
1415
+ const pick = (json, pb) => (use === "json" ? json : pb);
1416
+ if (message.capacityBlockGroupId !== "") {
1417
+ obj[pick("capacityBlockGroupId", "capacity_block_group_id")] = message.capacityBlockGroupId;
1418
+ }
1419
+ if (message.limit !== undefined) {
1420
+ obj[pick("limit", "limit")] = (message.limit || index_js_1.Long.ZERO).toString();
1421
+ }
1422
+ return obj;
1423
+ },
1424
+ create(base) {
1425
+ return exports.CapacityAllowanceSpec.fromPartial(base ?? {});
1426
+ },
1427
+ fromPartial(object) {
1428
+ const message = createBaseCapacityAllowanceSpec();
1429
+ message.capacityBlockGroupId = (object.capacityBlockGroupId !== undefined && object.capacityBlockGroupId !== null)
1430
+ ? object.capacityBlockGroupId
1431
+ : "";
1432
+ message.limit = (object.limit !== undefined && object.limit !== null)
1433
+ ? index_js_1.Long.fromValue(object.limit)
1434
+ : undefined;
1435
+ return message;
1436
+ },
1437
+ };
1438
+ protobuf_js_1.protoRegistry.registerMessage(exports.CapacityAllowanceSpec);
1439
+ function CapacityAllowanceSpecCustomInspect() {
1440
+ const parts = [];
1441
+ if (this.capacityBlockGroupId !== "")
1442
+ parts.push("capacityBlockGroupId" + "=" + (0, util_1.inspect)(this.capacityBlockGroupId));
1443
+ if (this.limit !== undefined)
1444
+ parts.push("limit" + "=" + (0, util_1.inspect)(this.limit));
1445
+ return `${this.$type}(${parts.join(", ")})`;
1446
+ }
1447
+ function CapacityAllowanceSpecCustomJson() {
1448
+ const obj = {
1449
+ type: this.$type,
1450
+ };
1451
+ if (this.capacityBlockGroupId !== "")
1452
+ obj.capacityBlockGroupId = (0, logging_js_1.inspectJson)(this.capacityBlockGroupId);
1453
+ if (this.limit !== undefined)
1454
+ obj.limit = (0, logging_js_1.inspectJson)(this.limit);
1455
+ return obj;
1456
+ }
1457
+ function applyCapacityAllowanceSpecCustom(message) {
1458
+ message[logging_js_1.custom] = CapacityAllowanceSpecCustomInspect;
1459
+ message[logging_js_1.customJson] = CapacityAllowanceSpecCustomJson;
1460
+ return message;
1461
+ }
1462
+ function createBaseCapacityAllowanceSpec() {
1463
+ const message = {
1464
+ $type: "nebius.capacity.v1.CapacityAllowanceSpec",
1465
+ capacityBlockGroupId: "",
1466
+ limit: undefined,
1467
+ };
1468
+ return applyCapacityAllowanceSpecCustom(message);
1469
+ }
1470
+ exports.CapacityAllowanceStatus = {
1471
+ $type: "nebius.capacity.v1.CapacityAllowanceStatus",
1472
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1473
+ if ((message.state ?? exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED) !== exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED) {
1474
+ exports.CapacityAllowanceStatus_State.encodeField(writer, 1, message.state);
1475
+ }
1476
+ if (message.usage !== undefined && !message.usage.isZero?.()) {
1477
+ writer.uint32(16).uint64(message.usage.toString());
1478
+ }
1479
+ if (message.usagePercentage !== "") {
1480
+ writer.uint32(26).string(message.usagePercentage);
1481
+ }
1482
+ if ((message.usageState ?? exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED) !== exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED) {
1483
+ exports.CapacityAllowanceStatus_UsageState.encodeField(writer, 4, message.usageState);
1484
+ }
1485
+ if (message.unit !== "") {
1486
+ writer.uint32(42).string(message.unit);
1487
+ }
1488
+ if (message.reconciling === true) {
1489
+ writer.uint32(800).bool(message.reconciling);
1490
+ }
1491
+ if (message[index_js_1.unknownFieldsSymbol]) {
1492
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1493
+ }
1494
+ return writer;
1495
+ },
1496
+ decode(input, length) {
1497
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1498
+ const end = length === undefined ? reader.len : reader.pos + length;
1499
+ const message = createBaseCapacityAllowanceStatus();
1500
+ let writer = undefined;
1501
+ while (reader.pos < end) {
1502
+ const tag = reader.uint32();
1503
+ switch (tag >>> 3) {
1504
+ case 1: {
1505
+ if (tag !== 8)
1506
+ break;
1507
+ message.state = exports.CapacityAllowanceStatus_State.fromNumber(reader.int32());
1508
+ continue;
1509
+ }
1510
+ case 2: {
1511
+ if (tag !== 16)
1512
+ break;
1513
+ message.usage = index_js_1.Long.fromValue(reader.uint64());
1514
+ continue;
1515
+ }
1516
+ case 3: {
1517
+ if (tag !== 26)
1518
+ break;
1519
+ message.usagePercentage = reader.string();
1520
+ continue;
1521
+ }
1522
+ case 4: {
1523
+ if (tag !== 32)
1524
+ break;
1525
+ message.usageState = exports.CapacityAllowanceStatus_UsageState.fromNumber(reader.int32());
1526
+ continue;
1527
+ }
1528
+ case 5: {
1529
+ if (tag !== 42)
1530
+ break;
1531
+ message.unit = reader.string();
1532
+ continue;
1533
+ }
1534
+ case 100: {
1535
+ if (tag !== 800)
1536
+ break;
1537
+ message.reconciling = reader.bool();
1538
+ continue;
1539
+ }
1540
+ default:
1541
+ break;
1542
+ }
1543
+ if ((tag & 7) === 4 || tag === 0) {
1544
+ break;
1545
+ }
1546
+ {
1547
+ if (!writer)
1548
+ writer = new index_js_1.BinaryWriter();
1549
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1550
+ writer.uint32(tag).raw(skipped);
1551
+ }
1552
+ }
1553
+ if (writer) {
1554
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1555
+ }
1556
+ return message;
1557
+ },
1558
+ fromJSON(object) {
1559
+ return applyCapacityAllowanceStatusCustom({
1560
+ $type: "nebius.capacity.v1.CapacityAllowanceStatus",
1561
+ state: (0, index_js_1.isSet)(object.state ?? object.state)
1562
+ ? exports.CapacityAllowanceStatus_State.fromJSON(object.state ?? object.state)
1563
+ : exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED,
1564
+ usage: (0, index_js_1.isSet)(object.usage ?? object.usage)
1565
+ ? index_js_1.Long.fromValue(object.usage ?? object.usage)
1566
+ : index_js_1.Long.ZERO,
1567
+ usagePercentage: (0, index_js_1.isSet)(object.usagePercentage ?? object.usage_percentage)
1568
+ ? String(object.usagePercentage ?? object.usage_percentage)
1569
+ : "",
1570
+ usageState: (0, index_js_1.isSet)(object.usageState ?? object.usage_state)
1571
+ ? exports.CapacityAllowanceStatus_UsageState.fromJSON(object.usageState ?? object.usage_state)
1572
+ : exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED,
1573
+ unit: (0, index_js_1.isSet)(object.unit ?? object.unit)
1574
+ ? String(object.unit ?? object.unit)
1575
+ : "",
1576
+ reconciling: (0, index_js_1.isSet)(object.reconciling ?? object.reconciling)
1577
+ ? Boolean(object.reconciling ?? object.reconciling)
1578
+ : false,
1579
+ });
1580
+ },
1581
+ toJSON(message, use = "json") {
1582
+ const obj = {};
1583
+ const pick = (json, pb) => (use === "json" ? json : pb);
1584
+ if ((message.state ?? exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED) !== exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED) {
1585
+ obj[pick("state", "state")] = exports.CapacityAllowanceStatus_State.toJSON(message.state);
1586
+ }
1587
+ if (!message.usage?.isZero?.()) {
1588
+ obj[pick("usage", "usage")] = (message.usage || index_js_1.Long.ZERO).toString();
1589
+ }
1590
+ if (message.usagePercentage !== "") {
1591
+ obj[pick("usagePercentage", "usage_percentage")] = message.usagePercentage;
1592
+ }
1593
+ if ((message.usageState ?? exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED) !== exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED) {
1594
+ obj[pick("usageState", "usage_state")] = exports.CapacityAllowanceStatus_UsageState.toJSON(message.usageState);
1595
+ }
1596
+ if (message.unit !== "") {
1597
+ obj[pick("unit", "unit")] = message.unit;
1598
+ }
1599
+ if (message.reconciling === true) {
1600
+ obj[pick("reconciling", "reconciling")] = message.reconciling;
1601
+ }
1602
+ return obj;
1603
+ },
1604
+ create(base) {
1605
+ return exports.CapacityAllowanceStatus.fromPartial(base ?? {});
1606
+ },
1607
+ fromPartial(object) {
1608
+ const message = createBaseCapacityAllowanceStatus();
1609
+ message.state = (object.state !== undefined && object.state !== null)
1610
+ ? exports.CapacityAllowanceStatus_State.fromJSON(object.state.name)
1611
+ : exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED;
1612
+ message.usage = (object.usage !== undefined && object.usage !== null)
1613
+ ? index_js_1.Long.fromValue(object.usage)
1614
+ : index_js_1.Long.ZERO;
1615
+ message.usagePercentage = (object.usagePercentage !== undefined && object.usagePercentage !== null)
1616
+ ? object.usagePercentage
1617
+ : "";
1618
+ message.usageState = (object.usageState !== undefined && object.usageState !== null)
1619
+ ? exports.CapacityAllowanceStatus_UsageState.fromJSON(object.usageState.name)
1620
+ : exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED;
1621
+ message.unit = (object.unit !== undefined && object.unit !== null)
1622
+ ? object.unit
1623
+ : "";
1624
+ message.reconciling = (object.reconciling !== undefined && object.reconciling !== null)
1625
+ ? object.reconciling
1626
+ : false;
1627
+ return message;
1628
+ },
1629
+ };
1630
+ protobuf_js_1.protoRegistry.registerMessage(exports.CapacityAllowanceStatus);
1631
+ function CapacityAllowanceStatusCustomInspect() {
1632
+ const parts = [];
1633
+ if (this.state !== undefined)
1634
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
1635
+ if (!this.usage?.isZero?.())
1636
+ parts.push("usage" + "=" + (0, util_1.inspect)(this.usage));
1637
+ if (this.usagePercentage !== "")
1638
+ parts.push("usagePercentage" + "=" + (0, util_1.inspect)(this.usagePercentage));
1639
+ if (this.usageState !== undefined)
1640
+ parts.push("usageState" + "=" + (0, util_1.inspect)(this.usageState));
1641
+ if (this.unit !== "")
1642
+ parts.push("unit" + "=" + (0, util_1.inspect)(this.unit));
1643
+ if (this.reconciling === true)
1644
+ parts.push("reconciling" + "=" + (0, util_1.inspect)(this.reconciling));
1645
+ return `${this.$type}(${parts.join(", ")})`;
1646
+ }
1647
+ function CapacityAllowanceStatusCustomJson() {
1648
+ const obj = {
1649
+ type: this.$type,
1650
+ };
1651
+ if (this.state !== undefined)
1652
+ obj.state = (0, logging_js_1.inspectJson)(this.state);
1653
+ if (!this.usage?.isZero?.())
1654
+ obj.usage = (0, logging_js_1.inspectJson)(this.usage);
1655
+ if (this.usagePercentage !== "")
1656
+ obj.usagePercentage = (0, logging_js_1.inspectJson)(this.usagePercentage);
1657
+ if (this.usageState !== undefined)
1658
+ obj.usageState = (0, logging_js_1.inspectJson)(this.usageState);
1659
+ if (this.unit !== "")
1660
+ obj.unit = (0, logging_js_1.inspectJson)(this.unit);
1661
+ if (this.reconciling === true)
1662
+ obj.reconciling = (0, logging_js_1.inspectJson)(this.reconciling);
1663
+ return obj;
1664
+ }
1665
+ function applyCapacityAllowanceStatusCustom(message) {
1666
+ message[logging_js_1.custom] = CapacityAllowanceStatusCustomInspect;
1667
+ message[logging_js_1.customJson] = CapacityAllowanceStatusCustomJson;
1668
+ return message;
1669
+ }
1670
+ function createBaseCapacityAllowanceStatus() {
1671
+ const message = {
1672
+ $type: "nebius.capacity.v1.CapacityAllowanceStatus",
1673
+ state: exports.CapacityAllowanceStatus_State.STATE_UNSPECIFIED,
1674
+ usage: index_js_1.Long.ZERO,
1675
+ usagePercentage: "",
1676
+ usageState: exports.CapacityAllowanceStatus_UsageState.USAGE_STATE_UNSPECIFIED,
1677
+ unit: "",
1678
+ reconciling: false,
1679
+ };
1680
+ return applyCapacityAllowanceStatusCustom(message);
1681
+ }
13
1682
  exports.GetCapacityBlockGroupRequest = {
14
1683
  $type: "nebius.capacity.v1.GetCapacityBlockGroupRequest",
15
1684
  encode(message, writer = new index_js_1.BinaryWriter()) {