@nebius/js-sdk 0.1.26 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2647 @@
1
+ "use strict";
2
+ /* Generated by Nebius TS generator. DO NOT EDIT! */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ResourceAffinity = exports.ResourceAffinityComputeV1 = 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.ListCapacityBlockGroupsResponse = exports.ListCapacityBlockGroupsRequest = exports.GetCapacityBlockGroupByResourceAffinityRequest = exports.GetCapacityBlockGroupRequest = void 0;
5
+ const index_1 = require("../../../../runtime/protos/index");
6
+ const util_1 = require("util");
7
+ const protobuf_1 = require("../../../protobuf");
8
+ const logging_1 = require("../../../../runtime/util/logging");
9
+ const grpc_js_1 = require("@grpc/grpc-js");
10
+ const request_1 = require("../../../../runtime/request");
11
+ const v1_1 = require("../../common/v1");
12
+ const __deprecatedWarned = new Set();
13
+ exports.GetCapacityBlockGroupRequest = {
14
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupRequest",
15
+ encode(message, writer = new index_1.BinaryWriter()) {
16
+ if (message.id !== "") {
17
+ writer.uint32(10).string(message.id);
18
+ }
19
+ if (message[index_1.unknownFieldsSymbol]) {
20
+ writer.raw(message[index_1.unknownFieldsSymbol]);
21
+ }
22
+ return writer;
23
+ },
24
+ decode(input, length) {
25
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
26
+ const end = length === undefined ? reader.len : reader.pos + length;
27
+ const message = createBaseGetCapacityBlockGroupRequest();
28
+ let writer = undefined;
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1: {
33
+ if (tag !== 10)
34
+ break;
35
+ message.id = reader.string();
36
+ continue;
37
+ }
38
+ default:
39
+ break;
40
+ }
41
+ if ((tag & 7) === 4 || tag === 0) {
42
+ break;
43
+ }
44
+ {
45
+ if (!writer)
46
+ writer = new index_1.BinaryWriter();
47
+ const skipped = reader.skip(tag & 7, tag >>> 3);
48
+ writer.uint32(tag).raw(skipped);
49
+ }
50
+ }
51
+ if (writer) {
52
+ message[index_1.unknownFieldsSymbol] = writer.finish();
53
+ }
54
+ return message;
55
+ },
56
+ fromJSON(object) {
57
+ return applyGetCapacityBlockGroupRequestCustom({
58
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupRequest",
59
+ id: (0, index_1.isSet)(object.id ?? object.id)
60
+ ? String(object.id ?? object.id)
61
+ : "",
62
+ });
63
+ },
64
+ toJSON(message, use = "json") {
65
+ const obj = {};
66
+ const pick = (json, pb) => (use === "json" ? json : pb);
67
+ if (message.id !== "") {
68
+ obj[pick("id", "id")] = message.id;
69
+ }
70
+ return obj;
71
+ },
72
+ create(base) {
73
+ return exports.GetCapacityBlockGroupRequest.fromPartial(base ?? {});
74
+ },
75
+ fromPartial(object) {
76
+ const message = createBaseGetCapacityBlockGroupRequest();
77
+ message.id = (object.id !== undefined && object.id !== null)
78
+ ? object.id
79
+ : "";
80
+ return message;
81
+ },
82
+ };
83
+ protobuf_1.protoRegistry.registerMessage(exports.GetCapacityBlockGroupRequest);
84
+ function GetCapacityBlockGroupRequestCustomInspect() {
85
+ const parts = [];
86
+ if (this.id !== "")
87
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
88
+ return `${this.$type}(${parts.join(", ")})`;
89
+ }
90
+ function GetCapacityBlockGroupRequestCustomJson() {
91
+ const obj = {
92
+ type: this.$type,
93
+ };
94
+ if (this.id !== "")
95
+ obj.id = (0, logging_1.inspectJson)(this.id);
96
+ return obj;
97
+ }
98
+ function applyGetCapacityBlockGroupRequestCustom(message) {
99
+ message[logging_1.custom] = GetCapacityBlockGroupRequestCustomInspect;
100
+ message[logging_1.customJson] = GetCapacityBlockGroupRequestCustomJson;
101
+ return message;
102
+ }
103
+ function createBaseGetCapacityBlockGroupRequest() {
104
+ const message = {
105
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupRequest",
106
+ id: "",
107
+ };
108
+ return applyGetCapacityBlockGroupRequestCustom(message);
109
+ }
110
+ exports.GetCapacityBlockGroupByResourceAffinityRequest = {
111
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupByResourceAffinityRequest",
112
+ encode(message, writer = new index_1.BinaryWriter()) {
113
+ if (message.parentId !== "") {
114
+ writer.uint32(10).string(message.parentId);
115
+ }
116
+ if (message.region !== "") {
117
+ writer.uint32(18).string(message.region);
118
+ }
119
+ if (message.resourceAffinity !== undefined) {
120
+ const w = writer.uint32(26).fork();
121
+ exports.ResourceAffinity.encode(message.resourceAffinity, w);
122
+ w.join();
123
+ }
124
+ if (message[index_1.unknownFieldsSymbol]) {
125
+ writer.raw(message[index_1.unknownFieldsSymbol]);
126
+ }
127
+ return writer;
128
+ },
129
+ decode(input, length) {
130
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
131
+ const end = length === undefined ? reader.len : reader.pos + length;
132
+ const message = createBaseGetCapacityBlockGroupByResourceAffinityRequest();
133
+ let writer = undefined;
134
+ while (reader.pos < end) {
135
+ const tag = reader.uint32();
136
+ switch (tag >>> 3) {
137
+ case 1: {
138
+ if (tag !== 10)
139
+ break;
140
+ message.parentId = reader.string();
141
+ continue;
142
+ }
143
+ case 2: {
144
+ if (tag !== 18)
145
+ break;
146
+ message.region = reader.string();
147
+ continue;
148
+ }
149
+ case 3: {
150
+ if (tag !== 26)
151
+ break;
152
+ message.resourceAffinity = exports.ResourceAffinity.decode(reader, reader.uint32());
153
+ continue;
154
+ }
155
+ default:
156
+ break;
157
+ }
158
+ if ((tag & 7) === 4 || tag === 0) {
159
+ break;
160
+ }
161
+ {
162
+ if (!writer)
163
+ writer = new index_1.BinaryWriter();
164
+ const skipped = reader.skip(tag & 7, tag >>> 3);
165
+ writer.uint32(tag).raw(skipped);
166
+ }
167
+ }
168
+ if (writer) {
169
+ message[index_1.unknownFieldsSymbol] = writer.finish();
170
+ }
171
+ return message;
172
+ },
173
+ fromJSON(object) {
174
+ return applyGetCapacityBlockGroupByResourceAffinityRequestCustom({
175
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupByResourceAffinityRequest",
176
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
177
+ ? String(object.parentId ?? object.parent_id)
178
+ : "",
179
+ region: (0, index_1.isSet)(object.region ?? object.region)
180
+ ? String(object.region ?? object.region)
181
+ : "",
182
+ resourceAffinity: (0, index_1.isSet)(object.resourceAffinity ?? object.resource_affinity)
183
+ ? exports.ResourceAffinity.fromJSON(object.resourceAffinity ?? object.resource_affinity)
184
+ : undefined,
185
+ });
186
+ },
187
+ toJSON(message, use = "json") {
188
+ const obj = {};
189
+ const pick = (json, pb) => (use === "json" ? json : pb);
190
+ if (message.parentId !== "") {
191
+ obj[pick("parentId", "parent_id")] = message.parentId;
192
+ }
193
+ if (message.region !== "") {
194
+ obj[pick("region", "region")] = message.region;
195
+ }
196
+ if (message.resourceAffinity !== undefined) {
197
+ obj[pick("resourceAffinity", "resource_affinity")] = message.resourceAffinity
198
+ ? exports.ResourceAffinity.toJSON(message.resourceAffinity, use)
199
+ : undefined;
200
+ }
201
+ return obj;
202
+ },
203
+ create(base) {
204
+ return exports.GetCapacityBlockGroupByResourceAffinityRequest.fromPartial(base ?? {});
205
+ },
206
+ fromPartial(object) {
207
+ const message = createBaseGetCapacityBlockGroupByResourceAffinityRequest();
208
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
209
+ ? object.parentId
210
+ : "";
211
+ message.region = (object.region !== undefined && object.region !== null)
212
+ ? object.region
213
+ : "";
214
+ message.resourceAffinity = (object.resourceAffinity !== undefined && object.resourceAffinity !== null)
215
+ ? exports.ResourceAffinity.fromPartial(object.resourceAffinity)
216
+ : undefined;
217
+ return message;
218
+ },
219
+ };
220
+ protobuf_1.protoRegistry.registerMessage(exports.GetCapacityBlockGroupByResourceAffinityRequest);
221
+ function GetCapacityBlockGroupByResourceAffinityRequestCustomInspect() {
222
+ const parts = [];
223
+ if (this.parentId !== "")
224
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
225
+ if (this.region !== "")
226
+ parts.push("region" + "=" + (0, util_1.inspect)(this.region));
227
+ if (this.resourceAffinity !== undefined)
228
+ parts.push("resourceAffinity" + "=" + (0, util_1.inspect)(this.resourceAffinity));
229
+ return `${this.$type}(${parts.join(", ")})`;
230
+ }
231
+ function GetCapacityBlockGroupByResourceAffinityRequestCustomJson() {
232
+ const obj = {
233
+ type: this.$type,
234
+ };
235
+ if (this.parentId !== "")
236
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
237
+ if (this.region !== "")
238
+ obj.region = (0, logging_1.inspectJson)(this.region);
239
+ if (this.resourceAffinity !== undefined)
240
+ obj.resourceAffinity = (0, logging_1.inspectJson)(this.resourceAffinity);
241
+ return obj;
242
+ }
243
+ function applyGetCapacityBlockGroupByResourceAffinityRequestCustom(message) {
244
+ message[logging_1.custom] = GetCapacityBlockGroupByResourceAffinityRequestCustomInspect;
245
+ message[logging_1.customJson] = GetCapacityBlockGroupByResourceAffinityRequestCustomJson;
246
+ return message;
247
+ }
248
+ function createBaseGetCapacityBlockGroupByResourceAffinityRequest() {
249
+ const message = {
250
+ $type: "nebius.capacity.v1.GetCapacityBlockGroupByResourceAffinityRequest",
251
+ parentId: "",
252
+ region: "",
253
+ resourceAffinity: undefined,
254
+ };
255
+ return applyGetCapacityBlockGroupByResourceAffinityRequestCustom(message);
256
+ }
257
+ exports.ListCapacityBlockGroupsRequest = {
258
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsRequest",
259
+ encode(message, writer = new index_1.BinaryWriter()) {
260
+ if (message.parentId !== "") {
261
+ writer.uint32(10).string(message.parentId);
262
+ }
263
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
264
+ writer.uint32(16).int64(message.pageSize.toString());
265
+ }
266
+ if (message.pageToken !== "") {
267
+ writer.uint32(26).string(message.pageToken);
268
+ }
269
+ if (message[index_1.unknownFieldsSymbol]) {
270
+ writer.raw(message[index_1.unknownFieldsSymbol]);
271
+ }
272
+ return writer;
273
+ },
274
+ decode(input, length) {
275
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
276
+ const end = length === undefined ? reader.len : reader.pos + length;
277
+ const message = createBaseListCapacityBlockGroupsRequest();
278
+ let writer = undefined;
279
+ while (reader.pos < end) {
280
+ const tag = reader.uint32();
281
+ switch (tag >>> 3) {
282
+ case 1: {
283
+ if (tag !== 10)
284
+ break;
285
+ message.parentId = reader.string();
286
+ continue;
287
+ }
288
+ case 2: {
289
+ if (tag !== 16)
290
+ break;
291
+ message.pageSize = index_1.Long.fromValue(reader.int64());
292
+ continue;
293
+ }
294
+ case 3: {
295
+ if (tag !== 26)
296
+ break;
297
+ message.pageToken = reader.string();
298
+ continue;
299
+ }
300
+ default:
301
+ break;
302
+ }
303
+ if ((tag & 7) === 4 || tag === 0) {
304
+ break;
305
+ }
306
+ {
307
+ if (!writer)
308
+ writer = new index_1.BinaryWriter();
309
+ const skipped = reader.skip(tag & 7, tag >>> 3);
310
+ writer.uint32(tag).raw(skipped);
311
+ }
312
+ }
313
+ if (writer) {
314
+ message[index_1.unknownFieldsSymbol] = writer.finish();
315
+ }
316
+ return message;
317
+ },
318
+ fromJSON(object) {
319
+ return applyListCapacityBlockGroupsRequestCustom({
320
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsRequest",
321
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
322
+ ? String(object.parentId ?? object.parent_id)
323
+ : "",
324
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
325
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
326
+ : index_1.Long.ZERO,
327
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
328
+ ? String(object.pageToken ?? object.page_token)
329
+ : "",
330
+ });
331
+ },
332
+ toJSON(message, use = "json") {
333
+ const obj = {};
334
+ const pick = (json, pb) => (use === "json" ? json : pb);
335
+ if (message.parentId !== "") {
336
+ obj[pick("parentId", "parent_id")] = message.parentId;
337
+ }
338
+ if (!message.pageSize?.isZero?.()) {
339
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
340
+ }
341
+ if (message.pageToken !== "") {
342
+ obj[pick("pageToken", "page_token")] = message.pageToken;
343
+ }
344
+ return obj;
345
+ },
346
+ create(base) {
347
+ return exports.ListCapacityBlockGroupsRequest.fromPartial(base ?? {});
348
+ },
349
+ fromPartial(object) {
350
+ const message = createBaseListCapacityBlockGroupsRequest();
351
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
352
+ ? object.parentId
353
+ : "";
354
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
355
+ ? index_1.Long.fromValue(object.pageSize)
356
+ : index_1.Long.ZERO;
357
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
358
+ ? object.pageToken
359
+ : "";
360
+ return message;
361
+ },
362
+ };
363
+ protobuf_1.protoRegistry.registerMessage(exports.ListCapacityBlockGroupsRequest);
364
+ function ListCapacityBlockGroupsRequestCustomInspect() {
365
+ const parts = [];
366
+ if (this.parentId !== "")
367
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
368
+ if (!this.pageSize?.isZero?.())
369
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
370
+ if (this.pageToken !== "")
371
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
372
+ return `${this.$type}(${parts.join(", ")})`;
373
+ }
374
+ function ListCapacityBlockGroupsRequestCustomJson() {
375
+ const obj = {
376
+ type: this.$type,
377
+ };
378
+ if (this.parentId !== "")
379
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
380
+ if (!this.pageSize?.isZero?.())
381
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
382
+ if (this.pageToken !== "")
383
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
384
+ return obj;
385
+ }
386
+ function applyListCapacityBlockGroupsRequestCustom(message) {
387
+ message[logging_1.custom] = ListCapacityBlockGroupsRequestCustomInspect;
388
+ message[logging_1.customJson] = ListCapacityBlockGroupsRequestCustomJson;
389
+ return message;
390
+ }
391
+ function createBaseListCapacityBlockGroupsRequest() {
392
+ const message = {
393
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsRequest",
394
+ parentId: "",
395
+ pageSize: index_1.Long.ZERO,
396
+ pageToken: "",
397
+ };
398
+ return applyListCapacityBlockGroupsRequestCustom(message);
399
+ }
400
+ exports.ListCapacityBlockGroupsResponse = {
401
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsResponse",
402
+ encode(message, writer = new index_1.BinaryWriter()) {
403
+ for (const v of (message.items ?? [])) {
404
+ const w = writer.uint32(10).fork();
405
+ exports.CapacityBlockGroup.encode(v, w);
406
+ w.join();
407
+ }
408
+ if (message.nextPageToken !== "") {
409
+ writer.uint32(18).string(message.nextPageToken);
410
+ }
411
+ if (message[index_1.unknownFieldsSymbol]) {
412
+ writer.raw(message[index_1.unknownFieldsSymbol]);
413
+ }
414
+ return writer;
415
+ },
416
+ decode(input, length) {
417
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
418
+ const end = length === undefined ? reader.len : reader.pos + length;
419
+ const message = createBaseListCapacityBlockGroupsResponse();
420
+ let writer = undefined;
421
+ while (reader.pos < end) {
422
+ const tag = reader.uint32();
423
+ switch (tag >>> 3) {
424
+ case 1: {
425
+ if (tag !== 10)
426
+ break;
427
+ message.items.push(exports.CapacityBlockGroup.decode(reader, reader.uint32()));
428
+ continue;
429
+ }
430
+ case 2: {
431
+ if (tag !== 18)
432
+ break;
433
+ message.nextPageToken = reader.string();
434
+ continue;
435
+ }
436
+ default:
437
+ break;
438
+ }
439
+ if ((tag & 7) === 4 || tag === 0) {
440
+ break;
441
+ }
442
+ {
443
+ if (!writer)
444
+ writer = new index_1.BinaryWriter();
445
+ const skipped = reader.skip(tag & 7, tag >>> 3);
446
+ writer.uint32(tag).raw(skipped);
447
+ }
448
+ }
449
+ if (writer) {
450
+ message[index_1.unknownFieldsSymbol] = writer.finish();
451
+ }
452
+ return message;
453
+ },
454
+ fromJSON(object) {
455
+ return applyListCapacityBlockGroupsResponseCustom({
456
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsResponse",
457
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
458
+ ? (object.items ?? object.items).map((e) => exports.CapacityBlockGroup.fromJSON(e))
459
+ : [],
460
+ nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
461
+ ? String(object.nextPageToken ?? object.next_page_token)
462
+ : "",
463
+ });
464
+ },
465
+ toJSON(message, use = "json") {
466
+ const obj = {};
467
+ const pick = (json, pb) => (use === "json" ? json : pb);
468
+ if (message.items?.length) {
469
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.CapacityBlockGroup.toJSON(e, use) : undefined);
470
+ }
471
+ if (message.nextPageToken !== "") {
472
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
473
+ }
474
+ return obj;
475
+ },
476
+ create(base) {
477
+ return exports.ListCapacityBlockGroupsResponse.fromPartial(base ?? {});
478
+ },
479
+ fromPartial(object) {
480
+ const message = createBaseListCapacityBlockGroupsResponse();
481
+ message.items = object.items?.map((e) => exports.CapacityBlockGroup.fromPartial(e)) || [];
482
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
483
+ ? object.nextPageToken
484
+ : "";
485
+ return message;
486
+ },
487
+ };
488
+ protobuf_1.protoRegistry.registerMessage(exports.ListCapacityBlockGroupsResponse);
489
+ function ListCapacityBlockGroupsResponseCustomInspect() {
490
+ const parts = [];
491
+ if ((this.items?.length ?? 0) !== 0)
492
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
493
+ if (this.nextPageToken !== "")
494
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
495
+ return `${this.$type}(${parts.join(", ")})`;
496
+ }
497
+ function ListCapacityBlockGroupsResponseCustomJson() {
498
+ const obj = {
499
+ type: this.$type,
500
+ };
501
+ if ((this.items?.length ?? 0) !== 0)
502
+ obj.items = (0, logging_1.inspectJson)(this.items);
503
+ if (this.nextPageToken !== "")
504
+ obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
505
+ return obj;
506
+ }
507
+ function applyListCapacityBlockGroupsResponseCustom(message) {
508
+ message[logging_1.custom] = ListCapacityBlockGroupsResponseCustomInspect;
509
+ message[logging_1.customJson] = ListCapacityBlockGroupsResponseCustomJson;
510
+ return message;
511
+ }
512
+ function createBaseListCapacityBlockGroupsResponse() {
513
+ const message = {
514
+ $type: "nebius.capacity.v1.ListCapacityBlockGroupsResponse",
515
+ items: [],
516
+ nextPageToken: "",
517
+ };
518
+ return applyListCapacityBlockGroupsResponseCustom(message);
519
+ }
520
+ exports.CapacityBlockGroupServiceServiceDescription = {
521
+ get: {
522
+ path: "/nebius.capacity.v1.CapacityBlockGroupService/Get",
523
+ requestStream: false,
524
+ responseStream: false,
525
+ requestSerialize: (value) => Buffer.from(exports.GetCapacityBlockGroupRequest.encode(value).finish()),
526
+ sendResetMask: false,
527
+ requestDeserialize: (value) => exports.GetCapacityBlockGroupRequest.decode(value),
528
+ responseSerialize: (value) => Buffer.from(exports.CapacityBlockGroup.encode(value).finish()),
529
+ responseDeserialize: (value) => exports.CapacityBlockGroup.decode(value),
530
+ },
531
+ getByResourceAffinity: {
532
+ path: "/nebius.capacity.v1.CapacityBlockGroupService/GetByResourceAffinity",
533
+ requestStream: false,
534
+ responseStream: false,
535
+ requestSerialize: (value) => Buffer.from(exports.GetCapacityBlockGroupByResourceAffinityRequest.encode(value).finish()),
536
+ sendResetMask: false,
537
+ requestDeserialize: (value) => exports.GetCapacityBlockGroupByResourceAffinityRequest.decode(value),
538
+ responseSerialize: (value) => Buffer.from(exports.CapacityBlockGroup.encode(value).finish()),
539
+ responseDeserialize: (value) => exports.CapacityBlockGroup.decode(value),
540
+ },
541
+ list: {
542
+ path: "/nebius.capacity.v1.CapacityBlockGroupService/List",
543
+ requestStream: false,
544
+ responseStream: false,
545
+ requestSerialize: (value) => Buffer.from(exports.ListCapacityBlockGroupsRequest.encode(value).finish()),
546
+ sendResetMask: false,
547
+ requestDeserialize: (value) => exports.ListCapacityBlockGroupsRequest.decode(value),
548
+ responseSerialize: (value) => Buffer.from(exports.ListCapacityBlockGroupsResponse.encode(value).finish()),
549
+ responseDeserialize: (value) => exports.ListCapacityBlockGroupsResponse.decode(value),
550
+ },
551
+ };
552
+ exports.CapacityBlockGroupServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.CapacityBlockGroupServiceServiceDescription, "nebius.capacity.v1.CapacityBlockGroupService");
553
+ class CapacityBlockGroupService {
554
+ sdk;
555
+ $type = "nebius.capacity.v1.CapacityBlockGroupService";
556
+ addr;
557
+ spec;
558
+ apiServiceName = "capacity-blocks.billing-cpl";
559
+ constructor(sdk) {
560
+ this.sdk = sdk;
561
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
562
+ this.addr = addr;
563
+ this.spec = exports.CapacityBlockGroupServiceServiceDescription;
564
+ }
565
+ get(...args) {
566
+ const spec = this.spec.get;
567
+ const request = args[0];
568
+ const metadata = (args.length > 1 ? args[1] : undefined);
569
+ const options = (args.length > 2 ? args[2] : undefined);
570
+ const deserialize = spec.responseDeserialize;
571
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
572
+ }
573
+ getByResourceAffinity(...args) {
574
+ const spec = this.spec.getByResourceAffinity;
575
+ const request = args[0];
576
+ const metadata = (args.length > 1 ? args[1] : undefined);
577
+ const options = (args.length > 2 ? args[2] : undefined);
578
+ const deserialize = spec.responseDeserialize;
579
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
580
+ }
581
+ list(...args) {
582
+ const spec = this.spec.list;
583
+ const request = args[0];
584
+ const metadata = (args.length > 1 ? args[1] : undefined);
585
+ const options = (args.length > 2 ? args[2] : undefined);
586
+ const deserialize = spec.responseDeserialize;
587
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
588
+ }
589
+ }
590
+ exports.CapacityBlockGroupService = CapacityBlockGroupService;
591
+ const CurrentContinuousInterval_State_VALUE_COMMENTS = {
592
+ STATE_UNSPECIFIED: " Shouldn't happen.\n",
593
+ STATE_SCHEDULED: " Continuous Interval is in the future.\n",
594
+ STATE_ACTIVE: " Continuous Interval is active.\n",
595
+ STATE_EXPIRED: " Continuous Interval is in the past.\n",
596
+ };
597
+ exports.CurrentContinuousInterval_State = (0, index_1.createEnum)("nebius.capacity.v1.CurrentContinuousInterval.State", {
598
+ /**
599
+ * Shouldn't happen.
600
+ *
601
+ */
602
+ STATE_UNSPECIFIED: 0,
603
+ /**
604
+ * Continuous Interval is in the future.
605
+ *
606
+ */
607
+ STATE_SCHEDULED: 1,
608
+ /**
609
+ * Continuous Interval is active.
610
+ *
611
+ */
612
+ STATE_ACTIVE: 2,
613
+ /**
614
+ * Continuous Interval is in the past.
615
+ *
616
+ */
617
+ STATE_EXPIRED: 3,
618
+ }, CurrentContinuousInterval_State_VALUE_COMMENTS);
619
+ protobuf_1.protoRegistry.registerEnum(exports.CurrentContinuousInterval_State);
620
+ const CapacityBlockGroupStatus_State_VALUE_COMMENTS = {
621
+ STATE_UNSPECIFIED: " Shouldn't happen.\n",
622
+ STATE_ALLOCATING: " Capacity Block Group quota is being allocated as one or more capacity intervals have started.\n",
623
+ STATE_ACTIVE: " Capacity Block Group quota is already allocated and active as one or more capacity intervals are active.\n",
624
+ STATE_SHUTTING: " Capacity Block Group is being shut down due to absence of active intervals at the time.\n",
625
+ STATE_INACTIVE: " Capacity Block Group is inactive due to absence of active intervals at the time.\n",
626
+ };
627
+ exports.CapacityBlockGroupStatus_State = (0, index_1.createEnum)("nebius.capacity.v1.CapacityBlockGroupStatus.State", {
628
+ /**
629
+ * Shouldn't happen.
630
+ *
631
+ */
632
+ STATE_UNSPECIFIED: 0,
633
+ /**
634
+ * Capacity Block Group quota is being allocated as one or more capacity intervals have started.
635
+ *
636
+ */
637
+ STATE_ALLOCATING: 1,
638
+ /**
639
+ * Capacity Block Group quota is already allocated and active as one or more capacity intervals are active.
640
+ *
641
+ */
642
+ STATE_ACTIVE: 2,
643
+ /**
644
+ * Capacity Block Group is being shut down due to absence of active intervals at the time.
645
+ *
646
+ */
647
+ STATE_SHUTTING: 3,
648
+ /**
649
+ * Capacity Block Group is inactive due to absence of active intervals at the time.
650
+ *
651
+ */
652
+ STATE_INACTIVE: 4,
653
+ }, CapacityBlockGroupStatus_State_VALUE_COMMENTS);
654
+ protobuf_1.protoRegistry.registerEnum(exports.CapacityBlockGroupStatus_State);
655
+ const CapacityBlockGroupStatus_UsageState_VALUE_COMMENTS = {
656
+ USAGE_STATE_UNSPECIFIED: " Shouldn't happen.\n",
657
+ USAGE_STATE_USED: " Capacity Block Group quota is actively in use.\n",
658
+ USAGE_STATE_NOT_USED: " Capacity Block Group quota is not currently in use.\n",
659
+ USAGE_STATE_UNKNOWN: " Capacity Block Group region is unreachable, the current usage is therefore unknown.\n Please, retry the request later.\n",
660
+ };
661
+ exports.CapacityBlockGroupStatus_UsageState = (0, index_1.createEnum)("nebius.capacity.v1.CapacityBlockGroupStatus.UsageState", {
662
+ /**
663
+ * Shouldn't happen.
664
+ *
665
+ */
666
+ USAGE_STATE_UNSPECIFIED: 0,
667
+ /**
668
+ * Capacity Block Group quota is actively in use.
669
+ *
670
+ */
671
+ USAGE_STATE_USED: 1,
672
+ /**
673
+ * Capacity Block Group quota is not currently in use.
674
+ *
675
+ */
676
+ USAGE_STATE_NOT_USED: 2,
677
+ /**
678
+ * Capacity Block Group region is unreachable, the current usage is therefore unknown.
679
+ * Please, retry the request later.
680
+ *
681
+ */
682
+ USAGE_STATE_UNKNOWN: 3,
683
+ }, CapacityBlockGroupStatus_UsageState_VALUE_COMMENTS);
684
+ protobuf_1.protoRegistry.registerEnum(exports.CapacityBlockGroupStatus_UsageState);
685
+ exports.CapacityBlockGroupSpec = {
686
+ $type: "nebius.capacity.v1.CapacityBlockGroupSpec",
687
+ encode(message, writer = new index_1.BinaryWriter()) {
688
+ if (message[index_1.unknownFieldsSymbol]) {
689
+ writer.raw(message[index_1.unknownFieldsSymbol]);
690
+ }
691
+ return writer;
692
+ },
693
+ decode(input, length) {
694
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
695
+ const end = length === undefined ? reader.len : reader.pos + length;
696
+ const message = createBaseCapacityBlockGroupSpec();
697
+ let writer = undefined;
698
+ while (reader.pos < end) {
699
+ const tag = reader.uint32();
700
+ switch (tag >>> 3) {
701
+ default:
702
+ break;
703
+ }
704
+ if ((tag & 7) === 4 || tag === 0) {
705
+ break;
706
+ }
707
+ {
708
+ if (!writer)
709
+ writer = new index_1.BinaryWriter();
710
+ const skipped = reader.skip(tag & 7, tag >>> 3);
711
+ writer.uint32(tag).raw(skipped);
712
+ }
713
+ }
714
+ if (writer) {
715
+ message[index_1.unknownFieldsSymbol] = writer.finish();
716
+ }
717
+ return message;
718
+ },
719
+ fromJSON(object) {
720
+ return applyCapacityBlockGroupSpecCustom({
721
+ $type: "nebius.capacity.v1.CapacityBlockGroupSpec",
722
+ });
723
+ },
724
+ toJSON(message, use = "json") {
725
+ const obj = {};
726
+ const pick = (json, pb) => (use === "json" ? json : pb);
727
+ return obj;
728
+ },
729
+ create(base) {
730
+ return exports.CapacityBlockGroupSpec.fromPartial(base ?? {});
731
+ },
732
+ fromPartial(object) {
733
+ const message = createBaseCapacityBlockGroupSpec();
734
+ return message;
735
+ },
736
+ };
737
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityBlockGroupSpec);
738
+ function CapacityBlockGroupSpecCustomInspect() {
739
+ const parts = [];
740
+ return `${this.$type}(${parts.join(", ")})`;
741
+ }
742
+ function CapacityBlockGroupSpecCustomJson() {
743
+ const obj = {
744
+ type: this.$type,
745
+ };
746
+ return obj;
747
+ }
748
+ function applyCapacityBlockGroupSpecCustom(message) {
749
+ message[logging_1.custom] = CapacityBlockGroupSpecCustomInspect;
750
+ message[logging_1.customJson] = CapacityBlockGroupSpecCustomJson;
751
+ return message;
752
+ }
753
+ function createBaseCapacityBlockGroupSpec() {
754
+ const message = {
755
+ $type: "nebius.capacity.v1.CapacityBlockGroupSpec",
756
+ };
757
+ return applyCapacityBlockGroupSpecCustom(message);
758
+ }
759
+ exports.CurrentContinuousInterval = {
760
+ $type: "nebius.capacity.v1.CurrentContinuousInterval",
761
+ encode(message, writer = new index_1.BinaryWriter()) {
762
+ if (message.startTime !== undefined) {
763
+ const w = writer.uint32(10).fork();
764
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.startTime);
765
+ w.join();
766
+ }
767
+ if (message.endTime !== undefined) {
768
+ const w = writer.uint32(18).fork();
769
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.endTime);
770
+ w.join();
771
+ }
772
+ if (message.quantity !== undefined && !message.quantity.isZero?.()) {
773
+ writer.uint32(24).uint64(message.quantity.toString());
774
+ }
775
+ if ((message.state ?? exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED) !== exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED) {
776
+ exports.CurrentContinuousInterval_State.encodeField(writer, 4, message.state);
777
+ }
778
+ if (message[index_1.unknownFieldsSymbol]) {
779
+ writer.raw(message[index_1.unknownFieldsSymbol]);
780
+ }
781
+ return writer;
782
+ },
783
+ decode(input, length) {
784
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
785
+ const end = length === undefined ? reader.len : reader.pos + length;
786
+ const message = createBaseCurrentContinuousInterval();
787
+ let writer = undefined;
788
+ while (reader.pos < end) {
789
+ const tag = reader.uint32();
790
+ switch (tag >>> 3) {
791
+ case 1: {
792
+ if (tag !== 10)
793
+ break;
794
+ const len = reader.uint32();
795
+ message.startTime = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
796
+ continue;
797
+ }
798
+ case 2: {
799
+ if (tag !== 18)
800
+ break;
801
+ const len = reader.uint32();
802
+ message.endTime = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
803
+ continue;
804
+ }
805
+ case 3: {
806
+ if (tag !== 24)
807
+ break;
808
+ message.quantity = index_1.Long.fromValue(reader.uint64());
809
+ continue;
810
+ }
811
+ case 4: {
812
+ if (tag !== 32)
813
+ break;
814
+ message.state = exports.CurrentContinuousInterval_State.fromNumber(reader.int32());
815
+ continue;
816
+ }
817
+ default:
818
+ break;
819
+ }
820
+ if ((tag & 7) === 4 || tag === 0) {
821
+ break;
822
+ }
823
+ {
824
+ if (!writer)
825
+ writer = new index_1.BinaryWriter();
826
+ const skipped = reader.skip(tag & 7, tag >>> 3);
827
+ writer.uint32(tag).raw(skipped);
828
+ }
829
+ }
830
+ if (writer) {
831
+ message[index_1.unknownFieldsSymbol] = writer.finish();
832
+ }
833
+ return message;
834
+ },
835
+ fromJSON(object) {
836
+ return applyCurrentContinuousIntervalCustom({
837
+ $type: "nebius.capacity.v1.CurrentContinuousInterval",
838
+ startTime: (0, index_1.isSet)(object.startTime ?? object.start_time)
839
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.startTime ?? object.start_time)
840
+ : undefined,
841
+ endTime: (0, index_1.isSet)(object.endTime ?? object.end_time)
842
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.endTime ?? object.end_time)
843
+ : undefined,
844
+ quantity: (0, index_1.isSet)(object.quantity ?? object.quantity)
845
+ ? index_1.Long.fromValue(object.quantity ?? object.quantity)
846
+ : index_1.Long.ZERO,
847
+ state: (0, index_1.isSet)(object.state ?? object.state)
848
+ ? exports.CurrentContinuousInterval_State.fromJSON(object.state ?? object.state)
849
+ : exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED,
850
+ });
851
+ },
852
+ toJSON(message, use = "json") {
853
+ const obj = {};
854
+ const pick = (json, pb) => (use === "json" ? json : pb);
855
+ if (message.startTime !== undefined) {
856
+ obj[pick("startTime", "start_time")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.startTime, use);
857
+ }
858
+ if (message.endTime !== undefined) {
859
+ obj[pick("endTime", "end_time")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.endTime, use);
860
+ }
861
+ if (!message.quantity?.isZero?.()) {
862
+ obj[pick("quantity", "quantity")] = (message.quantity || index_1.Long.ZERO).toString();
863
+ }
864
+ if ((message.state ?? exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED) !== exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED) {
865
+ obj[pick("state", "state")] = exports.CurrentContinuousInterval_State.toJSON(message.state);
866
+ }
867
+ return obj;
868
+ },
869
+ create(base) {
870
+ return exports.CurrentContinuousInterval.fromPartial(base ?? {});
871
+ },
872
+ fromPartial(object) {
873
+ const message = createBaseCurrentContinuousInterval();
874
+ message.startTime = (object.startTime !== undefined && object.startTime !== null)
875
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.startTime)
876
+ : undefined;
877
+ message.endTime = (object.endTime !== undefined && object.endTime !== null)
878
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.endTime)
879
+ : undefined;
880
+ message.quantity = (object.quantity !== undefined && object.quantity !== null)
881
+ ? index_1.Long.fromValue(object.quantity)
882
+ : index_1.Long.ZERO;
883
+ message.state = (object.state !== undefined && object.state !== null)
884
+ ? exports.CurrentContinuousInterval_State.fromJSON(object.state.name)
885
+ : exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED;
886
+ return message;
887
+ },
888
+ };
889
+ protobuf_1.protoRegistry.registerMessage(exports.CurrentContinuousInterval);
890
+ function CurrentContinuousIntervalCustomInspect() {
891
+ const parts = [];
892
+ if (this.startTime !== undefined)
893
+ parts.push("startTime" + "=" + (0, util_1.inspect)(this.startTime));
894
+ if (this.endTime !== undefined)
895
+ parts.push("endTime" + "=" + (0, util_1.inspect)(this.endTime));
896
+ if (!this.quantity?.isZero?.())
897
+ parts.push("quantity" + "=" + (0, util_1.inspect)(this.quantity));
898
+ if (this.state !== undefined)
899
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
900
+ return `${this.$type}(${parts.join(", ")})`;
901
+ }
902
+ function CurrentContinuousIntervalCustomJson() {
903
+ const obj = {
904
+ type: this.$type,
905
+ };
906
+ if (this.startTime !== undefined)
907
+ obj.startTime = (0, logging_1.inspectJson)(this.startTime);
908
+ if (this.endTime !== undefined)
909
+ obj.endTime = (0, logging_1.inspectJson)(this.endTime);
910
+ if (!this.quantity?.isZero?.())
911
+ obj.quantity = (0, logging_1.inspectJson)(this.quantity);
912
+ if (this.state !== undefined)
913
+ obj.state = (0, logging_1.inspectJson)(this.state);
914
+ return obj;
915
+ }
916
+ function applyCurrentContinuousIntervalCustom(message) {
917
+ message[logging_1.custom] = CurrentContinuousIntervalCustomInspect;
918
+ message[logging_1.customJson] = CurrentContinuousIntervalCustomJson;
919
+ return message;
920
+ }
921
+ function createBaseCurrentContinuousInterval() {
922
+ const message = {
923
+ $type: "nebius.capacity.v1.CurrentContinuousInterval",
924
+ startTime: undefined,
925
+ endTime: undefined,
926
+ quantity: index_1.Long.ZERO,
927
+ state: exports.CurrentContinuousInterval_State.STATE_UNSPECIFIED,
928
+ };
929
+ return applyCurrentContinuousIntervalCustom(message);
930
+ }
931
+ exports.CapacityBlockGroupStatus = {
932
+ $type: "nebius.capacity.v1.CapacityBlockGroupStatus",
933
+ encode(message, writer = new index_1.BinaryWriter()) {
934
+ if (message.region !== "") {
935
+ writer.uint32(10).string(message.region);
936
+ }
937
+ if (message.resourceAffinity !== undefined) {
938
+ const w = writer.uint32(18).fork();
939
+ exports.ResourceAffinity.encode(message.resourceAffinity, w);
940
+ w.join();
941
+ }
942
+ if (message.service !== "") {
943
+ writer.uint32(26).string(message.service);
944
+ }
945
+ if ((message.state ?? exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED) !== exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED) {
946
+ exports.CapacityBlockGroupStatus_State.encodeField(writer, 5, message.state);
947
+ }
948
+ if (message.currentLimit !== undefined && !message.currentLimit.isZero?.()) {
949
+ writer.uint32(48).uint64(message.currentLimit.toString());
950
+ }
951
+ if (message.usage !== undefined && !message.usage.isZero?.()) {
952
+ writer.uint32(64).uint64(message.usage.toString());
953
+ }
954
+ if (message.usagePercentage !== "") {
955
+ writer.uint32(74).string(message.usagePercentage);
956
+ }
957
+ if (message.nextChangeAt !== undefined) {
958
+ const w = writer.uint32(82).fork();
959
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.nextChangeAt);
960
+ w.join();
961
+ }
962
+ if (message.nextChangeTo !== undefined) {
963
+ writer.uint32(88).uint64(message.nextChangeTo.toString());
964
+ }
965
+ if (message.currentContinuousInterval !== undefined) {
966
+ const w = writer.uint32(98).fork();
967
+ exports.CurrentContinuousInterval.encode(message.currentContinuousInterval, w);
968
+ w.join();
969
+ }
970
+ if ((message.usageState ?? exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED) !== exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED) {
971
+ exports.CapacityBlockGroupStatus_UsageState.encodeField(writer, 13, message.usageState);
972
+ }
973
+ if (message.reconciling === true) {
974
+ writer.uint32(800).bool(message.reconciling);
975
+ }
976
+ if (message[index_1.unknownFieldsSymbol]) {
977
+ writer.raw(message[index_1.unknownFieldsSymbol]);
978
+ }
979
+ return writer;
980
+ },
981
+ decode(input, length) {
982
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
983
+ const end = length === undefined ? reader.len : reader.pos + length;
984
+ const message = createBaseCapacityBlockGroupStatus();
985
+ let writer = undefined;
986
+ while (reader.pos < end) {
987
+ const tag = reader.uint32();
988
+ switch (tag >>> 3) {
989
+ case 1: {
990
+ if (tag !== 10)
991
+ break;
992
+ message.region = reader.string();
993
+ continue;
994
+ }
995
+ case 2: {
996
+ if (tag !== 18)
997
+ break;
998
+ message.resourceAffinity = exports.ResourceAffinity.decode(reader, reader.uint32());
999
+ continue;
1000
+ }
1001
+ case 3: {
1002
+ if (tag !== 26)
1003
+ break;
1004
+ message.service = reader.string();
1005
+ continue;
1006
+ }
1007
+ case 5: {
1008
+ if (tag !== 40)
1009
+ break;
1010
+ message.state = exports.CapacityBlockGroupStatus_State.fromNumber(reader.int32());
1011
+ continue;
1012
+ }
1013
+ case 6: {
1014
+ if (tag !== 48)
1015
+ break;
1016
+ message.currentLimit = index_1.Long.fromValue(reader.uint64());
1017
+ continue;
1018
+ }
1019
+ case 8: {
1020
+ if (tag !== 64)
1021
+ break;
1022
+ message.usage = index_1.Long.fromValue(reader.uint64());
1023
+ continue;
1024
+ }
1025
+ case 9: {
1026
+ if (tag !== 74)
1027
+ break;
1028
+ message.usagePercentage = reader.string();
1029
+ continue;
1030
+ }
1031
+ case 10: {
1032
+ if (tag !== 82)
1033
+ break;
1034
+ const len = reader.uint32();
1035
+ message.nextChangeAt = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
1036
+ continue;
1037
+ }
1038
+ case 11: {
1039
+ if (tag !== 88)
1040
+ break;
1041
+ message.nextChangeTo = index_1.Long.fromValue(reader.uint64());
1042
+ continue;
1043
+ }
1044
+ case 12: {
1045
+ if (tag !== 98)
1046
+ break;
1047
+ message.currentContinuousInterval = exports.CurrentContinuousInterval.decode(reader, reader.uint32());
1048
+ continue;
1049
+ }
1050
+ case 13: {
1051
+ if (tag !== 104)
1052
+ break;
1053
+ message.usageState = exports.CapacityBlockGroupStatus_UsageState.fromNumber(reader.int32());
1054
+ continue;
1055
+ }
1056
+ case 100: {
1057
+ if (tag !== 800)
1058
+ break;
1059
+ message.reconciling = reader.bool();
1060
+ continue;
1061
+ }
1062
+ default:
1063
+ break;
1064
+ }
1065
+ if ((tag & 7) === 4 || tag === 0) {
1066
+ break;
1067
+ }
1068
+ {
1069
+ if (!writer)
1070
+ writer = new index_1.BinaryWriter();
1071
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1072
+ writer.uint32(tag).raw(skipped);
1073
+ }
1074
+ }
1075
+ if (writer) {
1076
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1077
+ }
1078
+ return message;
1079
+ },
1080
+ fromJSON(object) {
1081
+ return applyCapacityBlockGroupStatusCustom({
1082
+ $type: "nebius.capacity.v1.CapacityBlockGroupStatus",
1083
+ region: (0, index_1.isSet)(object.region ?? object.region)
1084
+ ? String(object.region ?? object.region)
1085
+ : "",
1086
+ resourceAffinity: (0, index_1.isSet)(object.resourceAffinity ?? object.resource_affinity)
1087
+ ? exports.ResourceAffinity.fromJSON(object.resourceAffinity ?? object.resource_affinity)
1088
+ : undefined,
1089
+ service: (0, index_1.isSet)(object.service ?? object.service)
1090
+ ? String(object.service ?? object.service)
1091
+ : "",
1092
+ state: (0, index_1.isSet)(object.state ?? object.state)
1093
+ ? exports.CapacityBlockGroupStatus_State.fromJSON(object.state ?? object.state)
1094
+ : exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED,
1095
+ currentLimit: (0, index_1.isSet)(object.currentLimit ?? object.current_limit)
1096
+ ? index_1.Long.fromValue(object.currentLimit ?? object.current_limit)
1097
+ : index_1.Long.ZERO,
1098
+ usage: (0, index_1.isSet)(object.usage ?? object.usage)
1099
+ ? index_1.Long.fromValue(object.usage ?? object.usage)
1100
+ : index_1.Long.ZERO,
1101
+ usagePercentage: (0, index_1.isSet)(object.usagePercentage ?? object.usage_percentage)
1102
+ ? String(object.usagePercentage ?? object.usage_percentage)
1103
+ : "",
1104
+ nextChangeAt: (0, index_1.isSet)(object.nextChangeAt ?? object.next_change_at)
1105
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.nextChangeAt ?? object.next_change_at)
1106
+ : undefined,
1107
+ nextChangeTo: (0, index_1.isSet)(object.nextChangeTo ?? object.next_change_to)
1108
+ ? index_1.Long.fromValue(object.nextChangeTo ?? object.next_change_to)
1109
+ : undefined,
1110
+ currentContinuousInterval: (0, index_1.isSet)(object.currentContinuousInterval ?? object.current_continuous_interval)
1111
+ ? exports.CurrentContinuousInterval.fromJSON(object.currentContinuousInterval ?? object.current_continuous_interval)
1112
+ : undefined,
1113
+ usageState: (0, index_1.isSet)(object.usageState ?? object.usage_state)
1114
+ ? exports.CapacityBlockGroupStatus_UsageState.fromJSON(object.usageState ?? object.usage_state)
1115
+ : exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED,
1116
+ reconciling: (0, index_1.isSet)(object.reconciling ?? object.reconciling)
1117
+ ? Boolean(object.reconciling ?? object.reconciling)
1118
+ : false,
1119
+ });
1120
+ },
1121
+ toJSON(message, use = "json") {
1122
+ const obj = {};
1123
+ const pick = (json, pb) => (use === "json" ? json : pb);
1124
+ if (message.region !== "") {
1125
+ obj[pick("region", "region")] = message.region;
1126
+ }
1127
+ if (message.resourceAffinity !== undefined) {
1128
+ obj[pick("resourceAffinity", "resource_affinity")] = message.resourceAffinity
1129
+ ? exports.ResourceAffinity.toJSON(message.resourceAffinity, use)
1130
+ : undefined;
1131
+ }
1132
+ if (message.service !== "") {
1133
+ obj[pick("service", "service")] = message.service;
1134
+ }
1135
+ if ((message.state ?? exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED) !== exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED) {
1136
+ obj[pick("state", "state")] = exports.CapacityBlockGroupStatus_State.toJSON(message.state);
1137
+ }
1138
+ if (!message.currentLimit?.isZero?.()) {
1139
+ obj[pick("currentLimit", "current_limit")] = (message.currentLimit || index_1.Long.ZERO).toString();
1140
+ }
1141
+ if (!message.usage?.isZero?.()) {
1142
+ obj[pick("usage", "usage")] = (message.usage || index_1.Long.ZERO).toString();
1143
+ }
1144
+ if (message.usagePercentage !== "") {
1145
+ obj[pick("usagePercentage", "usage_percentage")] = message.usagePercentage;
1146
+ }
1147
+ if (message.nextChangeAt !== undefined) {
1148
+ obj[pick("nextChangeAt", "next_change_at")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.nextChangeAt, use);
1149
+ }
1150
+ if (message.nextChangeTo !== undefined) {
1151
+ obj[pick("nextChangeTo", "next_change_to")] = (message.nextChangeTo || index_1.Long.ZERO).toString();
1152
+ }
1153
+ if (message.currentContinuousInterval !== undefined) {
1154
+ obj[pick("currentContinuousInterval", "current_continuous_interval")] = message.currentContinuousInterval
1155
+ ? exports.CurrentContinuousInterval.toJSON(message.currentContinuousInterval, use)
1156
+ : undefined;
1157
+ }
1158
+ if ((message.usageState ?? exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED) !== exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED) {
1159
+ obj[pick("usageState", "usage_state")] = exports.CapacityBlockGroupStatus_UsageState.toJSON(message.usageState);
1160
+ }
1161
+ if (message.reconciling === true) {
1162
+ obj[pick("reconciling", "reconciling")] = message.reconciling;
1163
+ }
1164
+ return obj;
1165
+ },
1166
+ create(base) {
1167
+ return exports.CapacityBlockGroupStatus.fromPartial(base ?? {});
1168
+ },
1169
+ fromPartial(object) {
1170
+ const message = createBaseCapacityBlockGroupStatus();
1171
+ message.region = (object.region !== undefined && object.region !== null)
1172
+ ? object.region
1173
+ : "";
1174
+ message.resourceAffinity = (object.resourceAffinity !== undefined && object.resourceAffinity !== null)
1175
+ ? exports.ResourceAffinity.fromPartial(object.resourceAffinity)
1176
+ : undefined;
1177
+ message.service = (object.service !== undefined && object.service !== null)
1178
+ ? object.service
1179
+ : "";
1180
+ message.state = (object.state !== undefined && object.state !== null)
1181
+ ? exports.CapacityBlockGroupStatus_State.fromJSON(object.state.name)
1182
+ : exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED;
1183
+ message.currentLimit = (object.currentLimit !== undefined && object.currentLimit !== null)
1184
+ ? index_1.Long.fromValue(object.currentLimit)
1185
+ : index_1.Long.ZERO;
1186
+ message.usage = (object.usage !== undefined && object.usage !== null)
1187
+ ? index_1.Long.fromValue(object.usage)
1188
+ : index_1.Long.ZERO;
1189
+ message.usagePercentage = (object.usagePercentage !== undefined && object.usagePercentage !== null)
1190
+ ? object.usagePercentage
1191
+ : "";
1192
+ message.nextChangeAt = (object.nextChangeAt !== undefined && object.nextChangeAt !== null)
1193
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.nextChangeAt)
1194
+ : undefined;
1195
+ message.nextChangeTo = (object.nextChangeTo !== undefined && object.nextChangeTo !== null)
1196
+ ? index_1.Long.fromValue(object.nextChangeTo)
1197
+ : undefined;
1198
+ message.currentContinuousInterval = (object.currentContinuousInterval !== undefined && object.currentContinuousInterval !== null)
1199
+ ? exports.CurrentContinuousInterval.fromPartial(object.currentContinuousInterval)
1200
+ : undefined;
1201
+ message.usageState = (object.usageState !== undefined && object.usageState !== null)
1202
+ ? exports.CapacityBlockGroupStatus_UsageState.fromJSON(object.usageState.name)
1203
+ : exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED;
1204
+ message.reconciling = (object.reconciling !== undefined && object.reconciling !== null)
1205
+ ? object.reconciling
1206
+ : false;
1207
+ return message;
1208
+ },
1209
+ };
1210
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityBlockGroupStatus);
1211
+ function CapacityBlockGroupStatusCustomInspect() {
1212
+ const parts = [];
1213
+ if (this.region !== "")
1214
+ parts.push("region" + "=" + (0, util_1.inspect)(this.region));
1215
+ if (this.resourceAffinity !== undefined)
1216
+ parts.push("resourceAffinity" + "=" + (0, util_1.inspect)(this.resourceAffinity));
1217
+ if (this.service !== "")
1218
+ parts.push("service" + "=" + (0, util_1.inspect)(this.service));
1219
+ if (this.state !== undefined)
1220
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
1221
+ if (!this.currentLimit?.isZero?.())
1222
+ parts.push("currentLimit" + "=" + (0, util_1.inspect)(this.currentLimit));
1223
+ if (!this.usage?.isZero?.())
1224
+ parts.push("usage" + "=" + (0, util_1.inspect)(this.usage));
1225
+ if (this.usagePercentage !== "")
1226
+ parts.push("usagePercentage" + "=" + (0, util_1.inspect)(this.usagePercentage));
1227
+ if (this.nextChangeAt !== undefined)
1228
+ parts.push("nextChangeAt" + "=" + (0, util_1.inspect)(this.nextChangeAt));
1229
+ if (this.nextChangeTo !== undefined)
1230
+ parts.push("nextChangeTo" + "=" + (0, util_1.inspect)(this.nextChangeTo));
1231
+ if (this.currentContinuousInterval !== undefined)
1232
+ parts.push("currentContinuousInterval" + "=" + (0, util_1.inspect)(this.currentContinuousInterval));
1233
+ if (this.usageState !== undefined)
1234
+ parts.push("usageState" + "=" + (0, util_1.inspect)(this.usageState));
1235
+ if (this.reconciling === true)
1236
+ parts.push("reconciling" + "=" + (0, util_1.inspect)(this.reconciling));
1237
+ return `${this.$type}(${parts.join(", ")})`;
1238
+ }
1239
+ function CapacityBlockGroupStatusCustomJson() {
1240
+ const obj = {
1241
+ type: this.$type,
1242
+ };
1243
+ if (this.region !== "")
1244
+ obj.region = (0, logging_1.inspectJson)(this.region);
1245
+ if (this.resourceAffinity !== undefined)
1246
+ obj.resourceAffinity = (0, logging_1.inspectJson)(this.resourceAffinity);
1247
+ if (this.service !== "")
1248
+ obj.service = (0, logging_1.inspectJson)(this.service);
1249
+ if (this.state !== undefined)
1250
+ obj.state = (0, logging_1.inspectJson)(this.state);
1251
+ if (!this.currentLimit?.isZero?.())
1252
+ obj.currentLimit = (0, logging_1.inspectJson)(this.currentLimit);
1253
+ if (!this.usage?.isZero?.())
1254
+ obj.usage = (0, logging_1.inspectJson)(this.usage);
1255
+ if (this.usagePercentage !== "")
1256
+ obj.usagePercentage = (0, logging_1.inspectJson)(this.usagePercentage);
1257
+ if (this.nextChangeAt !== undefined)
1258
+ obj.nextChangeAt = (0, logging_1.inspectJson)(this.nextChangeAt);
1259
+ if (this.nextChangeTo !== undefined)
1260
+ obj.nextChangeTo = (0, logging_1.inspectJson)(this.nextChangeTo);
1261
+ if (this.currentContinuousInterval !== undefined)
1262
+ obj.currentContinuousInterval = (0, logging_1.inspectJson)(this.currentContinuousInterval);
1263
+ if (this.usageState !== undefined)
1264
+ obj.usageState = (0, logging_1.inspectJson)(this.usageState);
1265
+ if (this.reconciling === true)
1266
+ obj.reconciling = (0, logging_1.inspectJson)(this.reconciling);
1267
+ return obj;
1268
+ }
1269
+ function applyCapacityBlockGroupStatusCustom(message) {
1270
+ message[logging_1.custom] = CapacityBlockGroupStatusCustomInspect;
1271
+ message[logging_1.customJson] = CapacityBlockGroupStatusCustomJson;
1272
+ return message;
1273
+ }
1274
+ function createBaseCapacityBlockGroupStatus() {
1275
+ const message = {
1276
+ $type: "nebius.capacity.v1.CapacityBlockGroupStatus",
1277
+ region: "",
1278
+ resourceAffinity: undefined,
1279
+ service: "",
1280
+ state: exports.CapacityBlockGroupStatus_State.STATE_UNSPECIFIED,
1281
+ currentLimit: index_1.Long.ZERO,
1282
+ usage: index_1.Long.ZERO,
1283
+ usagePercentage: "",
1284
+ nextChangeAt: undefined,
1285
+ nextChangeTo: undefined,
1286
+ currentContinuousInterval: undefined,
1287
+ usageState: exports.CapacityBlockGroupStatus_UsageState.USAGE_STATE_UNSPECIFIED,
1288
+ reconciling: false,
1289
+ };
1290
+ return applyCapacityBlockGroupStatusCustom(message);
1291
+ }
1292
+ exports.CapacityBlockGroup = {
1293
+ $type: "nebius.capacity.v1.CapacityBlockGroup",
1294
+ encode(message, writer = new index_1.BinaryWriter()) {
1295
+ if (message.metadata !== undefined) {
1296
+ const w = writer.uint32(10).fork();
1297
+ v1_1.ResourceMetadata.encode(message.metadata, w);
1298
+ w.join();
1299
+ }
1300
+ if (message.spec !== undefined) {
1301
+ const w = writer.uint32(18).fork();
1302
+ exports.CapacityBlockGroupSpec.encode(message.spec, w);
1303
+ w.join();
1304
+ }
1305
+ if (message.status !== undefined) {
1306
+ const w = writer.uint32(26).fork();
1307
+ exports.CapacityBlockGroupStatus.encode(message.status, w);
1308
+ w.join();
1309
+ }
1310
+ if (message[index_1.unknownFieldsSymbol]) {
1311
+ writer.raw(message[index_1.unknownFieldsSymbol]);
1312
+ }
1313
+ return writer;
1314
+ },
1315
+ decode(input, length) {
1316
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1317
+ const end = length === undefined ? reader.len : reader.pos + length;
1318
+ const message = createBaseCapacityBlockGroup();
1319
+ let writer = undefined;
1320
+ while (reader.pos < end) {
1321
+ const tag = reader.uint32();
1322
+ switch (tag >>> 3) {
1323
+ case 1: {
1324
+ if (tag !== 10)
1325
+ break;
1326
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
1327
+ continue;
1328
+ }
1329
+ case 2: {
1330
+ if (tag !== 18)
1331
+ break;
1332
+ message.spec = exports.CapacityBlockGroupSpec.decode(reader, reader.uint32());
1333
+ continue;
1334
+ }
1335
+ case 3: {
1336
+ if (tag !== 26)
1337
+ break;
1338
+ message.status = exports.CapacityBlockGroupStatus.decode(reader, reader.uint32());
1339
+ continue;
1340
+ }
1341
+ default:
1342
+ break;
1343
+ }
1344
+ if ((tag & 7) === 4 || tag === 0) {
1345
+ break;
1346
+ }
1347
+ {
1348
+ if (!writer)
1349
+ writer = new index_1.BinaryWriter();
1350
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1351
+ writer.uint32(tag).raw(skipped);
1352
+ }
1353
+ }
1354
+ if (writer) {
1355
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1356
+ }
1357
+ return message;
1358
+ },
1359
+ fromJSON(object) {
1360
+ return applyCapacityBlockGroupCustom({
1361
+ $type: "nebius.capacity.v1.CapacityBlockGroup",
1362
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
1363
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
1364
+ : undefined,
1365
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
1366
+ ? exports.CapacityBlockGroupSpec.fromJSON(object.spec ?? object.spec)
1367
+ : undefined,
1368
+ status: (0, index_1.isSet)(object.status ?? object.status)
1369
+ ? exports.CapacityBlockGroupStatus.fromJSON(object.status ?? object.status)
1370
+ : undefined,
1371
+ });
1372
+ },
1373
+ toJSON(message, use = "json") {
1374
+ const obj = {};
1375
+ const pick = (json, pb) => (use === "json" ? json : pb);
1376
+ if (message.metadata !== undefined) {
1377
+ obj[pick("metadata", "metadata")] = message.metadata
1378
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
1379
+ : undefined;
1380
+ }
1381
+ if (message.spec !== undefined) {
1382
+ obj[pick("spec", "spec")] = message.spec
1383
+ ? exports.CapacityBlockGroupSpec.toJSON(message.spec, use)
1384
+ : undefined;
1385
+ }
1386
+ if (message.status !== undefined) {
1387
+ obj[pick("status", "status")] = message.status
1388
+ ? exports.CapacityBlockGroupStatus.toJSON(message.status, use)
1389
+ : undefined;
1390
+ }
1391
+ return obj;
1392
+ },
1393
+ create(base) {
1394
+ return exports.CapacityBlockGroup.fromPartial(base ?? {});
1395
+ },
1396
+ fromPartial(object) {
1397
+ const message = createBaseCapacityBlockGroup();
1398
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
1399
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
1400
+ : undefined;
1401
+ message.spec = (object.spec !== undefined && object.spec !== null)
1402
+ ? exports.CapacityBlockGroupSpec.fromPartial(object.spec)
1403
+ : undefined;
1404
+ message.status = (object.status !== undefined && object.status !== null)
1405
+ ? exports.CapacityBlockGroupStatus.fromPartial(object.status)
1406
+ : undefined;
1407
+ return message;
1408
+ },
1409
+ };
1410
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityBlockGroup);
1411
+ function CapacityBlockGroupCustomInspect() {
1412
+ const parts = [];
1413
+ if (this.metadata !== undefined)
1414
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
1415
+ if (this.spec !== undefined)
1416
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
1417
+ if (this.status !== undefined)
1418
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
1419
+ return `${this.$type}(${parts.join(", ")})`;
1420
+ }
1421
+ function CapacityBlockGroupCustomJson() {
1422
+ const obj = {
1423
+ type: this.$type,
1424
+ };
1425
+ if (this.metadata !== undefined)
1426
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
1427
+ if (this.spec !== undefined)
1428
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
1429
+ if (this.status !== undefined)
1430
+ obj.status = (0, logging_1.inspectJson)(this.status);
1431
+ return obj;
1432
+ }
1433
+ function applyCapacityBlockGroupCustom(message) {
1434
+ message[logging_1.custom] = CapacityBlockGroupCustomInspect;
1435
+ message[logging_1.customJson] = CapacityBlockGroupCustomJson;
1436
+ return message;
1437
+ }
1438
+ function createBaseCapacityBlockGroup() {
1439
+ const message = {
1440
+ $type: "nebius.capacity.v1.CapacityBlockGroup",
1441
+ metadata: undefined,
1442
+ spec: undefined,
1443
+ status: undefined,
1444
+ };
1445
+ return applyCapacityBlockGroupCustom(message);
1446
+ }
1447
+ exports.GetCapacityIntervalRequest = {
1448
+ $type: "nebius.capacity.v1.GetCapacityIntervalRequest",
1449
+ encode(message, writer = new index_1.BinaryWriter()) {
1450
+ if (message.id !== "") {
1451
+ writer.uint32(10).string(message.id);
1452
+ }
1453
+ if (message[index_1.unknownFieldsSymbol]) {
1454
+ writer.raw(message[index_1.unknownFieldsSymbol]);
1455
+ }
1456
+ return writer;
1457
+ },
1458
+ decode(input, length) {
1459
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1460
+ const end = length === undefined ? reader.len : reader.pos + length;
1461
+ const message = createBaseGetCapacityIntervalRequest();
1462
+ let writer = undefined;
1463
+ while (reader.pos < end) {
1464
+ const tag = reader.uint32();
1465
+ switch (tag >>> 3) {
1466
+ case 1: {
1467
+ if (tag !== 10)
1468
+ break;
1469
+ message.id = reader.string();
1470
+ continue;
1471
+ }
1472
+ default:
1473
+ break;
1474
+ }
1475
+ if ((tag & 7) === 4 || tag === 0) {
1476
+ break;
1477
+ }
1478
+ {
1479
+ if (!writer)
1480
+ writer = new index_1.BinaryWriter();
1481
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1482
+ writer.uint32(tag).raw(skipped);
1483
+ }
1484
+ }
1485
+ if (writer) {
1486
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1487
+ }
1488
+ return message;
1489
+ },
1490
+ fromJSON(object) {
1491
+ return applyGetCapacityIntervalRequestCustom({
1492
+ $type: "nebius.capacity.v1.GetCapacityIntervalRequest",
1493
+ id: (0, index_1.isSet)(object.id ?? object.id)
1494
+ ? String(object.id ?? object.id)
1495
+ : "",
1496
+ });
1497
+ },
1498
+ toJSON(message, use = "json") {
1499
+ const obj = {};
1500
+ const pick = (json, pb) => (use === "json" ? json : pb);
1501
+ if (message.id !== "") {
1502
+ obj[pick("id", "id")] = message.id;
1503
+ }
1504
+ return obj;
1505
+ },
1506
+ create(base) {
1507
+ return exports.GetCapacityIntervalRequest.fromPartial(base ?? {});
1508
+ },
1509
+ fromPartial(object) {
1510
+ const message = createBaseGetCapacityIntervalRequest();
1511
+ message.id = (object.id !== undefined && object.id !== null)
1512
+ ? object.id
1513
+ : "";
1514
+ return message;
1515
+ },
1516
+ };
1517
+ protobuf_1.protoRegistry.registerMessage(exports.GetCapacityIntervalRequest);
1518
+ function GetCapacityIntervalRequestCustomInspect() {
1519
+ const parts = [];
1520
+ if (this.id !== "")
1521
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
1522
+ return `${this.$type}(${parts.join(", ")})`;
1523
+ }
1524
+ function GetCapacityIntervalRequestCustomJson() {
1525
+ const obj = {
1526
+ type: this.$type,
1527
+ };
1528
+ if (this.id !== "")
1529
+ obj.id = (0, logging_1.inspectJson)(this.id);
1530
+ return obj;
1531
+ }
1532
+ function applyGetCapacityIntervalRequestCustom(message) {
1533
+ message[logging_1.custom] = GetCapacityIntervalRequestCustomInspect;
1534
+ message[logging_1.customJson] = GetCapacityIntervalRequestCustomJson;
1535
+ return message;
1536
+ }
1537
+ function createBaseGetCapacityIntervalRequest() {
1538
+ const message = {
1539
+ $type: "nebius.capacity.v1.GetCapacityIntervalRequest",
1540
+ id: "",
1541
+ };
1542
+ return applyGetCapacityIntervalRequestCustom(message);
1543
+ }
1544
+ exports.ListCapacityIntervalsRequest = {
1545
+ $type: "nebius.capacity.v1.ListCapacityIntervalsRequest",
1546
+ encode(message, writer = new index_1.BinaryWriter()) {
1547
+ if (message.parentId !== "") {
1548
+ writer.uint32(10).string(message.parentId);
1549
+ }
1550
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
1551
+ writer.uint32(16).int64(message.pageSize.toString());
1552
+ }
1553
+ if (message.pageToken !== "") {
1554
+ writer.uint32(26).string(message.pageToken);
1555
+ }
1556
+ if (message[index_1.unknownFieldsSymbol]) {
1557
+ writer.raw(message[index_1.unknownFieldsSymbol]);
1558
+ }
1559
+ return writer;
1560
+ },
1561
+ decode(input, length) {
1562
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1563
+ const end = length === undefined ? reader.len : reader.pos + length;
1564
+ const message = createBaseListCapacityIntervalsRequest();
1565
+ let writer = undefined;
1566
+ while (reader.pos < end) {
1567
+ const tag = reader.uint32();
1568
+ switch (tag >>> 3) {
1569
+ case 1: {
1570
+ if (tag !== 10)
1571
+ break;
1572
+ message.parentId = reader.string();
1573
+ continue;
1574
+ }
1575
+ case 2: {
1576
+ if (tag !== 16)
1577
+ break;
1578
+ message.pageSize = index_1.Long.fromValue(reader.int64());
1579
+ continue;
1580
+ }
1581
+ case 3: {
1582
+ if (tag !== 26)
1583
+ break;
1584
+ message.pageToken = reader.string();
1585
+ continue;
1586
+ }
1587
+ default:
1588
+ break;
1589
+ }
1590
+ if ((tag & 7) === 4 || tag === 0) {
1591
+ break;
1592
+ }
1593
+ {
1594
+ if (!writer)
1595
+ writer = new index_1.BinaryWriter();
1596
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1597
+ writer.uint32(tag).raw(skipped);
1598
+ }
1599
+ }
1600
+ if (writer) {
1601
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1602
+ }
1603
+ return message;
1604
+ },
1605
+ fromJSON(object) {
1606
+ return applyListCapacityIntervalsRequestCustom({
1607
+ $type: "nebius.capacity.v1.ListCapacityIntervalsRequest",
1608
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
1609
+ ? String(object.parentId ?? object.parent_id)
1610
+ : "",
1611
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
1612
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
1613
+ : index_1.Long.ZERO,
1614
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
1615
+ ? String(object.pageToken ?? object.page_token)
1616
+ : "",
1617
+ });
1618
+ },
1619
+ toJSON(message, use = "json") {
1620
+ const obj = {};
1621
+ const pick = (json, pb) => (use === "json" ? json : pb);
1622
+ if (message.parentId !== "") {
1623
+ obj[pick("parentId", "parent_id")] = message.parentId;
1624
+ }
1625
+ if (!message.pageSize?.isZero?.()) {
1626
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
1627
+ }
1628
+ if (message.pageToken !== "") {
1629
+ obj[pick("pageToken", "page_token")] = message.pageToken;
1630
+ }
1631
+ return obj;
1632
+ },
1633
+ create(base) {
1634
+ return exports.ListCapacityIntervalsRequest.fromPartial(base ?? {});
1635
+ },
1636
+ fromPartial(object) {
1637
+ const message = createBaseListCapacityIntervalsRequest();
1638
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
1639
+ ? object.parentId
1640
+ : "";
1641
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
1642
+ ? index_1.Long.fromValue(object.pageSize)
1643
+ : index_1.Long.ZERO;
1644
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
1645
+ ? object.pageToken
1646
+ : "";
1647
+ return message;
1648
+ },
1649
+ };
1650
+ protobuf_1.protoRegistry.registerMessage(exports.ListCapacityIntervalsRequest);
1651
+ function ListCapacityIntervalsRequestCustomInspect() {
1652
+ const parts = [];
1653
+ if (this.parentId !== "")
1654
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
1655
+ if (!this.pageSize?.isZero?.())
1656
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
1657
+ if (this.pageToken !== "")
1658
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
1659
+ return `${this.$type}(${parts.join(", ")})`;
1660
+ }
1661
+ function ListCapacityIntervalsRequestCustomJson() {
1662
+ const obj = {
1663
+ type: this.$type,
1664
+ };
1665
+ if (this.parentId !== "")
1666
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
1667
+ if (!this.pageSize?.isZero?.())
1668
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
1669
+ if (this.pageToken !== "")
1670
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
1671
+ return obj;
1672
+ }
1673
+ function applyListCapacityIntervalsRequestCustom(message) {
1674
+ message[logging_1.custom] = ListCapacityIntervalsRequestCustomInspect;
1675
+ message[logging_1.customJson] = ListCapacityIntervalsRequestCustomJson;
1676
+ return message;
1677
+ }
1678
+ function createBaseListCapacityIntervalsRequest() {
1679
+ const message = {
1680
+ $type: "nebius.capacity.v1.ListCapacityIntervalsRequest",
1681
+ parentId: "",
1682
+ pageSize: index_1.Long.ZERO,
1683
+ pageToken: "",
1684
+ };
1685
+ return applyListCapacityIntervalsRequestCustom(message);
1686
+ }
1687
+ exports.ListCapacityIntervalsResponse = {
1688
+ $type: "nebius.capacity.v1.ListCapacityIntervalsResponse",
1689
+ encode(message, writer = new index_1.BinaryWriter()) {
1690
+ for (const v of (message.items ?? [])) {
1691
+ const w = writer.uint32(10).fork();
1692
+ exports.CapacityInterval.encode(v, w);
1693
+ w.join();
1694
+ }
1695
+ if (message.nextPageToken !== "") {
1696
+ writer.uint32(18).string(message.nextPageToken);
1697
+ }
1698
+ if (message[index_1.unknownFieldsSymbol]) {
1699
+ writer.raw(message[index_1.unknownFieldsSymbol]);
1700
+ }
1701
+ return writer;
1702
+ },
1703
+ decode(input, length) {
1704
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1705
+ const end = length === undefined ? reader.len : reader.pos + length;
1706
+ const message = createBaseListCapacityIntervalsResponse();
1707
+ let writer = undefined;
1708
+ while (reader.pos < end) {
1709
+ const tag = reader.uint32();
1710
+ switch (tag >>> 3) {
1711
+ case 1: {
1712
+ if (tag !== 10)
1713
+ break;
1714
+ message.items.push(exports.CapacityInterval.decode(reader, reader.uint32()));
1715
+ continue;
1716
+ }
1717
+ case 2: {
1718
+ if (tag !== 18)
1719
+ break;
1720
+ message.nextPageToken = reader.string();
1721
+ continue;
1722
+ }
1723
+ default:
1724
+ break;
1725
+ }
1726
+ if ((tag & 7) === 4 || tag === 0) {
1727
+ break;
1728
+ }
1729
+ {
1730
+ if (!writer)
1731
+ writer = new index_1.BinaryWriter();
1732
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1733
+ writer.uint32(tag).raw(skipped);
1734
+ }
1735
+ }
1736
+ if (writer) {
1737
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1738
+ }
1739
+ return message;
1740
+ },
1741
+ fromJSON(object) {
1742
+ return applyListCapacityIntervalsResponseCustom({
1743
+ $type: "nebius.capacity.v1.ListCapacityIntervalsResponse",
1744
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
1745
+ ? (object.items ?? object.items).map((e) => exports.CapacityInterval.fromJSON(e))
1746
+ : [],
1747
+ nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
1748
+ ? String(object.nextPageToken ?? object.next_page_token)
1749
+ : "",
1750
+ });
1751
+ },
1752
+ toJSON(message, use = "json") {
1753
+ const obj = {};
1754
+ const pick = (json, pb) => (use === "json" ? json : pb);
1755
+ if (message.items?.length) {
1756
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.CapacityInterval.toJSON(e, use) : undefined);
1757
+ }
1758
+ if (message.nextPageToken !== "") {
1759
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
1760
+ }
1761
+ return obj;
1762
+ },
1763
+ create(base) {
1764
+ return exports.ListCapacityIntervalsResponse.fromPartial(base ?? {});
1765
+ },
1766
+ fromPartial(object) {
1767
+ const message = createBaseListCapacityIntervalsResponse();
1768
+ message.items = object.items?.map((e) => exports.CapacityInterval.fromPartial(e)) || [];
1769
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
1770
+ ? object.nextPageToken
1771
+ : "";
1772
+ return message;
1773
+ },
1774
+ };
1775
+ protobuf_1.protoRegistry.registerMessage(exports.ListCapacityIntervalsResponse);
1776
+ function ListCapacityIntervalsResponseCustomInspect() {
1777
+ const parts = [];
1778
+ if ((this.items?.length ?? 0) !== 0)
1779
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
1780
+ if (this.nextPageToken !== "")
1781
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
1782
+ return `${this.$type}(${parts.join(", ")})`;
1783
+ }
1784
+ function ListCapacityIntervalsResponseCustomJson() {
1785
+ const obj = {
1786
+ type: this.$type,
1787
+ };
1788
+ if ((this.items?.length ?? 0) !== 0)
1789
+ obj.items = (0, logging_1.inspectJson)(this.items);
1790
+ if (this.nextPageToken !== "")
1791
+ obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
1792
+ return obj;
1793
+ }
1794
+ function applyListCapacityIntervalsResponseCustom(message) {
1795
+ message[logging_1.custom] = ListCapacityIntervalsResponseCustomInspect;
1796
+ message[logging_1.customJson] = ListCapacityIntervalsResponseCustomJson;
1797
+ return message;
1798
+ }
1799
+ function createBaseListCapacityIntervalsResponse() {
1800
+ const message = {
1801
+ $type: "nebius.capacity.v1.ListCapacityIntervalsResponse",
1802
+ items: [],
1803
+ nextPageToken: "",
1804
+ };
1805
+ return applyListCapacityIntervalsResponseCustom(message);
1806
+ }
1807
+ exports.CapacityIntervalServiceServiceDescription = {
1808
+ get: {
1809
+ path: "/nebius.capacity.v1.CapacityIntervalService/Get",
1810
+ requestStream: false,
1811
+ responseStream: false,
1812
+ requestSerialize: (value) => Buffer.from(exports.GetCapacityIntervalRequest.encode(value).finish()),
1813
+ sendResetMask: false,
1814
+ requestDeserialize: (value) => exports.GetCapacityIntervalRequest.decode(value),
1815
+ responseSerialize: (value) => Buffer.from(exports.CapacityInterval.encode(value).finish()),
1816
+ responseDeserialize: (value) => exports.CapacityInterval.decode(value),
1817
+ },
1818
+ list: {
1819
+ path: "/nebius.capacity.v1.CapacityIntervalService/List",
1820
+ requestStream: false,
1821
+ responseStream: false,
1822
+ requestSerialize: (value) => Buffer.from(exports.ListCapacityIntervalsRequest.encode(value).finish()),
1823
+ sendResetMask: false,
1824
+ requestDeserialize: (value) => exports.ListCapacityIntervalsRequest.decode(value),
1825
+ responseSerialize: (value) => Buffer.from(exports.ListCapacityIntervalsResponse.encode(value).finish()),
1826
+ responseDeserialize: (value) => exports.ListCapacityIntervalsResponse.decode(value),
1827
+ },
1828
+ };
1829
+ exports.CapacityIntervalServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.CapacityIntervalServiceServiceDescription, "nebius.capacity.v1.CapacityIntervalService");
1830
+ class CapacityIntervalService {
1831
+ sdk;
1832
+ $type = "nebius.capacity.v1.CapacityIntervalService";
1833
+ addr;
1834
+ spec;
1835
+ apiServiceName = "capacity-blocks.billing-cpl";
1836
+ constructor(sdk) {
1837
+ this.sdk = sdk;
1838
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
1839
+ this.addr = addr;
1840
+ this.spec = exports.CapacityIntervalServiceServiceDescription;
1841
+ }
1842
+ get(...args) {
1843
+ const spec = this.spec.get;
1844
+ const request = args[0];
1845
+ const metadata = (args.length > 1 ? args[1] : undefined);
1846
+ const options = (args.length > 2 ? args[2] : undefined);
1847
+ const deserialize = spec.responseDeserialize;
1848
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1849
+ }
1850
+ list(...args) {
1851
+ const spec = this.spec.list;
1852
+ const request = args[0];
1853
+ const metadata = (args.length > 1 ? args[1] : undefined);
1854
+ const options = (args.length > 2 ? args[2] : undefined);
1855
+ const deserialize = spec.responseDeserialize;
1856
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1857
+ }
1858
+ }
1859
+ exports.CapacityIntervalService = CapacityIntervalService;
1860
+ const CapacityIntervalStatus_State_VALUE_COMMENTS = {
1861
+ STATE_UNSPECIFIED: " Shouldn't happen.\n",
1862
+ STATE_SCHEDULED: " Capacity Interval is fully in the future (now < start_time).\n",
1863
+ STATE_ACTIVE: " Capacity Interval is currently active (start_time <= now < end_time).\n",
1864
+ STATE_EXPIRED: " Capacity Interval is fully in the past (end_time <= now).\n",
1865
+ };
1866
+ exports.CapacityIntervalStatus_State = (0, index_1.createEnum)("nebius.capacity.v1.CapacityIntervalStatus.State", {
1867
+ /**
1868
+ * Shouldn't happen.
1869
+ *
1870
+ */
1871
+ STATE_UNSPECIFIED: 0,
1872
+ /**
1873
+ * Capacity Interval is fully in the future (now < start_time).
1874
+ *
1875
+ */
1876
+ STATE_SCHEDULED: 1,
1877
+ /**
1878
+ * Capacity Interval is currently active (start_time <= now < end_time).
1879
+ *
1880
+ */
1881
+ STATE_ACTIVE: 2,
1882
+ /**
1883
+ * Capacity Interval is fully in the past (end_time <= now).
1884
+ *
1885
+ */
1886
+ STATE_EXPIRED: 3,
1887
+ }, CapacityIntervalStatus_State_VALUE_COMMENTS);
1888
+ protobuf_1.protoRegistry.registerEnum(exports.CapacityIntervalStatus_State);
1889
+ exports.CapacityIntervalSpec = {
1890
+ $type: "nebius.capacity.v1.CapacityIntervalSpec",
1891
+ encode(message, writer = new index_1.BinaryWriter()) {
1892
+ if (message[index_1.unknownFieldsSymbol]) {
1893
+ writer.raw(message[index_1.unknownFieldsSymbol]);
1894
+ }
1895
+ return writer;
1896
+ },
1897
+ decode(input, length) {
1898
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
1899
+ const end = length === undefined ? reader.len : reader.pos + length;
1900
+ const message = createBaseCapacityIntervalSpec();
1901
+ let writer = undefined;
1902
+ while (reader.pos < end) {
1903
+ const tag = reader.uint32();
1904
+ switch (tag >>> 3) {
1905
+ default:
1906
+ break;
1907
+ }
1908
+ if ((tag & 7) === 4 || tag === 0) {
1909
+ break;
1910
+ }
1911
+ {
1912
+ if (!writer)
1913
+ writer = new index_1.BinaryWriter();
1914
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1915
+ writer.uint32(tag).raw(skipped);
1916
+ }
1917
+ }
1918
+ if (writer) {
1919
+ message[index_1.unknownFieldsSymbol] = writer.finish();
1920
+ }
1921
+ return message;
1922
+ },
1923
+ fromJSON(object) {
1924
+ return applyCapacityIntervalSpecCustom({
1925
+ $type: "nebius.capacity.v1.CapacityIntervalSpec",
1926
+ });
1927
+ },
1928
+ toJSON(message, use = "json") {
1929
+ const obj = {};
1930
+ const pick = (json, pb) => (use === "json" ? json : pb);
1931
+ return obj;
1932
+ },
1933
+ create(base) {
1934
+ return exports.CapacityIntervalSpec.fromPartial(base ?? {});
1935
+ },
1936
+ fromPartial(object) {
1937
+ const message = createBaseCapacityIntervalSpec();
1938
+ return message;
1939
+ },
1940
+ };
1941
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityIntervalSpec);
1942
+ function CapacityIntervalSpecCustomInspect() {
1943
+ const parts = [];
1944
+ return `${this.$type}(${parts.join(", ")})`;
1945
+ }
1946
+ function CapacityIntervalSpecCustomJson() {
1947
+ const obj = {
1948
+ type: this.$type,
1949
+ };
1950
+ return obj;
1951
+ }
1952
+ function applyCapacityIntervalSpecCustom(message) {
1953
+ message[logging_1.custom] = CapacityIntervalSpecCustomInspect;
1954
+ message[logging_1.customJson] = CapacityIntervalSpecCustomJson;
1955
+ return message;
1956
+ }
1957
+ function createBaseCapacityIntervalSpec() {
1958
+ const message = {
1959
+ $type: "nebius.capacity.v1.CapacityIntervalSpec",
1960
+ };
1961
+ return applyCapacityIntervalSpecCustom(message);
1962
+ }
1963
+ exports.CapacityIntervalStatus = {
1964
+ $type: "nebius.capacity.v1.CapacityIntervalStatus",
1965
+ encode(message, writer = new index_1.BinaryWriter()) {
1966
+ if (message.containerId !== "") {
1967
+ writer.uint32(10).string(message.containerId);
1968
+ }
1969
+ if (message.region !== "") {
1970
+ writer.uint32(18).string(message.region);
1971
+ }
1972
+ if (message.resourceAffinity !== undefined) {
1973
+ const w = writer.uint32(26).fork();
1974
+ exports.ResourceAffinity.encode(message.resourceAffinity, w);
1975
+ w.join();
1976
+ }
1977
+ if (message.service !== "") {
1978
+ writer.uint32(34).string(message.service);
1979
+ }
1980
+ if (message.quantity !== undefined && !message.quantity.isZero?.()) {
1981
+ writer.uint32(40).uint64(message.quantity.toString());
1982
+ }
1983
+ if (message.startTime !== undefined) {
1984
+ const w = writer.uint32(50).fork();
1985
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.startTime);
1986
+ w.join();
1987
+ }
1988
+ if (message.endTime !== undefined) {
1989
+ const w = writer.uint32(58).fork();
1990
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.endTime);
1991
+ w.join();
1992
+ }
1993
+ if ((message.state ?? exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED) !== exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED) {
1994
+ exports.CapacityIntervalStatus_State.encodeField(writer, 8, message.state);
1995
+ }
1996
+ if (message.reconciling === true) {
1997
+ writer.uint32(800).bool(message.reconciling);
1998
+ }
1999
+ if (message[index_1.unknownFieldsSymbol]) {
2000
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2001
+ }
2002
+ return writer;
2003
+ },
2004
+ decode(input, length) {
2005
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2006
+ const end = length === undefined ? reader.len : reader.pos + length;
2007
+ const message = createBaseCapacityIntervalStatus();
2008
+ let writer = undefined;
2009
+ while (reader.pos < end) {
2010
+ const tag = reader.uint32();
2011
+ switch (tag >>> 3) {
2012
+ case 1: {
2013
+ if (tag !== 10)
2014
+ break;
2015
+ message.containerId = reader.string();
2016
+ continue;
2017
+ }
2018
+ case 2: {
2019
+ if (tag !== 18)
2020
+ break;
2021
+ message.region = reader.string();
2022
+ continue;
2023
+ }
2024
+ case 3: {
2025
+ if (tag !== 26)
2026
+ break;
2027
+ message.resourceAffinity = exports.ResourceAffinity.decode(reader, reader.uint32());
2028
+ continue;
2029
+ }
2030
+ case 4: {
2031
+ if (tag !== 34)
2032
+ break;
2033
+ message.service = reader.string();
2034
+ continue;
2035
+ }
2036
+ case 5: {
2037
+ if (tag !== 40)
2038
+ break;
2039
+ message.quantity = index_1.Long.fromValue(reader.uint64());
2040
+ continue;
2041
+ }
2042
+ case 6: {
2043
+ if (tag !== 50)
2044
+ break;
2045
+ const len = reader.uint32();
2046
+ message.startTime = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
2047
+ continue;
2048
+ }
2049
+ case 7: {
2050
+ if (tag !== 58)
2051
+ break;
2052
+ const len = reader.uint32();
2053
+ message.endTime = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
2054
+ continue;
2055
+ }
2056
+ case 8: {
2057
+ if (tag !== 64)
2058
+ break;
2059
+ message.state = exports.CapacityIntervalStatus_State.fromNumber(reader.int32());
2060
+ continue;
2061
+ }
2062
+ case 100: {
2063
+ if (tag !== 800)
2064
+ break;
2065
+ message.reconciling = reader.bool();
2066
+ continue;
2067
+ }
2068
+ default:
2069
+ break;
2070
+ }
2071
+ if ((tag & 7) === 4 || tag === 0) {
2072
+ break;
2073
+ }
2074
+ {
2075
+ if (!writer)
2076
+ writer = new index_1.BinaryWriter();
2077
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2078
+ writer.uint32(tag).raw(skipped);
2079
+ }
2080
+ }
2081
+ if (writer) {
2082
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2083
+ }
2084
+ return message;
2085
+ },
2086
+ fromJSON(object) {
2087
+ return applyCapacityIntervalStatusCustom({
2088
+ $type: "nebius.capacity.v1.CapacityIntervalStatus",
2089
+ containerId: (0, index_1.isSet)(object.containerId ?? object.container_id)
2090
+ ? String(object.containerId ?? object.container_id)
2091
+ : "",
2092
+ region: (0, index_1.isSet)(object.region ?? object.region)
2093
+ ? String(object.region ?? object.region)
2094
+ : "",
2095
+ resourceAffinity: (0, index_1.isSet)(object.resourceAffinity ?? object.resource_affinity)
2096
+ ? exports.ResourceAffinity.fromJSON(object.resourceAffinity ?? object.resource_affinity)
2097
+ : undefined,
2098
+ service: (0, index_1.isSet)(object.service ?? object.service)
2099
+ ? String(object.service ?? object.service)
2100
+ : "",
2101
+ quantity: (0, index_1.isSet)(object.quantity ?? object.quantity)
2102
+ ? index_1.Long.fromValue(object.quantity ?? object.quantity)
2103
+ : index_1.Long.ZERO,
2104
+ startTime: (0, index_1.isSet)(object.startTime ?? object.start_time)
2105
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.startTime ?? object.start_time)
2106
+ : undefined,
2107
+ endTime: (0, index_1.isSet)(object.endTime ?? object.end_time)
2108
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.endTime ?? object.end_time)
2109
+ : undefined,
2110
+ state: (0, index_1.isSet)(object.state ?? object.state)
2111
+ ? exports.CapacityIntervalStatus_State.fromJSON(object.state ?? object.state)
2112
+ : exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED,
2113
+ reconciling: (0, index_1.isSet)(object.reconciling ?? object.reconciling)
2114
+ ? Boolean(object.reconciling ?? object.reconciling)
2115
+ : false,
2116
+ });
2117
+ },
2118
+ toJSON(message, use = "json") {
2119
+ const obj = {};
2120
+ const pick = (json, pb) => (use === "json" ? json : pb);
2121
+ if (message.containerId !== "") {
2122
+ obj[pick("containerId", "container_id")] = message.containerId;
2123
+ }
2124
+ if (message.region !== "") {
2125
+ obj[pick("region", "region")] = message.region;
2126
+ }
2127
+ if (message.resourceAffinity !== undefined) {
2128
+ obj[pick("resourceAffinity", "resource_affinity")] = message.resourceAffinity
2129
+ ? exports.ResourceAffinity.toJSON(message.resourceAffinity, use)
2130
+ : undefined;
2131
+ }
2132
+ if (message.service !== "") {
2133
+ obj[pick("service", "service")] = message.service;
2134
+ }
2135
+ if (!message.quantity?.isZero?.()) {
2136
+ obj[pick("quantity", "quantity")] = (message.quantity || index_1.Long.ZERO).toString();
2137
+ }
2138
+ if (message.startTime !== undefined) {
2139
+ obj[pick("startTime", "start_time")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.startTime, use);
2140
+ }
2141
+ if (message.endTime !== undefined) {
2142
+ obj[pick("endTime", "end_time")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.endTime, use);
2143
+ }
2144
+ if ((message.state ?? exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED) !== exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED) {
2145
+ obj[pick("state", "state")] = exports.CapacityIntervalStatus_State.toJSON(message.state);
2146
+ }
2147
+ if (message.reconciling === true) {
2148
+ obj[pick("reconciling", "reconciling")] = message.reconciling;
2149
+ }
2150
+ return obj;
2151
+ },
2152
+ create(base) {
2153
+ return exports.CapacityIntervalStatus.fromPartial(base ?? {});
2154
+ },
2155
+ fromPartial(object) {
2156
+ const message = createBaseCapacityIntervalStatus();
2157
+ message.containerId = (object.containerId !== undefined && object.containerId !== null)
2158
+ ? object.containerId
2159
+ : "";
2160
+ message.region = (object.region !== undefined && object.region !== null)
2161
+ ? object.region
2162
+ : "";
2163
+ message.resourceAffinity = (object.resourceAffinity !== undefined && object.resourceAffinity !== null)
2164
+ ? exports.ResourceAffinity.fromPartial(object.resourceAffinity)
2165
+ : undefined;
2166
+ message.service = (object.service !== undefined && object.service !== null)
2167
+ ? object.service
2168
+ : "";
2169
+ message.quantity = (object.quantity !== undefined && object.quantity !== null)
2170
+ ? index_1.Long.fromValue(object.quantity)
2171
+ : index_1.Long.ZERO;
2172
+ message.startTime = (object.startTime !== undefined && object.startTime !== null)
2173
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.startTime)
2174
+ : undefined;
2175
+ message.endTime = (object.endTime !== undefined && object.endTime !== null)
2176
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.endTime)
2177
+ : undefined;
2178
+ message.state = (object.state !== undefined && object.state !== null)
2179
+ ? exports.CapacityIntervalStatus_State.fromJSON(object.state.name)
2180
+ : exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED;
2181
+ message.reconciling = (object.reconciling !== undefined && object.reconciling !== null)
2182
+ ? object.reconciling
2183
+ : false;
2184
+ return message;
2185
+ },
2186
+ };
2187
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityIntervalStatus);
2188
+ function CapacityIntervalStatusCustomInspect() {
2189
+ const parts = [];
2190
+ if (this.containerId !== "")
2191
+ parts.push("containerId" + "=" + (0, util_1.inspect)(this.containerId));
2192
+ if (this.region !== "")
2193
+ parts.push("region" + "=" + (0, util_1.inspect)(this.region));
2194
+ if (this.resourceAffinity !== undefined)
2195
+ parts.push("resourceAffinity" + "=" + (0, util_1.inspect)(this.resourceAffinity));
2196
+ if (this.service !== "")
2197
+ parts.push("service" + "=" + (0, util_1.inspect)(this.service));
2198
+ if (!this.quantity?.isZero?.())
2199
+ parts.push("quantity" + "=" + (0, util_1.inspect)(this.quantity));
2200
+ if (this.startTime !== undefined)
2201
+ parts.push("startTime" + "=" + (0, util_1.inspect)(this.startTime));
2202
+ if (this.endTime !== undefined)
2203
+ parts.push("endTime" + "=" + (0, util_1.inspect)(this.endTime));
2204
+ if (this.state !== undefined)
2205
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
2206
+ if (this.reconciling === true)
2207
+ parts.push("reconciling" + "=" + (0, util_1.inspect)(this.reconciling));
2208
+ return `${this.$type}(${parts.join(", ")})`;
2209
+ }
2210
+ function CapacityIntervalStatusCustomJson() {
2211
+ const obj = {
2212
+ type: this.$type,
2213
+ };
2214
+ if (this.containerId !== "")
2215
+ obj.containerId = (0, logging_1.inspectJson)(this.containerId);
2216
+ if (this.region !== "")
2217
+ obj.region = (0, logging_1.inspectJson)(this.region);
2218
+ if (this.resourceAffinity !== undefined)
2219
+ obj.resourceAffinity = (0, logging_1.inspectJson)(this.resourceAffinity);
2220
+ if (this.service !== "")
2221
+ obj.service = (0, logging_1.inspectJson)(this.service);
2222
+ if (!this.quantity?.isZero?.())
2223
+ obj.quantity = (0, logging_1.inspectJson)(this.quantity);
2224
+ if (this.startTime !== undefined)
2225
+ obj.startTime = (0, logging_1.inspectJson)(this.startTime);
2226
+ if (this.endTime !== undefined)
2227
+ obj.endTime = (0, logging_1.inspectJson)(this.endTime);
2228
+ if (this.state !== undefined)
2229
+ obj.state = (0, logging_1.inspectJson)(this.state);
2230
+ if (this.reconciling === true)
2231
+ obj.reconciling = (0, logging_1.inspectJson)(this.reconciling);
2232
+ return obj;
2233
+ }
2234
+ function applyCapacityIntervalStatusCustom(message) {
2235
+ message[logging_1.custom] = CapacityIntervalStatusCustomInspect;
2236
+ message[logging_1.customJson] = CapacityIntervalStatusCustomJson;
2237
+ return message;
2238
+ }
2239
+ function createBaseCapacityIntervalStatus() {
2240
+ const message = {
2241
+ $type: "nebius.capacity.v1.CapacityIntervalStatus",
2242
+ containerId: "",
2243
+ region: "",
2244
+ resourceAffinity: undefined,
2245
+ service: "",
2246
+ quantity: index_1.Long.ZERO,
2247
+ startTime: undefined,
2248
+ endTime: undefined,
2249
+ state: exports.CapacityIntervalStatus_State.STATE_UNSPECIFIED,
2250
+ reconciling: false,
2251
+ };
2252
+ return applyCapacityIntervalStatusCustom(message);
2253
+ }
2254
+ exports.CapacityInterval = {
2255
+ $type: "nebius.capacity.v1.CapacityInterval",
2256
+ encode(message, writer = new index_1.BinaryWriter()) {
2257
+ if (message.metadata !== undefined) {
2258
+ const w = writer.uint32(10).fork();
2259
+ v1_1.ResourceMetadata.encode(message.metadata, w);
2260
+ w.join();
2261
+ }
2262
+ if (message.spec !== undefined) {
2263
+ const w = writer.uint32(18).fork();
2264
+ exports.CapacityIntervalSpec.encode(message.spec, w);
2265
+ w.join();
2266
+ }
2267
+ if (message.status !== undefined) {
2268
+ const w = writer.uint32(26).fork();
2269
+ exports.CapacityIntervalStatus.encode(message.status, w);
2270
+ w.join();
2271
+ }
2272
+ if (message[index_1.unknownFieldsSymbol]) {
2273
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2274
+ }
2275
+ return writer;
2276
+ },
2277
+ decode(input, length) {
2278
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2279
+ const end = length === undefined ? reader.len : reader.pos + length;
2280
+ const message = createBaseCapacityInterval();
2281
+ let writer = undefined;
2282
+ while (reader.pos < end) {
2283
+ const tag = reader.uint32();
2284
+ switch (tag >>> 3) {
2285
+ case 1: {
2286
+ if (tag !== 10)
2287
+ break;
2288
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
2289
+ continue;
2290
+ }
2291
+ case 2: {
2292
+ if (tag !== 18)
2293
+ break;
2294
+ message.spec = exports.CapacityIntervalSpec.decode(reader, reader.uint32());
2295
+ continue;
2296
+ }
2297
+ case 3: {
2298
+ if (tag !== 26)
2299
+ break;
2300
+ message.status = exports.CapacityIntervalStatus.decode(reader, reader.uint32());
2301
+ continue;
2302
+ }
2303
+ default:
2304
+ break;
2305
+ }
2306
+ if ((tag & 7) === 4 || tag === 0) {
2307
+ break;
2308
+ }
2309
+ {
2310
+ if (!writer)
2311
+ writer = new index_1.BinaryWriter();
2312
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2313
+ writer.uint32(tag).raw(skipped);
2314
+ }
2315
+ }
2316
+ if (writer) {
2317
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2318
+ }
2319
+ return message;
2320
+ },
2321
+ fromJSON(object) {
2322
+ return applyCapacityIntervalCustom({
2323
+ $type: "nebius.capacity.v1.CapacityInterval",
2324
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
2325
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
2326
+ : undefined,
2327
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
2328
+ ? exports.CapacityIntervalSpec.fromJSON(object.spec ?? object.spec)
2329
+ : undefined,
2330
+ status: (0, index_1.isSet)(object.status ?? object.status)
2331
+ ? exports.CapacityIntervalStatus.fromJSON(object.status ?? object.status)
2332
+ : undefined,
2333
+ });
2334
+ },
2335
+ toJSON(message, use = "json") {
2336
+ const obj = {};
2337
+ const pick = (json, pb) => (use === "json" ? json : pb);
2338
+ if (message.metadata !== undefined) {
2339
+ obj[pick("metadata", "metadata")] = message.metadata
2340
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
2341
+ : undefined;
2342
+ }
2343
+ if (message.spec !== undefined) {
2344
+ obj[pick("spec", "spec")] = message.spec
2345
+ ? exports.CapacityIntervalSpec.toJSON(message.spec, use)
2346
+ : undefined;
2347
+ }
2348
+ if (message.status !== undefined) {
2349
+ obj[pick("status", "status")] = message.status
2350
+ ? exports.CapacityIntervalStatus.toJSON(message.status, use)
2351
+ : undefined;
2352
+ }
2353
+ return obj;
2354
+ },
2355
+ create(base) {
2356
+ return exports.CapacityInterval.fromPartial(base ?? {});
2357
+ },
2358
+ fromPartial(object) {
2359
+ const message = createBaseCapacityInterval();
2360
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
2361
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
2362
+ : undefined;
2363
+ message.spec = (object.spec !== undefined && object.spec !== null)
2364
+ ? exports.CapacityIntervalSpec.fromPartial(object.spec)
2365
+ : undefined;
2366
+ message.status = (object.status !== undefined && object.status !== null)
2367
+ ? exports.CapacityIntervalStatus.fromPartial(object.status)
2368
+ : undefined;
2369
+ return message;
2370
+ },
2371
+ };
2372
+ protobuf_1.protoRegistry.registerMessage(exports.CapacityInterval);
2373
+ function CapacityIntervalCustomInspect() {
2374
+ const parts = [];
2375
+ if (this.metadata !== undefined)
2376
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
2377
+ if (this.spec !== undefined)
2378
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
2379
+ if (this.status !== undefined)
2380
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
2381
+ return `${this.$type}(${parts.join(", ")})`;
2382
+ }
2383
+ function CapacityIntervalCustomJson() {
2384
+ const obj = {
2385
+ type: this.$type,
2386
+ };
2387
+ if (this.metadata !== undefined)
2388
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
2389
+ if (this.spec !== undefined)
2390
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
2391
+ if (this.status !== undefined)
2392
+ obj.status = (0, logging_1.inspectJson)(this.status);
2393
+ return obj;
2394
+ }
2395
+ function applyCapacityIntervalCustom(message) {
2396
+ message[logging_1.custom] = CapacityIntervalCustomInspect;
2397
+ message[logging_1.customJson] = CapacityIntervalCustomJson;
2398
+ return message;
2399
+ }
2400
+ function createBaseCapacityInterval() {
2401
+ const message = {
2402
+ $type: "nebius.capacity.v1.CapacityInterval",
2403
+ metadata: undefined,
2404
+ spec: undefined,
2405
+ status: undefined,
2406
+ };
2407
+ return applyCapacityIntervalCustom(message);
2408
+ }
2409
+ exports.ResourceAffinityComputeV1 = {
2410
+ $type: "nebius.capacity.v1.ResourceAffinityComputeV1",
2411
+ encode(message, writer = new index_1.BinaryWriter()) {
2412
+ if (message.fabric !== "") {
2413
+ writer.uint32(10).string(message.fabric);
2414
+ }
2415
+ if (message.platform !== "") {
2416
+ writer.uint32(18).string(message.platform);
2417
+ }
2418
+ if (message[index_1.unknownFieldsSymbol]) {
2419
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2420
+ }
2421
+ return writer;
2422
+ },
2423
+ decode(input, length) {
2424
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2425
+ const end = length === undefined ? reader.len : reader.pos + length;
2426
+ const message = createBaseResourceAffinityComputeV1();
2427
+ let writer = undefined;
2428
+ while (reader.pos < end) {
2429
+ const tag = reader.uint32();
2430
+ switch (tag >>> 3) {
2431
+ case 1: {
2432
+ if (tag !== 10)
2433
+ break;
2434
+ message.fabric = reader.string();
2435
+ continue;
2436
+ }
2437
+ case 2: {
2438
+ if (tag !== 18)
2439
+ break;
2440
+ message.platform = reader.string();
2441
+ continue;
2442
+ }
2443
+ default:
2444
+ break;
2445
+ }
2446
+ if ((tag & 7) === 4 || tag === 0) {
2447
+ break;
2448
+ }
2449
+ {
2450
+ if (!writer)
2451
+ writer = new index_1.BinaryWriter();
2452
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2453
+ writer.uint32(tag).raw(skipped);
2454
+ }
2455
+ }
2456
+ if (writer) {
2457
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2458
+ }
2459
+ return message;
2460
+ },
2461
+ fromJSON(object) {
2462
+ return applyResourceAffinityComputeV1Custom({
2463
+ $type: "nebius.capacity.v1.ResourceAffinityComputeV1",
2464
+ fabric: (0, index_1.isSet)(object.fabric ?? object.fabric)
2465
+ ? String(object.fabric ?? object.fabric)
2466
+ : "",
2467
+ platform: (0, index_1.isSet)(object.platform ?? object.platform)
2468
+ ? String(object.platform ?? object.platform)
2469
+ : "",
2470
+ });
2471
+ },
2472
+ toJSON(message, use = "json") {
2473
+ const obj = {};
2474
+ const pick = (json, pb) => (use === "json" ? json : pb);
2475
+ if (message.fabric !== "") {
2476
+ obj[pick("fabric", "fabric")] = message.fabric;
2477
+ }
2478
+ if (message.platform !== "") {
2479
+ obj[pick("platform", "platform")] = message.platform;
2480
+ }
2481
+ return obj;
2482
+ },
2483
+ create(base) {
2484
+ return exports.ResourceAffinityComputeV1.fromPartial(base ?? {});
2485
+ },
2486
+ fromPartial(object) {
2487
+ const message = createBaseResourceAffinityComputeV1();
2488
+ message.fabric = (object.fabric !== undefined && object.fabric !== null)
2489
+ ? object.fabric
2490
+ : "";
2491
+ message.platform = (object.platform !== undefined && object.platform !== null)
2492
+ ? object.platform
2493
+ : "";
2494
+ return message;
2495
+ },
2496
+ };
2497
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAffinityComputeV1);
2498
+ function ResourceAffinityComputeV1CustomInspect() {
2499
+ const parts = [];
2500
+ if (this.fabric !== "")
2501
+ parts.push("fabric" + "=" + (0, util_1.inspect)(this.fabric));
2502
+ if (this.platform !== "")
2503
+ parts.push("platform" + "=" + (0, util_1.inspect)(this.platform));
2504
+ return `${this.$type}(${parts.join(", ")})`;
2505
+ }
2506
+ function ResourceAffinityComputeV1CustomJson() {
2507
+ const obj = {
2508
+ type: this.$type,
2509
+ };
2510
+ if (this.fabric !== "")
2511
+ obj.fabric = (0, logging_1.inspectJson)(this.fabric);
2512
+ if (this.platform !== "")
2513
+ obj.platform = (0, logging_1.inspectJson)(this.platform);
2514
+ return obj;
2515
+ }
2516
+ function applyResourceAffinityComputeV1Custom(message) {
2517
+ message[logging_1.custom] = ResourceAffinityComputeV1CustomInspect;
2518
+ message[logging_1.customJson] = ResourceAffinityComputeV1CustomJson;
2519
+ return message;
2520
+ }
2521
+ function createBaseResourceAffinityComputeV1() {
2522
+ const message = {
2523
+ $type: "nebius.capacity.v1.ResourceAffinityComputeV1",
2524
+ fabric: "",
2525
+ platform: "",
2526
+ };
2527
+ return applyResourceAffinityComputeV1Custom(message);
2528
+ }
2529
+ exports.ResourceAffinity = {
2530
+ $type: "nebius.capacity.v1.ResourceAffinity",
2531
+ encode(message, writer = new index_1.BinaryWriter()) {
2532
+ if (message.versions?.$case === undefined) { /* noop */ }
2533
+ else if (message.versions?.$case === "computeV1") {
2534
+ const w = writer.uint32(10).fork();
2535
+ exports.ResourceAffinityComputeV1.encode(message.versions.computeV1, w);
2536
+ w.join();
2537
+ }
2538
+ if (message[index_1.unknownFieldsSymbol]) {
2539
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2540
+ }
2541
+ return writer;
2542
+ },
2543
+ decode(input, length) {
2544
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2545
+ const end = length === undefined ? reader.len : reader.pos + length;
2546
+ const message = createBaseResourceAffinity();
2547
+ let writer = undefined;
2548
+ while (reader.pos < end) {
2549
+ const tag = reader.uint32();
2550
+ switch (tag >>> 3) {
2551
+ case 1: {
2552
+ if (tag !== 10)
2553
+ break;
2554
+ message.versions = {
2555
+ $case: "computeV1",
2556
+ computeV1: exports.ResourceAffinityComputeV1.decode(reader, reader.uint32())
2557
+ };
2558
+ continue;
2559
+ }
2560
+ default:
2561
+ break;
2562
+ }
2563
+ if ((tag & 7) === 4 || tag === 0) {
2564
+ break;
2565
+ }
2566
+ {
2567
+ if (!writer)
2568
+ writer = new index_1.BinaryWriter();
2569
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2570
+ writer.uint32(tag).raw(skipped);
2571
+ }
2572
+ }
2573
+ if (writer) {
2574
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2575
+ }
2576
+ return message;
2577
+ },
2578
+ fromJSON(object) {
2579
+ return applyResourceAffinityCustom({
2580
+ $type: "nebius.capacity.v1.ResourceAffinity",
2581
+ versions: (() => {
2582
+ if ((0, index_1.isSet)(object.computeV1) || (0, index_1.isSet)(object.compute_v1)) {
2583
+ return {
2584
+ $case: "computeV1",
2585
+ computeV1: exports.ResourceAffinityComputeV1.fromJSON(object.computeV1 ?? object.compute_v1)
2586
+ };
2587
+ }
2588
+ return undefined;
2589
+ })(),
2590
+ });
2591
+ },
2592
+ toJSON(message, use = "json") {
2593
+ const obj = {};
2594
+ const pick = (json, pb) => (use === "json" ? json : pb);
2595
+ switch (message.versions?.$case) {
2596
+ case "computeV1": {
2597
+ obj[pick("computeV1", "compute_v1")] = exports.ResourceAffinityComputeV1.toJSON(message.versions.computeV1, use);
2598
+ break;
2599
+ }
2600
+ default: break;
2601
+ }
2602
+ return obj;
2603
+ },
2604
+ create(base) {
2605
+ return exports.ResourceAffinity.fromPartial(base ?? {});
2606
+ },
2607
+ fromPartial(object) {
2608
+ const message = createBaseResourceAffinity();
2609
+ switch (object.versions?.$case) {
2610
+ case "computeV1": {
2611
+ if (object.versions.computeV1 !== undefined && object.versions.computeV1 !== null) {
2612
+ message.versions = {
2613
+ $case: "computeV1",
2614
+ computeV1: exports.ResourceAffinityComputeV1.fromPartial(object.versions.computeV1),
2615
+ };
2616
+ }
2617
+ break;
2618
+ }
2619
+ default: break;
2620
+ }
2621
+ return message;
2622
+ },
2623
+ };
2624
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAffinity);
2625
+ function ResourceAffinityCustomInspect() {
2626
+ const parts = [];
2627
+ return `${this.$type}(${parts.join(", ")})`;
2628
+ }
2629
+ function ResourceAffinityCustomJson() {
2630
+ const obj = {
2631
+ type: this.$type,
2632
+ };
2633
+ return obj;
2634
+ }
2635
+ function applyResourceAffinityCustom(message) {
2636
+ message[logging_1.custom] = ResourceAffinityCustomInspect;
2637
+ message[logging_1.customJson] = ResourceAffinityCustomJson;
2638
+ return message;
2639
+ }
2640
+ function createBaseResourceAffinity() {
2641
+ const message = {
2642
+ $type: "nebius.capacity.v1.ResourceAffinity",
2643
+ versions: undefined,
2644
+ };
2645
+ return applyResourceAffinityCustom(message);
2646
+ }
2647
+ //# sourceMappingURL=index.js.map