@nebius/js-sdk 0.2.16 → 0.2.17

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.
Files changed (41) hide show
  1. package/dist/cjs/api/nebius/audit/v2/index.d.ts +31 -0
  2. package/dist/cjs/api/nebius/audit/v2/index.d.ts.map +1 -1
  3. package/dist/cjs/api/nebius/audit/v2/index.js +69 -0
  4. package/dist/cjs/api/nebius/audit/v2/index.js.map +1 -1
  5. package/dist/cjs/api/nebius/billing/v1/index.d.ts +450 -0
  6. package/dist/cjs/api/nebius/billing/v1/index.d.ts.map +1 -0
  7. package/dist/cjs/api/nebius/billing/v1/index.js +2182 -0
  8. package/dist/cjs/api/nebius/billing/v1/index.js.map +1 -0
  9. package/dist/cjs/api/nebius/billing/v1.d.ts +1 -0
  10. package/dist/cjs/api/nebius/billing/v1.js +2 -0
  11. package/dist/cjs/api/nebius/compute/v1/index.d.ts +8 -0
  12. package/dist/cjs/api/nebius/compute/v1/index.d.ts.map +1 -1
  13. package/dist/cjs/api/nebius/compute/v1/index.js +23 -0
  14. package/dist/cjs/api/nebius/compute/v1/index.js.map +1 -1
  15. package/dist/cjs/api/nebius/mk8s/v1/index.d.ts +8 -0
  16. package/dist/cjs/api/nebius/mk8s/v1/index.d.ts.map +1 -1
  17. package/dist/cjs/api/nebius/mk8s/v1/index.js +23 -0
  18. package/dist/cjs/api/nebius/mk8s/v1/index.js.map +1 -1
  19. package/dist/cjs/version.d.ts +1 -1
  20. package/dist/cjs/version.js +1 -1
  21. package/dist/esm/api/nebius/audit/v2/index.d.ts +31 -0
  22. package/dist/esm/api/nebius/audit/v2/index.d.ts.map +1 -1
  23. package/dist/esm/api/nebius/audit/v2/index.js +69 -0
  24. package/dist/esm/api/nebius/audit/v2/index.js.map +1 -1
  25. package/dist/esm/api/nebius/billing/v1/index.d.ts +450 -0
  26. package/dist/esm/api/nebius/billing/v1/index.d.ts.map +1 -0
  27. package/dist/esm/api/nebius/billing/v1/index.js +2178 -0
  28. package/dist/esm/api/nebius/billing/v1/index.js.map +1 -0
  29. package/dist/esm/api/nebius/billing/v1.d.ts +1 -0
  30. package/dist/esm/api/nebius/billing/v1.js +1 -0
  31. package/dist/esm/api/nebius/compute/v1/index.d.ts +8 -0
  32. package/dist/esm/api/nebius/compute/v1/index.d.ts.map +1 -1
  33. package/dist/esm/api/nebius/compute/v1/index.js +23 -0
  34. package/dist/esm/api/nebius/compute/v1/index.js.map +1 -1
  35. package/dist/esm/api/nebius/mk8s/v1/index.d.ts +8 -0
  36. package/dist/esm/api/nebius/mk8s/v1/index.d.ts.map +1 -1
  37. package/dist/esm/api/nebius/mk8s/v1/index.js +23 -0
  38. package/dist/esm/api/nebius/mk8s/v1/index.js.map +1 -1
  39. package/dist/esm/version.d.ts +1 -1
  40. package/dist/esm/version.js +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,2182 @@
1
+ "use strict";
2
+ /* Generated by Nebius TS generator. DO NOT EDIT! */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.OfferType = exports.AggregationUnit = exports.FilterAggregationUnit = exports.TotalCost = exports.SkuCost = exports.CostBreakdown = exports.AutoscaleResourceCost = exports.FixedInstanceResourceCost = exports.GeneralResourceCost = exports.ResourceCost = exports.RangeTotalCost = exports.GeneralTotalCost = exports.ResourceSpec = exports.AggregationUnit_UnitType = exports.FilterAggregationUnit_FilterAggregationUnitValue = exports.CalculatorService = exports.CalculatorServiceBaseClient = exports.CalculatorServiceServiceDescription = exports.EstimateBatchResponse = exports.EstimateBatchRequest = void 0;
5
+ const index_js_1 = require("../../../../runtime/protos/index.js");
6
+ const util_1 = require("util");
7
+ const protobuf_js_1 = require("../../../protobuf.js");
8
+ const logging_js_1 = require("../../../../runtime/util/logging.js");
9
+ const grpc_js_1 = require("@grpc/grpc-js");
10
+ const request_js_1 = require("../../../../runtime/request.js");
11
+ const index_js_2 = require("../../common/v1/index.js");
12
+ const __deprecatedWarned = new Set();
13
+ exports.EstimateBatchRequest = {
14
+ $type: "nebius.billing.v1.EstimateBatchRequest",
15
+ encode(message, writer = new index_js_1.BinaryWriter()) {
16
+ for (const v of (message.resourceSpecs ?? [])) {
17
+ const w = writer.uint32(10).fork();
18
+ exports.ResourceSpec.encode(v, w);
19
+ w.join();
20
+ }
21
+ if (message.offerTypes?.length) {
22
+ const w = writer.uint32(82).fork();
23
+ for (const v of message.offerTypes)
24
+ w.int32(v?.code | 0);
25
+ w.join();
26
+ }
27
+ if (message.currency !== "") {
28
+ writer.uint32(90).string(message.currency);
29
+ }
30
+ if (message.filterAggregationUnit !== undefined) {
31
+ const w = writer.uint32(162).fork();
32
+ exports.FilterAggregationUnit.encode(message.filterAggregationUnit, w);
33
+ w.join();
34
+ }
35
+ if (message[index_js_1.unknownFieldsSymbol]) {
36
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
37
+ }
38
+ return writer;
39
+ },
40
+ decode(input, length) {
41
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
42
+ const end = length === undefined ? reader.len : reader.pos + length;
43
+ const message = createBaseEstimateBatchRequest();
44
+ let writer = undefined;
45
+ while (reader.pos < end) {
46
+ const tag = reader.uint32();
47
+ switch (tag >>> 3) {
48
+ case 1: {
49
+ if (tag !== 10)
50
+ break;
51
+ message.resourceSpecs.push(exports.ResourceSpec.decode(reader, reader.uint32()));
52
+ continue;
53
+ }
54
+ case 10: {
55
+ // packed or unpacked repeated enum
56
+ if ((tag & 7) === 2) {
57
+ const end2 = reader.uint32() + reader.pos;
58
+ while (reader.pos < end2) {
59
+ message.offerTypes.push(exports.OfferType.fromNumber(reader.int32()));
60
+ }
61
+ continue;
62
+ }
63
+ else if ((tag & 7) === 0) {
64
+ message.offerTypes.push(exports.OfferType.fromNumber(reader.int32()));
65
+ continue;
66
+ }
67
+ break; // wrong wire type
68
+ }
69
+ case 11: {
70
+ if (tag !== 90)
71
+ break;
72
+ message.currency = reader.string();
73
+ continue;
74
+ }
75
+ case 20: {
76
+ if (tag !== 162)
77
+ break;
78
+ message.filterAggregationUnit = exports.FilterAggregationUnit.decode(reader, reader.uint32());
79
+ continue;
80
+ }
81
+ default:
82
+ break;
83
+ }
84
+ if ((tag & 7) === 4 || tag === 0) {
85
+ break;
86
+ }
87
+ {
88
+ if (!writer)
89
+ writer = new index_js_1.BinaryWriter();
90
+ const skipped = reader.skip(tag & 7, tag >>> 3);
91
+ writer.uint32(tag).raw(skipped);
92
+ }
93
+ }
94
+ if (writer) {
95
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
96
+ }
97
+ return message;
98
+ },
99
+ fromJSON(object) {
100
+ return applyEstimateBatchRequestCustom({
101
+ $type: "nebius.billing.v1.EstimateBatchRequest",
102
+ resourceSpecs: globalThis.Array.isArray(object?.resourceSpecs ?? object?.resource_specs)
103
+ ? (object.resourceSpecs ?? object.resource_specs).map((e) => exports.ResourceSpec.fromJSON(e))
104
+ : [],
105
+ offerTypes: globalThis.Array.isArray(object?.offerTypes ?? object?.offer_types)
106
+ ? (object.offerTypes ?? object.offer_types).map((e) => exports.OfferType.fromJSON(e))
107
+ : [],
108
+ currency: (0, index_js_1.isSet)(object.currency ?? object.currency)
109
+ ? String(object.currency ?? object.currency)
110
+ : "",
111
+ filterAggregationUnit: (0, index_js_1.isSet)(object.filterAggregationUnit ?? object.filter_aggregation_unit)
112
+ ? exports.FilterAggregationUnit.fromJSON(object.filterAggregationUnit ?? object.filter_aggregation_unit)
113
+ : undefined,
114
+ });
115
+ },
116
+ toJSON(message, use = "json") {
117
+ const obj = {};
118
+ const pick = (json, pb) => (use === "json" ? json : pb);
119
+ if (message.resourceSpecs?.length) {
120
+ obj[pick("resourceSpecs", "resource_specs")] = message.resourceSpecs.map((e) => e ? exports.ResourceSpec.toJSON(e, use) : undefined);
121
+ }
122
+ if (message.offerTypes?.length) {
123
+ obj[pick("offerTypes", "offer_types")] = message.offerTypes.map((e) => exports.OfferType.toJSON(e));
124
+ }
125
+ if (message.currency !== "") {
126
+ obj[pick("currency", "currency")] = message.currency;
127
+ }
128
+ if (message.filterAggregationUnit !== undefined) {
129
+ obj[pick("filterAggregationUnit", "filter_aggregation_unit")] = message.filterAggregationUnit
130
+ ? exports.FilterAggregationUnit.toJSON(message.filterAggregationUnit, use)
131
+ : undefined;
132
+ }
133
+ return obj;
134
+ },
135
+ create(base) {
136
+ return exports.EstimateBatchRequest.fromPartial(base ?? {});
137
+ },
138
+ fromPartial(object) {
139
+ const message = createBaseEstimateBatchRequest();
140
+ message.resourceSpecs = object.resourceSpecs?.map((e) => exports.ResourceSpec.fromPartial(e)) || [];
141
+ message.offerTypes = object.offerTypes?.map((e) => exports.OfferType.fromJSON(e.name)) || [];
142
+ message.currency = (object.currency !== undefined && object.currency !== null)
143
+ ? object.currency
144
+ : "";
145
+ message.filterAggregationUnit = (object.filterAggregationUnit !== undefined && object.filterAggregationUnit !== null)
146
+ ? exports.FilterAggregationUnit.fromPartial(object.filterAggregationUnit)
147
+ : undefined;
148
+ return message;
149
+ },
150
+ };
151
+ protobuf_js_1.protoRegistry.registerMessage(exports.EstimateBatchRequest);
152
+ function EstimateBatchRequestCustomInspect() {
153
+ const parts = [];
154
+ if ((this.resourceSpecs?.length ?? 0) !== 0)
155
+ parts.push("resourceSpecs" + "=" + (0, util_1.inspect)(this.resourceSpecs));
156
+ if ((this.offerTypes?.length ?? 0) !== 0)
157
+ parts.push("offerTypes" + "=" + (0, util_1.inspect)(this.offerTypes));
158
+ if (this.currency !== "")
159
+ parts.push("currency" + "=" + (0, util_1.inspect)(this.currency));
160
+ if (this.filterAggregationUnit !== undefined)
161
+ parts.push("filterAggregationUnit" + "=" + (0, util_1.inspect)(this.filterAggregationUnit));
162
+ return `${this.$type}(${parts.join(", ")})`;
163
+ }
164
+ function EstimateBatchRequestCustomJson() {
165
+ const obj = {
166
+ type: this.$type,
167
+ };
168
+ if ((this.resourceSpecs?.length ?? 0) !== 0)
169
+ obj.resourceSpecs = (0, logging_js_1.inspectJson)(this.resourceSpecs);
170
+ if ((this.offerTypes?.length ?? 0) !== 0)
171
+ obj.offerTypes = (0, logging_js_1.inspectJson)(this.offerTypes);
172
+ if (this.currency !== "")
173
+ obj.currency = (0, logging_js_1.inspectJson)(this.currency);
174
+ if (this.filterAggregationUnit !== undefined)
175
+ obj.filterAggregationUnit = (0, logging_js_1.inspectJson)(this.filterAggregationUnit);
176
+ return obj;
177
+ }
178
+ function applyEstimateBatchRequestCustom(message) {
179
+ message[logging_js_1.custom] = EstimateBatchRequestCustomInspect;
180
+ message[logging_js_1.customJson] = EstimateBatchRequestCustomJson;
181
+ return message;
182
+ }
183
+ function createBaseEstimateBatchRequest() {
184
+ const message = {
185
+ $type: "nebius.billing.v1.EstimateBatchRequest",
186
+ resourceSpecs: [],
187
+ offerTypes: [],
188
+ currency: "",
189
+ filterAggregationUnit: undefined,
190
+ };
191
+ return applyEstimateBatchRequestCustom(message);
192
+ }
193
+ exports.EstimateBatchResponse = {
194
+ $type: "nebius.billing.v1.EstimateBatchResponse",
195
+ encode(message, writer = new index_js_1.BinaryWriter()) {
196
+ for (const v of (message.resourceCosts ?? [])) {
197
+ const w = writer.uint32(10).fork();
198
+ exports.ResourceCost.encode(v, w);
199
+ w.join();
200
+ }
201
+ for (const v of (message.totalCosts ?? [])) {
202
+ const w = writer.uint32(82).fork();
203
+ exports.TotalCost.encode(v, w);
204
+ w.join();
205
+ }
206
+ if (message.currency !== "") {
207
+ writer.uint32(162).string(message.currency);
208
+ }
209
+ if (message[index_js_1.unknownFieldsSymbol]) {
210
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
211
+ }
212
+ return writer;
213
+ },
214
+ decode(input, length) {
215
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
216
+ const end = length === undefined ? reader.len : reader.pos + length;
217
+ const message = createBaseEstimateBatchResponse();
218
+ let writer = undefined;
219
+ while (reader.pos < end) {
220
+ const tag = reader.uint32();
221
+ switch (tag >>> 3) {
222
+ case 1: {
223
+ if (tag !== 10)
224
+ break;
225
+ message.resourceCosts.push(exports.ResourceCost.decode(reader, reader.uint32()));
226
+ continue;
227
+ }
228
+ case 10: {
229
+ if (tag !== 82)
230
+ break;
231
+ message.totalCosts.push(exports.TotalCost.decode(reader, reader.uint32()));
232
+ continue;
233
+ }
234
+ case 20: {
235
+ if (tag !== 162)
236
+ break;
237
+ message.currency = reader.string();
238
+ continue;
239
+ }
240
+ default:
241
+ break;
242
+ }
243
+ if ((tag & 7) === 4 || tag === 0) {
244
+ break;
245
+ }
246
+ {
247
+ if (!writer)
248
+ writer = new index_js_1.BinaryWriter();
249
+ const skipped = reader.skip(tag & 7, tag >>> 3);
250
+ writer.uint32(tag).raw(skipped);
251
+ }
252
+ }
253
+ if (writer) {
254
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
255
+ }
256
+ return message;
257
+ },
258
+ fromJSON(object) {
259
+ return applyEstimateBatchResponseCustom({
260
+ $type: "nebius.billing.v1.EstimateBatchResponse",
261
+ resourceCosts: globalThis.Array.isArray(object?.resourceCosts ?? object?.resource_costs)
262
+ ? (object.resourceCosts ?? object.resource_costs).map((e) => exports.ResourceCost.fromJSON(e))
263
+ : [],
264
+ totalCosts: globalThis.Array.isArray(object?.totalCosts ?? object?.total_costs)
265
+ ? (object.totalCosts ?? object.total_costs).map((e) => exports.TotalCost.fromJSON(e))
266
+ : [],
267
+ currency: (0, index_js_1.isSet)(object.currency ?? object.currency)
268
+ ? String(object.currency ?? object.currency)
269
+ : "",
270
+ });
271
+ },
272
+ toJSON(message, use = "json") {
273
+ const obj = {};
274
+ const pick = (json, pb) => (use === "json" ? json : pb);
275
+ if (message.resourceCosts?.length) {
276
+ obj[pick("resourceCosts", "resource_costs")] = message.resourceCosts.map((e) => e ? exports.ResourceCost.toJSON(e, use) : undefined);
277
+ }
278
+ if (message.totalCosts?.length) {
279
+ obj[pick("totalCosts", "total_costs")] = message.totalCosts.map((e) => e ? exports.TotalCost.toJSON(e, use) : undefined);
280
+ }
281
+ if (message.currency !== "") {
282
+ obj[pick("currency", "currency")] = message.currency;
283
+ }
284
+ return obj;
285
+ },
286
+ create(base) {
287
+ return exports.EstimateBatchResponse.fromPartial(base ?? {});
288
+ },
289
+ fromPartial(object) {
290
+ const message = createBaseEstimateBatchResponse();
291
+ message.resourceCosts = object.resourceCosts?.map((e) => exports.ResourceCost.fromPartial(e)) || [];
292
+ message.totalCosts = object.totalCosts?.map((e) => exports.TotalCost.fromPartial(e)) || [];
293
+ message.currency = (object.currency !== undefined && object.currency !== null)
294
+ ? object.currency
295
+ : "";
296
+ return message;
297
+ },
298
+ };
299
+ protobuf_js_1.protoRegistry.registerMessage(exports.EstimateBatchResponse);
300
+ function EstimateBatchResponseCustomInspect() {
301
+ const parts = [];
302
+ if ((this.resourceCosts?.length ?? 0) !== 0)
303
+ parts.push("resourceCosts" + "=" + (0, util_1.inspect)(this.resourceCosts));
304
+ if ((this.totalCosts?.length ?? 0) !== 0)
305
+ parts.push("totalCosts" + "=" + (0, util_1.inspect)(this.totalCosts));
306
+ if (this.currency !== "")
307
+ parts.push("currency" + "=" + (0, util_1.inspect)(this.currency));
308
+ return `${this.$type}(${parts.join(", ")})`;
309
+ }
310
+ function EstimateBatchResponseCustomJson() {
311
+ const obj = {
312
+ type: this.$type,
313
+ };
314
+ if ((this.resourceCosts?.length ?? 0) !== 0)
315
+ obj.resourceCosts = (0, logging_js_1.inspectJson)(this.resourceCosts);
316
+ if ((this.totalCosts?.length ?? 0) !== 0)
317
+ obj.totalCosts = (0, logging_js_1.inspectJson)(this.totalCosts);
318
+ if (this.currency !== "")
319
+ obj.currency = (0, logging_js_1.inspectJson)(this.currency);
320
+ return obj;
321
+ }
322
+ function applyEstimateBatchResponseCustom(message) {
323
+ message[logging_js_1.custom] = EstimateBatchResponseCustomInspect;
324
+ message[logging_js_1.customJson] = EstimateBatchResponseCustomJson;
325
+ return message;
326
+ }
327
+ function createBaseEstimateBatchResponse() {
328
+ const message = {
329
+ $type: "nebius.billing.v1.EstimateBatchResponse",
330
+ resourceCosts: [],
331
+ totalCosts: [],
332
+ currency: "",
333
+ };
334
+ return applyEstimateBatchResponseCustom(message);
335
+ }
336
+ exports.CalculatorServiceServiceDescription = {
337
+ estimateBatch: {
338
+ path: "/nebius.billing.v1.CalculatorService/EstimateBatch",
339
+ requestStream: false,
340
+ responseStream: false,
341
+ requestSerialize: (value) => Buffer.from(exports.EstimateBatchRequest.encode(value).finish()),
342
+ sendResetMask: false,
343
+ requestDeserialize: (value) => exports.EstimateBatchRequest.decode(value),
344
+ responseSerialize: (value) => Buffer.from(exports.EstimateBatchResponse.encode(value).finish()),
345
+ responseDeserialize: (value) => exports.EstimateBatchResponse.decode(value),
346
+ },
347
+ };
348
+ exports.CalculatorServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.CalculatorServiceServiceDescription, "nebius.billing.v1.CalculatorService");
349
+ class CalculatorService {
350
+ sdk;
351
+ $type = "nebius.billing.v1.CalculatorService";
352
+ addr;
353
+ spec;
354
+ apiServiceName = "api.calculator.billing-data-plane";
355
+ constructor(sdk) {
356
+ this.sdk = sdk;
357
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
358
+ this.addr = addr;
359
+ this.spec = exports.CalculatorServiceServiceDescription;
360
+ }
361
+ estimateBatch(...args) {
362
+ const spec = this.spec.estimateBatch;
363
+ const request = args[0];
364
+ const metadata = (args.length > 1 ? args[1] : undefined);
365
+ const options = (args.length > 2 ? args[2] : undefined);
366
+ const deserialize = spec.responseDeserialize;
367
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
368
+ }
369
+ }
370
+ exports.CalculatorService = CalculatorService;
371
+ exports.FilterAggregationUnit_FilterAggregationUnitValue = (0, index_js_1.createEnum)("nebius.billing.v1.FilterAggregationUnit.FilterAggregationUnitValue", {
372
+ FILTER_AGGREGATION_UNIT_UNSPECIFIED: 0,
373
+ FILTER_AGGREGATION_UNIT_MINUTE: 1,
374
+ FILTER_AGGREGATION_UNIT_HOUR: 2,
375
+ FILTER_AGGREGATION_UNIT_DAY: 3,
376
+ FILTER_AGGREGATION_UNIT_WEEK: 4,
377
+ FILTER_AGGREGATION_UNIT_MONTH: 5,
378
+ });
379
+ protobuf_js_1.protoRegistry.registerEnum(exports.FilterAggregationUnit_FilterAggregationUnitValue);
380
+ exports.AggregationUnit_UnitType = (0, index_js_1.createEnum)("nebius.billing.v1.AggregationUnit.UnitType", {
381
+ UNIT_TYPE_UNSPECIFIED: 0,
382
+ UNIT_TYPE_TIME_BASED: 1,
383
+ UNIT_TYPE_USAGE_BASED: 2,
384
+ });
385
+ protobuf_js_1.protoRegistry.registerEnum(exports.AggregationUnit_UnitType);
386
+ exports.ResourceSpec = {
387
+ $type: "nebius.billing.v1.ResourceSpec",
388
+ encode(message, writer = new index_js_1.BinaryWriter()) {
389
+ if (message.spec !== undefined) {
390
+ const w = writer.uint32(10).fork();
391
+ index_js_1.wkt[".google.protobuf.Any"].writeMessage(w, message.spec);
392
+ w.join();
393
+ }
394
+ if (message[index_js_1.unknownFieldsSymbol]) {
395
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
396
+ }
397
+ return writer;
398
+ },
399
+ decode(input, length) {
400
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
401
+ const end = length === undefined ? reader.len : reader.pos + length;
402
+ const message = createBaseResourceSpec();
403
+ let writer = undefined;
404
+ while (reader.pos < end) {
405
+ const tag = reader.uint32();
406
+ switch (tag >>> 3) {
407
+ case 1: {
408
+ if (tag !== 10)
409
+ break;
410
+ const len = reader.uint32();
411
+ message.spec = index_js_1.wkt[".google.protobuf.Any"].readMessage(reader, len);
412
+ continue;
413
+ }
414
+ default:
415
+ break;
416
+ }
417
+ if ((tag & 7) === 4 || tag === 0) {
418
+ break;
419
+ }
420
+ {
421
+ if (!writer)
422
+ writer = new index_js_1.BinaryWriter();
423
+ const skipped = reader.skip(tag & 7, tag >>> 3);
424
+ writer.uint32(tag).raw(skipped);
425
+ }
426
+ }
427
+ if (writer) {
428
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
429
+ }
430
+ return message;
431
+ },
432
+ fromJSON(object) {
433
+ return applyResourceSpecCustom({
434
+ $type: "nebius.billing.v1.ResourceSpec",
435
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
436
+ ? index_js_1.wkt[".google.protobuf.Any"].fromJSON(object.spec ?? object.spec)
437
+ : undefined,
438
+ });
439
+ },
440
+ toJSON(message, use = "json") {
441
+ const obj = {};
442
+ const pick = (json, pb) => (use === "json" ? json : pb);
443
+ if (message.spec !== undefined) {
444
+ obj[pick("spec", "spec")] = index_js_1.wkt[".google.protobuf.Any"].toJSON(message.spec, use);
445
+ }
446
+ return obj;
447
+ },
448
+ create(base) {
449
+ return exports.ResourceSpec.fromPartial(base ?? {});
450
+ },
451
+ fromPartial(object) {
452
+ const message = createBaseResourceSpec();
453
+ message.spec = (object.spec !== undefined && object.spec !== null)
454
+ ? index_js_1.wkt[".google.protobuf.Any"].fromPartial(object.spec)
455
+ : undefined;
456
+ return message;
457
+ },
458
+ };
459
+ protobuf_js_1.protoRegistry.registerMessage(exports.ResourceSpec);
460
+ function ResourceSpecCustomInspect() {
461
+ const parts = [];
462
+ if (this.spec !== undefined)
463
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
464
+ return `${this.$type}(${parts.join(", ")})`;
465
+ }
466
+ function ResourceSpecCustomJson() {
467
+ const obj = {
468
+ type: this.$type,
469
+ };
470
+ if (this.spec !== undefined)
471
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
472
+ return obj;
473
+ }
474
+ function applyResourceSpecCustom(message) {
475
+ message[logging_js_1.custom] = ResourceSpecCustomInspect;
476
+ message[logging_js_1.customJson] = ResourceSpecCustomJson;
477
+ return message;
478
+ }
479
+ function createBaseResourceSpec() {
480
+ const message = {
481
+ $type: "nebius.billing.v1.ResourceSpec",
482
+ spec: undefined,
483
+ };
484
+ return applyResourceSpecCustom(message);
485
+ }
486
+ exports.GeneralTotalCost = {
487
+ $type: "nebius.billing.v1.GeneralTotalCost",
488
+ encode(message, writer = new index_js_1.BinaryWriter()) {
489
+ if (message.total !== undefined) {
490
+ const w = writer.uint32(10).fork();
491
+ exports.CostBreakdown.encode(message.total, w);
492
+ w.join();
493
+ }
494
+ if (message[index_js_1.unknownFieldsSymbol]) {
495
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
496
+ }
497
+ return writer;
498
+ },
499
+ decode(input, length) {
500
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
501
+ const end = length === undefined ? reader.len : reader.pos + length;
502
+ const message = createBaseGeneralTotalCost();
503
+ let writer = undefined;
504
+ while (reader.pos < end) {
505
+ const tag = reader.uint32();
506
+ switch (tag >>> 3) {
507
+ case 1: {
508
+ if (tag !== 10)
509
+ break;
510
+ message.total = exports.CostBreakdown.decode(reader, reader.uint32());
511
+ continue;
512
+ }
513
+ default:
514
+ break;
515
+ }
516
+ if ((tag & 7) === 4 || tag === 0) {
517
+ break;
518
+ }
519
+ {
520
+ if (!writer)
521
+ writer = new index_js_1.BinaryWriter();
522
+ const skipped = reader.skip(tag & 7, tag >>> 3);
523
+ writer.uint32(tag).raw(skipped);
524
+ }
525
+ }
526
+ if (writer) {
527
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
528
+ }
529
+ return message;
530
+ },
531
+ fromJSON(object) {
532
+ return applyGeneralTotalCostCustom({
533
+ $type: "nebius.billing.v1.GeneralTotalCost",
534
+ total: (0, index_js_1.isSet)(object.total ?? object.total)
535
+ ? exports.CostBreakdown.fromJSON(object.total ?? object.total)
536
+ : undefined,
537
+ });
538
+ },
539
+ toJSON(message, use = "json") {
540
+ const obj = {};
541
+ const pick = (json, pb) => (use === "json" ? json : pb);
542
+ if (message.total !== undefined) {
543
+ obj[pick("total", "total")] = message.total
544
+ ? exports.CostBreakdown.toJSON(message.total, use)
545
+ : undefined;
546
+ }
547
+ return obj;
548
+ },
549
+ create(base) {
550
+ return exports.GeneralTotalCost.fromPartial(base ?? {});
551
+ },
552
+ fromPartial(object) {
553
+ const message = createBaseGeneralTotalCost();
554
+ message.total = (object.total !== undefined && object.total !== null)
555
+ ? exports.CostBreakdown.fromPartial(object.total)
556
+ : undefined;
557
+ return message;
558
+ },
559
+ };
560
+ protobuf_js_1.protoRegistry.registerMessage(exports.GeneralTotalCost);
561
+ function GeneralTotalCostCustomInspect() {
562
+ const parts = [];
563
+ if (this.total !== undefined)
564
+ parts.push("total" + "=" + (0, util_1.inspect)(this.total));
565
+ return `${this.$type}(${parts.join(", ")})`;
566
+ }
567
+ function GeneralTotalCostCustomJson() {
568
+ const obj = {
569
+ type: this.$type,
570
+ };
571
+ if (this.total !== undefined)
572
+ obj.total = (0, logging_js_1.inspectJson)(this.total);
573
+ return obj;
574
+ }
575
+ function applyGeneralTotalCostCustom(message) {
576
+ message[logging_js_1.custom] = GeneralTotalCostCustomInspect;
577
+ message[logging_js_1.customJson] = GeneralTotalCostCustomJson;
578
+ return message;
579
+ }
580
+ function createBaseGeneralTotalCost() {
581
+ const message = {
582
+ $type: "nebius.billing.v1.GeneralTotalCost",
583
+ total: undefined,
584
+ };
585
+ return applyGeneralTotalCostCustom(message);
586
+ }
587
+ exports.RangeTotalCost = {
588
+ $type: "nebius.billing.v1.RangeTotalCost",
589
+ encode(message, writer = new index_js_1.BinaryWriter()) {
590
+ if (message.min !== undefined) {
591
+ const w = writer.uint32(10).fork();
592
+ exports.CostBreakdown.encode(message.min, w);
593
+ w.join();
594
+ }
595
+ if (message.max !== undefined) {
596
+ const w = writer.uint32(18).fork();
597
+ exports.CostBreakdown.encode(message.max, w);
598
+ w.join();
599
+ }
600
+ if (message[index_js_1.unknownFieldsSymbol]) {
601
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
602
+ }
603
+ return writer;
604
+ },
605
+ decode(input, length) {
606
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
607
+ const end = length === undefined ? reader.len : reader.pos + length;
608
+ const message = createBaseRangeTotalCost();
609
+ let writer = undefined;
610
+ while (reader.pos < end) {
611
+ const tag = reader.uint32();
612
+ switch (tag >>> 3) {
613
+ case 1: {
614
+ if (tag !== 10)
615
+ break;
616
+ message.min = exports.CostBreakdown.decode(reader, reader.uint32());
617
+ continue;
618
+ }
619
+ case 2: {
620
+ if (tag !== 18)
621
+ break;
622
+ message.max = exports.CostBreakdown.decode(reader, reader.uint32());
623
+ continue;
624
+ }
625
+ default:
626
+ break;
627
+ }
628
+ if ((tag & 7) === 4 || tag === 0) {
629
+ break;
630
+ }
631
+ {
632
+ if (!writer)
633
+ writer = new index_js_1.BinaryWriter();
634
+ const skipped = reader.skip(tag & 7, tag >>> 3);
635
+ writer.uint32(tag).raw(skipped);
636
+ }
637
+ }
638
+ if (writer) {
639
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
640
+ }
641
+ return message;
642
+ },
643
+ fromJSON(object) {
644
+ return applyRangeTotalCostCustom({
645
+ $type: "nebius.billing.v1.RangeTotalCost",
646
+ min: (0, index_js_1.isSet)(object.min ?? object.min)
647
+ ? exports.CostBreakdown.fromJSON(object.min ?? object.min)
648
+ : undefined,
649
+ max: (0, index_js_1.isSet)(object.max ?? object.max)
650
+ ? exports.CostBreakdown.fromJSON(object.max ?? object.max)
651
+ : undefined,
652
+ });
653
+ },
654
+ toJSON(message, use = "json") {
655
+ const obj = {};
656
+ const pick = (json, pb) => (use === "json" ? json : pb);
657
+ if (message.min !== undefined) {
658
+ obj[pick("min", "min")] = message.min
659
+ ? exports.CostBreakdown.toJSON(message.min, use)
660
+ : undefined;
661
+ }
662
+ if (message.max !== undefined) {
663
+ obj[pick("max", "max")] = message.max
664
+ ? exports.CostBreakdown.toJSON(message.max, use)
665
+ : undefined;
666
+ }
667
+ return obj;
668
+ },
669
+ create(base) {
670
+ return exports.RangeTotalCost.fromPartial(base ?? {});
671
+ },
672
+ fromPartial(object) {
673
+ const message = createBaseRangeTotalCost();
674
+ message.min = (object.min !== undefined && object.min !== null)
675
+ ? exports.CostBreakdown.fromPartial(object.min)
676
+ : undefined;
677
+ message.max = (object.max !== undefined && object.max !== null)
678
+ ? exports.CostBreakdown.fromPartial(object.max)
679
+ : undefined;
680
+ return message;
681
+ },
682
+ };
683
+ protobuf_js_1.protoRegistry.registerMessage(exports.RangeTotalCost);
684
+ function RangeTotalCostCustomInspect() {
685
+ const parts = [];
686
+ if (this.min !== undefined)
687
+ parts.push("min" + "=" + (0, util_1.inspect)(this.min));
688
+ if (this.max !== undefined)
689
+ parts.push("max" + "=" + (0, util_1.inspect)(this.max));
690
+ return `${this.$type}(${parts.join(", ")})`;
691
+ }
692
+ function RangeTotalCostCustomJson() {
693
+ const obj = {
694
+ type: this.$type,
695
+ };
696
+ if (this.min !== undefined)
697
+ obj.min = (0, logging_js_1.inspectJson)(this.min);
698
+ if (this.max !== undefined)
699
+ obj.max = (0, logging_js_1.inspectJson)(this.max);
700
+ return obj;
701
+ }
702
+ function applyRangeTotalCostCustom(message) {
703
+ message[logging_js_1.custom] = RangeTotalCostCustomInspect;
704
+ message[logging_js_1.customJson] = RangeTotalCostCustomJson;
705
+ return message;
706
+ }
707
+ function createBaseRangeTotalCost() {
708
+ const message = {
709
+ $type: "nebius.billing.v1.RangeTotalCost",
710
+ min: undefined,
711
+ max: undefined,
712
+ };
713
+ return applyRangeTotalCostCustom(message);
714
+ }
715
+ exports.ResourceCost = {
716
+ $type: "nebius.billing.v1.ResourceCost",
717
+ encode(message, writer = new index_js_1.BinaryWriter()) {
718
+ if (message.metadata !== undefined) {
719
+ const w = writer.uint32(10).fork();
720
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
721
+ w.join();
722
+ }
723
+ if (message.overrideMetadata !== undefined) {
724
+ const w = writer.uint32(18).fork();
725
+ index_js_2.ResourceMetadata.encode(message.overrideMetadata, w);
726
+ w.join();
727
+ }
728
+ if (message.aggregationUnit !== undefined) {
729
+ const w = writer.uint32(34).fork();
730
+ exports.AggregationUnit.encode(message.aggregationUnit, w);
731
+ w.join();
732
+ }
733
+ if (message.costType?.$case === undefined) { /* noop */ }
734
+ else if (message.costType?.$case === "general") {
735
+ const w = writer.uint32(162).fork();
736
+ exports.GeneralResourceCost.encode(message.costType.general, w);
737
+ w.join();
738
+ }
739
+ else if (message.costType?.$case === "fixedInstance") {
740
+ const w = writer.uint32(170).fork();
741
+ exports.FixedInstanceResourceCost.encode(message.costType.fixedInstance, w);
742
+ w.join();
743
+ }
744
+ else if (message.costType?.$case === "autoscale") {
745
+ const w = writer.uint32(178).fork();
746
+ exports.AutoscaleResourceCost.encode(message.costType.autoscale, w);
747
+ w.join();
748
+ }
749
+ if (message[index_js_1.unknownFieldsSymbol]) {
750
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
751
+ }
752
+ return writer;
753
+ },
754
+ decode(input, length) {
755
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
756
+ const end = length === undefined ? reader.len : reader.pos + length;
757
+ const message = createBaseResourceCost();
758
+ let writer = undefined;
759
+ while (reader.pos < end) {
760
+ const tag = reader.uint32();
761
+ switch (tag >>> 3) {
762
+ case 1: {
763
+ if (tag !== 10)
764
+ break;
765
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
766
+ continue;
767
+ }
768
+ case 2: {
769
+ if (tag !== 18)
770
+ break;
771
+ message.overrideMetadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
772
+ continue;
773
+ }
774
+ case 4: {
775
+ if (tag !== 34)
776
+ break;
777
+ message.aggregationUnit = exports.AggregationUnit.decode(reader, reader.uint32());
778
+ continue;
779
+ }
780
+ case 20: {
781
+ if (tag !== 162)
782
+ break;
783
+ message.costType = {
784
+ $case: "general",
785
+ general: exports.GeneralResourceCost.decode(reader, reader.uint32())
786
+ };
787
+ continue;
788
+ }
789
+ case 21: {
790
+ if (tag !== 170)
791
+ break;
792
+ message.costType = {
793
+ $case: "fixedInstance",
794
+ fixedInstance: exports.FixedInstanceResourceCost.decode(reader, reader.uint32())
795
+ };
796
+ continue;
797
+ }
798
+ case 22: {
799
+ if (tag !== 178)
800
+ break;
801
+ message.costType = {
802
+ $case: "autoscale",
803
+ autoscale: exports.AutoscaleResourceCost.decode(reader, reader.uint32())
804
+ };
805
+ continue;
806
+ }
807
+ default:
808
+ break;
809
+ }
810
+ if ((tag & 7) === 4 || tag === 0) {
811
+ break;
812
+ }
813
+ {
814
+ if (!writer)
815
+ writer = new index_js_1.BinaryWriter();
816
+ const skipped = reader.skip(tag & 7, tag >>> 3);
817
+ writer.uint32(tag).raw(skipped);
818
+ }
819
+ }
820
+ if (writer) {
821
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
822
+ }
823
+ return message;
824
+ },
825
+ fromJSON(object) {
826
+ return applyResourceCostCustom({
827
+ $type: "nebius.billing.v1.ResourceCost",
828
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
829
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
830
+ : undefined,
831
+ overrideMetadata: (0, index_js_1.isSet)(object.overrideMetadata ?? object.override_metadata)
832
+ ? index_js_2.ResourceMetadata.fromJSON(object.overrideMetadata ?? object.override_metadata)
833
+ : undefined,
834
+ aggregationUnit: (0, index_js_1.isSet)(object.aggregationUnit ?? object.aggregation_unit)
835
+ ? exports.AggregationUnit.fromJSON(object.aggregationUnit ?? object.aggregation_unit)
836
+ : undefined,
837
+ costType: (() => {
838
+ if ((0, index_js_1.isSet)(object.general) || (0, index_js_1.isSet)(object.general)) {
839
+ return {
840
+ $case: "general",
841
+ general: exports.GeneralResourceCost.fromJSON(object.general ?? object.general)
842
+ };
843
+ }
844
+ if ((0, index_js_1.isSet)(object.fixedInstance) || (0, index_js_1.isSet)(object.fixed_instance)) {
845
+ return {
846
+ $case: "fixedInstance",
847
+ fixedInstance: exports.FixedInstanceResourceCost.fromJSON(object.fixedInstance ?? object.fixed_instance)
848
+ };
849
+ }
850
+ if ((0, index_js_1.isSet)(object.autoscale) || (0, index_js_1.isSet)(object.autoscale)) {
851
+ return {
852
+ $case: "autoscale",
853
+ autoscale: exports.AutoscaleResourceCost.fromJSON(object.autoscale ?? object.autoscale)
854
+ };
855
+ }
856
+ return undefined;
857
+ })(),
858
+ });
859
+ },
860
+ toJSON(message, use = "json") {
861
+ const obj = {};
862
+ const pick = (json, pb) => (use === "json" ? json : pb);
863
+ if (message.metadata !== undefined) {
864
+ obj[pick("metadata", "metadata")] = message.metadata
865
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
866
+ : undefined;
867
+ }
868
+ if (message.overrideMetadata !== undefined) {
869
+ obj[pick("overrideMetadata", "override_metadata")] = message.overrideMetadata
870
+ ? index_js_2.ResourceMetadata.toJSON(message.overrideMetadata, use)
871
+ : undefined;
872
+ }
873
+ if (message.aggregationUnit !== undefined) {
874
+ obj[pick("aggregationUnit", "aggregation_unit")] = message.aggregationUnit
875
+ ? exports.AggregationUnit.toJSON(message.aggregationUnit, use)
876
+ : undefined;
877
+ }
878
+ switch (message.costType?.$case) {
879
+ case "general": {
880
+ obj[pick("general", "general")] = exports.GeneralResourceCost.toJSON(message.costType.general, use);
881
+ break;
882
+ }
883
+ case "fixedInstance": {
884
+ obj[pick("fixedInstance", "fixed_instance")] = exports.FixedInstanceResourceCost.toJSON(message.costType.fixedInstance, use);
885
+ break;
886
+ }
887
+ case "autoscale": {
888
+ obj[pick("autoscale", "autoscale")] = exports.AutoscaleResourceCost.toJSON(message.costType.autoscale, use);
889
+ break;
890
+ }
891
+ default: break;
892
+ }
893
+ return obj;
894
+ },
895
+ create(base) {
896
+ return exports.ResourceCost.fromPartial(base ?? {});
897
+ },
898
+ fromPartial(object) {
899
+ const message = createBaseResourceCost();
900
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
901
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
902
+ : undefined;
903
+ message.overrideMetadata = (object.overrideMetadata !== undefined && object.overrideMetadata !== null)
904
+ ? index_js_2.ResourceMetadata.fromPartial(object.overrideMetadata)
905
+ : undefined;
906
+ message.aggregationUnit = (object.aggregationUnit !== undefined && object.aggregationUnit !== null)
907
+ ? exports.AggregationUnit.fromPartial(object.aggregationUnit)
908
+ : undefined;
909
+ switch (object.costType?.$case) {
910
+ case "general": {
911
+ if (object.costType.general !== undefined && object.costType.general !== null) {
912
+ message.costType = {
913
+ $case: "general",
914
+ general: exports.GeneralResourceCost.fromPartial(object.costType.general),
915
+ };
916
+ }
917
+ break;
918
+ }
919
+ case "fixedInstance": {
920
+ if (object.costType.fixedInstance !== undefined && object.costType.fixedInstance !== null) {
921
+ message.costType = {
922
+ $case: "fixedInstance",
923
+ fixedInstance: exports.FixedInstanceResourceCost.fromPartial(object.costType.fixedInstance),
924
+ };
925
+ }
926
+ break;
927
+ }
928
+ case "autoscale": {
929
+ if (object.costType.autoscale !== undefined && object.costType.autoscale !== null) {
930
+ message.costType = {
931
+ $case: "autoscale",
932
+ autoscale: exports.AutoscaleResourceCost.fromPartial(object.costType.autoscale),
933
+ };
934
+ }
935
+ break;
936
+ }
937
+ default: break;
938
+ }
939
+ return message;
940
+ },
941
+ };
942
+ protobuf_js_1.protoRegistry.registerMessage(exports.ResourceCost);
943
+ function ResourceCostCustomInspect() {
944
+ const parts = [];
945
+ if (this.metadata !== undefined)
946
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
947
+ if (this.overrideMetadata !== undefined)
948
+ parts.push("overrideMetadata" + "=" + (0, util_1.inspect)(this.overrideMetadata));
949
+ if (this.aggregationUnit !== undefined)
950
+ parts.push("aggregationUnit" + "=" + (0, util_1.inspect)(this.aggregationUnit));
951
+ return `${this.$type}(${parts.join(", ")})`;
952
+ }
953
+ function ResourceCostCustomJson() {
954
+ const obj = {
955
+ type: this.$type,
956
+ };
957
+ if (this.metadata !== undefined)
958
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
959
+ if (this.overrideMetadata !== undefined)
960
+ obj.overrideMetadata = (0, logging_js_1.inspectJson)(this.overrideMetadata);
961
+ if (this.aggregationUnit !== undefined)
962
+ obj.aggregationUnit = (0, logging_js_1.inspectJson)(this.aggregationUnit);
963
+ return obj;
964
+ }
965
+ function applyResourceCostCustom(message) {
966
+ message[logging_js_1.custom] = ResourceCostCustomInspect;
967
+ message[logging_js_1.customJson] = ResourceCostCustomJson;
968
+ return message;
969
+ }
970
+ function createBaseResourceCost() {
971
+ const message = {
972
+ $type: "nebius.billing.v1.ResourceCost",
973
+ metadata: undefined,
974
+ overrideMetadata: undefined,
975
+ aggregationUnit: undefined,
976
+ costType: undefined,
977
+ };
978
+ return applyResourceCostCustom(message);
979
+ }
980
+ exports.GeneralResourceCost = {
981
+ $type: "nebius.billing.v1.GeneralResourceCost",
982
+ encode(message, writer = new index_js_1.BinaryWriter()) {
983
+ if (message.total !== undefined) {
984
+ const w = writer.uint32(10).fork();
985
+ exports.CostBreakdown.encode(message.total, w);
986
+ w.join();
987
+ }
988
+ if (message[index_js_1.unknownFieldsSymbol]) {
989
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
990
+ }
991
+ return writer;
992
+ },
993
+ decode(input, length) {
994
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
995
+ const end = length === undefined ? reader.len : reader.pos + length;
996
+ const message = createBaseGeneralResourceCost();
997
+ let writer = undefined;
998
+ while (reader.pos < end) {
999
+ const tag = reader.uint32();
1000
+ switch (tag >>> 3) {
1001
+ case 1: {
1002
+ if (tag !== 10)
1003
+ break;
1004
+ message.total = exports.CostBreakdown.decode(reader, reader.uint32());
1005
+ continue;
1006
+ }
1007
+ default:
1008
+ break;
1009
+ }
1010
+ if ((tag & 7) === 4 || tag === 0) {
1011
+ break;
1012
+ }
1013
+ {
1014
+ if (!writer)
1015
+ writer = new index_js_1.BinaryWriter();
1016
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1017
+ writer.uint32(tag).raw(skipped);
1018
+ }
1019
+ }
1020
+ if (writer) {
1021
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1022
+ }
1023
+ return message;
1024
+ },
1025
+ fromJSON(object) {
1026
+ return applyGeneralResourceCostCustom({
1027
+ $type: "nebius.billing.v1.GeneralResourceCost",
1028
+ total: (0, index_js_1.isSet)(object.total ?? object.total)
1029
+ ? exports.CostBreakdown.fromJSON(object.total ?? object.total)
1030
+ : undefined,
1031
+ });
1032
+ },
1033
+ toJSON(message, use = "json") {
1034
+ const obj = {};
1035
+ const pick = (json, pb) => (use === "json" ? json : pb);
1036
+ if (message.total !== undefined) {
1037
+ obj[pick("total", "total")] = message.total
1038
+ ? exports.CostBreakdown.toJSON(message.total, use)
1039
+ : undefined;
1040
+ }
1041
+ return obj;
1042
+ },
1043
+ create(base) {
1044
+ return exports.GeneralResourceCost.fromPartial(base ?? {});
1045
+ },
1046
+ fromPartial(object) {
1047
+ const message = createBaseGeneralResourceCost();
1048
+ message.total = (object.total !== undefined && object.total !== null)
1049
+ ? exports.CostBreakdown.fromPartial(object.total)
1050
+ : undefined;
1051
+ return message;
1052
+ },
1053
+ };
1054
+ protobuf_js_1.protoRegistry.registerMessage(exports.GeneralResourceCost);
1055
+ function GeneralResourceCostCustomInspect() {
1056
+ const parts = [];
1057
+ if (this.total !== undefined)
1058
+ parts.push("total" + "=" + (0, util_1.inspect)(this.total));
1059
+ return `${this.$type}(${parts.join(", ")})`;
1060
+ }
1061
+ function GeneralResourceCostCustomJson() {
1062
+ const obj = {
1063
+ type: this.$type,
1064
+ };
1065
+ if (this.total !== undefined)
1066
+ obj.total = (0, logging_js_1.inspectJson)(this.total);
1067
+ return obj;
1068
+ }
1069
+ function applyGeneralResourceCostCustom(message) {
1070
+ message[logging_js_1.custom] = GeneralResourceCostCustomInspect;
1071
+ message[logging_js_1.customJson] = GeneralResourceCostCustomJson;
1072
+ return message;
1073
+ }
1074
+ function createBaseGeneralResourceCost() {
1075
+ const message = {
1076
+ $type: "nebius.billing.v1.GeneralResourceCost",
1077
+ total: undefined,
1078
+ };
1079
+ return applyGeneralResourceCostCustom(message);
1080
+ }
1081
+ exports.FixedInstanceResourceCost = {
1082
+ $type: "nebius.billing.v1.FixedInstanceResourceCost",
1083
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1084
+ if (message.total !== undefined) {
1085
+ const w = writer.uint32(10).fork();
1086
+ exports.CostBreakdown.encode(message.total, w);
1087
+ w.join();
1088
+ }
1089
+ if (message.perInstance !== undefined) {
1090
+ const w = writer.uint32(18).fork();
1091
+ exports.CostBreakdown.encode(message.perInstance, w);
1092
+ w.join();
1093
+ }
1094
+ if ((message.instanceCount ?? 0) !== 0) {
1095
+ writer.uint32(24).int32(message.instanceCount);
1096
+ }
1097
+ if (message[index_js_1.unknownFieldsSymbol]) {
1098
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1099
+ }
1100
+ return writer;
1101
+ },
1102
+ decode(input, length) {
1103
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1104
+ const end = length === undefined ? reader.len : reader.pos + length;
1105
+ const message = createBaseFixedInstanceResourceCost();
1106
+ let writer = undefined;
1107
+ while (reader.pos < end) {
1108
+ const tag = reader.uint32();
1109
+ switch (tag >>> 3) {
1110
+ case 1: {
1111
+ if (tag !== 10)
1112
+ break;
1113
+ message.total = exports.CostBreakdown.decode(reader, reader.uint32());
1114
+ continue;
1115
+ }
1116
+ case 2: {
1117
+ if (tag !== 18)
1118
+ break;
1119
+ message.perInstance = exports.CostBreakdown.decode(reader, reader.uint32());
1120
+ continue;
1121
+ }
1122
+ case 3: {
1123
+ if (tag !== 24)
1124
+ break;
1125
+ message.instanceCount = reader.int32();
1126
+ continue;
1127
+ }
1128
+ default:
1129
+ break;
1130
+ }
1131
+ if ((tag & 7) === 4 || tag === 0) {
1132
+ break;
1133
+ }
1134
+ {
1135
+ if (!writer)
1136
+ writer = new index_js_1.BinaryWriter();
1137
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1138
+ writer.uint32(tag).raw(skipped);
1139
+ }
1140
+ }
1141
+ if (writer) {
1142
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1143
+ }
1144
+ return message;
1145
+ },
1146
+ fromJSON(object) {
1147
+ return applyFixedInstanceResourceCostCustom({
1148
+ $type: "nebius.billing.v1.FixedInstanceResourceCost",
1149
+ total: (0, index_js_1.isSet)(object.total ?? object.total)
1150
+ ? exports.CostBreakdown.fromJSON(object.total ?? object.total)
1151
+ : undefined,
1152
+ perInstance: (0, index_js_1.isSet)(object.perInstance ?? object.per_instance)
1153
+ ? exports.CostBreakdown.fromJSON(object.perInstance ?? object.per_instance)
1154
+ : undefined,
1155
+ instanceCount: (0, index_js_1.isSet)(object.instanceCount ?? object.instance_count)
1156
+ ? Number(object.instanceCount ?? object.instance_count)
1157
+ : 0,
1158
+ });
1159
+ },
1160
+ toJSON(message, use = "json") {
1161
+ const obj = {};
1162
+ const pick = (json, pb) => (use === "json" ? json : pb);
1163
+ if (message.total !== undefined) {
1164
+ obj[pick("total", "total")] = message.total
1165
+ ? exports.CostBreakdown.toJSON(message.total, use)
1166
+ : undefined;
1167
+ }
1168
+ if (message.perInstance !== undefined) {
1169
+ obj[pick("perInstance", "per_instance")] = message.perInstance
1170
+ ? exports.CostBreakdown.toJSON(message.perInstance, use)
1171
+ : undefined;
1172
+ }
1173
+ if ((message.instanceCount ?? 0) !== 0) {
1174
+ obj[pick("instanceCount", "instance_count")] = message.instanceCount;
1175
+ }
1176
+ return obj;
1177
+ },
1178
+ create(base) {
1179
+ return exports.FixedInstanceResourceCost.fromPartial(base ?? {});
1180
+ },
1181
+ fromPartial(object) {
1182
+ const message = createBaseFixedInstanceResourceCost();
1183
+ message.total = (object.total !== undefined && object.total !== null)
1184
+ ? exports.CostBreakdown.fromPartial(object.total)
1185
+ : undefined;
1186
+ message.perInstance = (object.perInstance !== undefined && object.perInstance !== null)
1187
+ ? exports.CostBreakdown.fromPartial(object.perInstance)
1188
+ : undefined;
1189
+ message.instanceCount = (object.instanceCount !== undefined && object.instanceCount !== null)
1190
+ ? object.instanceCount
1191
+ : 0;
1192
+ return message;
1193
+ },
1194
+ };
1195
+ protobuf_js_1.protoRegistry.registerMessage(exports.FixedInstanceResourceCost);
1196
+ function FixedInstanceResourceCostCustomInspect() {
1197
+ const parts = [];
1198
+ if (this.total !== undefined)
1199
+ parts.push("total" + "=" + (0, util_1.inspect)(this.total));
1200
+ if (this.perInstance !== undefined)
1201
+ parts.push("perInstance" + "=" + (0, util_1.inspect)(this.perInstance));
1202
+ if ((this.instanceCount ?? 0) !== 0)
1203
+ parts.push("instanceCount" + "=" + (0, util_1.inspect)(this.instanceCount));
1204
+ return `${this.$type}(${parts.join(", ")})`;
1205
+ }
1206
+ function FixedInstanceResourceCostCustomJson() {
1207
+ const obj = {
1208
+ type: this.$type,
1209
+ };
1210
+ if (this.total !== undefined)
1211
+ obj.total = (0, logging_js_1.inspectJson)(this.total);
1212
+ if (this.perInstance !== undefined)
1213
+ obj.perInstance = (0, logging_js_1.inspectJson)(this.perInstance);
1214
+ if ((this.instanceCount ?? 0) !== 0)
1215
+ obj.instanceCount = (0, logging_js_1.inspectJson)(this.instanceCount);
1216
+ return obj;
1217
+ }
1218
+ function applyFixedInstanceResourceCostCustom(message) {
1219
+ message[logging_js_1.custom] = FixedInstanceResourceCostCustomInspect;
1220
+ message[logging_js_1.customJson] = FixedInstanceResourceCostCustomJson;
1221
+ return message;
1222
+ }
1223
+ function createBaseFixedInstanceResourceCost() {
1224
+ const message = {
1225
+ $type: "nebius.billing.v1.FixedInstanceResourceCost",
1226
+ total: undefined,
1227
+ perInstance: undefined,
1228
+ instanceCount: 0,
1229
+ };
1230
+ return applyFixedInstanceResourceCostCustom(message);
1231
+ }
1232
+ exports.AutoscaleResourceCost = {
1233
+ $type: "nebius.billing.v1.AutoscaleResourceCost",
1234
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1235
+ if (message.minCost !== undefined) {
1236
+ const w = writer.uint32(10).fork();
1237
+ exports.CostBreakdown.encode(message.minCost, w);
1238
+ w.join();
1239
+ }
1240
+ if (message.maxCost !== undefined) {
1241
+ const w = writer.uint32(18).fork();
1242
+ exports.CostBreakdown.encode(message.maxCost, w);
1243
+ w.join();
1244
+ }
1245
+ if (message.perInstance !== undefined) {
1246
+ const w = writer.uint32(26).fork();
1247
+ exports.CostBreakdown.encode(message.perInstance, w);
1248
+ w.join();
1249
+ }
1250
+ if ((message.minInstances ?? 0) !== 0) {
1251
+ writer.uint32(32).int32(message.minInstances);
1252
+ }
1253
+ if ((message.maxInstances ?? 0) !== 0) {
1254
+ writer.uint32(40).int32(message.maxInstances);
1255
+ }
1256
+ if (message[index_js_1.unknownFieldsSymbol]) {
1257
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1258
+ }
1259
+ return writer;
1260
+ },
1261
+ decode(input, length) {
1262
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1263
+ const end = length === undefined ? reader.len : reader.pos + length;
1264
+ const message = createBaseAutoscaleResourceCost();
1265
+ let writer = undefined;
1266
+ while (reader.pos < end) {
1267
+ const tag = reader.uint32();
1268
+ switch (tag >>> 3) {
1269
+ case 1: {
1270
+ if (tag !== 10)
1271
+ break;
1272
+ message.minCost = exports.CostBreakdown.decode(reader, reader.uint32());
1273
+ continue;
1274
+ }
1275
+ case 2: {
1276
+ if (tag !== 18)
1277
+ break;
1278
+ message.maxCost = exports.CostBreakdown.decode(reader, reader.uint32());
1279
+ continue;
1280
+ }
1281
+ case 3: {
1282
+ if (tag !== 26)
1283
+ break;
1284
+ message.perInstance = exports.CostBreakdown.decode(reader, reader.uint32());
1285
+ continue;
1286
+ }
1287
+ case 4: {
1288
+ if (tag !== 32)
1289
+ break;
1290
+ message.minInstances = reader.int32();
1291
+ continue;
1292
+ }
1293
+ case 5: {
1294
+ if (tag !== 40)
1295
+ break;
1296
+ message.maxInstances = reader.int32();
1297
+ continue;
1298
+ }
1299
+ default:
1300
+ break;
1301
+ }
1302
+ if ((tag & 7) === 4 || tag === 0) {
1303
+ break;
1304
+ }
1305
+ {
1306
+ if (!writer)
1307
+ writer = new index_js_1.BinaryWriter();
1308
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1309
+ writer.uint32(tag).raw(skipped);
1310
+ }
1311
+ }
1312
+ if (writer) {
1313
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1314
+ }
1315
+ return message;
1316
+ },
1317
+ fromJSON(object) {
1318
+ return applyAutoscaleResourceCostCustom({
1319
+ $type: "nebius.billing.v1.AutoscaleResourceCost",
1320
+ minCost: (0, index_js_1.isSet)(object.minCost ?? object.min_cost)
1321
+ ? exports.CostBreakdown.fromJSON(object.minCost ?? object.min_cost)
1322
+ : undefined,
1323
+ maxCost: (0, index_js_1.isSet)(object.maxCost ?? object.max_cost)
1324
+ ? exports.CostBreakdown.fromJSON(object.maxCost ?? object.max_cost)
1325
+ : undefined,
1326
+ perInstance: (0, index_js_1.isSet)(object.perInstance ?? object.per_instance)
1327
+ ? exports.CostBreakdown.fromJSON(object.perInstance ?? object.per_instance)
1328
+ : undefined,
1329
+ minInstances: (0, index_js_1.isSet)(object.minInstances ?? object.min_instances)
1330
+ ? Number(object.minInstances ?? object.min_instances)
1331
+ : 0,
1332
+ maxInstances: (0, index_js_1.isSet)(object.maxInstances ?? object.max_instances)
1333
+ ? Number(object.maxInstances ?? object.max_instances)
1334
+ : 0,
1335
+ });
1336
+ },
1337
+ toJSON(message, use = "json") {
1338
+ const obj = {};
1339
+ const pick = (json, pb) => (use === "json" ? json : pb);
1340
+ if (message.minCost !== undefined) {
1341
+ obj[pick("minCost", "min_cost")] = message.minCost
1342
+ ? exports.CostBreakdown.toJSON(message.minCost, use)
1343
+ : undefined;
1344
+ }
1345
+ if (message.maxCost !== undefined) {
1346
+ obj[pick("maxCost", "max_cost")] = message.maxCost
1347
+ ? exports.CostBreakdown.toJSON(message.maxCost, use)
1348
+ : undefined;
1349
+ }
1350
+ if (message.perInstance !== undefined) {
1351
+ obj[pick("perInstance", "per_instance")] = message.perInstance
1352
+ ? exports.CostBreakdown.toJSON(message.perInstance, use)
1353
+ : undefined;
1354
+ }
1355
+ if ((message.minInstances ?? 0) !== 0) {
1356
+ obj[pick("minInstances", "min_instances")] = message.minInstances;
1357
+ }
1358
+ if ((message.maxInstances ?? 0) !== 0) {
1359
+ obj[pick("maxInstances", "max_instances")] = message.maxInstances;
1360
+ }
1361
+ return obj;
1362
+ },
1363
+ create(base) {
1364
+ return exports.AutoscaleResourceCost.fromPartial(base ?? {});
1365
+ },
1366
+ fromPartial(object) {
1367
+ const message = createBaseAutoscaleResourceCost();
1368
+ message.minCost = (object.minCost !== undefined && object.minCost !== null)
1369
+ ? exports.CostBreakdown.fromPartial(object.minCost)
1370
+ : undefined;
1371
+ message.maxCost = (object.maxCost !== undefined && object.maxCost !== null)
1372
+ ? exports.CostBreakdown.fromPartial(object.maxCost)
1373
+ : undefined;
1374
+ message.perInstance = (object.perInstance !== undefined && object.perInstance !== null)
1375
+ ? exports.CostBreakdown.fromPartial(object.perInstance)
1376
+ : undefined;
1377
+ message.minInstances = (object.minInstances !== undefined && object.minInstances !== null)
1378
+ ? object.minInstances
1379
+ : 0;
1380
+ message.maxInstances = (object.maxInstances !== undefined && object.maxInstances !== null)
1381
+ ? object.maxInstances
1382
+ : 0;
1383
+ return message;
1384
+ },
1385
+ };
1386
+ protobuf_js_1.protoRegistry.registerMessage(exports.AutoscaleResourceCost);
1387
+ function AutoscaleResourceCostCustomInspect() {
1388
+ const parts = [];
1389
+ if (this.minCost !== undefined)
1390
+ parts.push("minCost" + "=" + (0, util_1.inspect)(this.minCost));
1391
+ if (this.maxCost !== undefined)
1392
+ parts.push("maxCost" + "=" + (0, util_1.inspect)(this.maxCost));
1393
+ if (this.perInstance !== undefined)
1394
+ parts.push("perInstance" + "=" + (0, util_1.inspect)(this.perInstance));
1395
+ if ((this.minInstances ?? 0) !== 0)
1396
+ parts.push("minInstances" + "=" + (0, util_1.inspect)(this.minInstances));
1397
+ if ((this.maxInstances ?? 0) !== 0)
1398
+ parts.push("maxInstances" + "=" + (0, util_1.inspect)(this.maxInstances));
1399
+ return `${this.$type}(${parts.join(", ")})`;
1400
+ }
1401
+ function AutoscaleResourceCostCustomJson() {
1402
+ const obj = {
1403
+ type: this.$type,
1404
+ };
1405
+ if (this.minCost !== undefined)
1406
+ obj.minCost = (0, logging_js_1.inspectJson)(this.minCost);
1407
+ if (this.maxCost !== undefined)
1408
+ obj.maxCost = (0, logging_js_1.inspectJson)(this.maxCost);
1409
+ if (this.perInstance !== undefined)
1410
+ obj.perInstance = (0, logging_js_1.inspectJson)(this.perInstance);
1411
+ if ((this.minInstances ?? 0) !== 0)
1412
+ obj.minInstances = (0, logging_js_1.inspectJson)(this.minInstances);
1413
+ if ((this.maxInstances ?? 0) !== 0)
1414
+ obj.maxInstances = (0, logging_js_1.inspectJson)(this.maxInstances);
1415
+ return obj;
1416
+ }
1417
+ function applyAutoscaleResourceCostCustom(message) {
1418
+ message[logging_js_1.custom] = AutoscaleResourceCostCustomInspect;
1419
+ message[logging_js_1.customJson] = AutoscaleResourceCostCustomJson;
1420
+ return message;
1421
+ }
1422
+ function createBaseAutoscaleResourceCost() {
1423
+ const message = {
1424
+ $type: "nebius.billing.v1.AutoscaleResourceCost",
1425
+ minCost: undefined,
1426
+ maxCost: undefined,
1427
+ perInstance: undefined,
1428
+ minInstances: 0,
1429
+ maxInstances: 0,
1430
+ };
1431
+ return applyAutoscaleResourceCostCustom(message);
1432
+ }
1433
+ exports.CostBreakdown = {
1434
+ $type: "nebius.billing.v1.CostBreakdown",
1435
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1436
+ for (const v of (message.skuCosts ?? [])) {
1437
+ const w = writer.uint32(10).fork();
1438
+ exports.SkuCost.encode(v, w);
1439
+ w.join();
1440
+ }
1441
+ if (message.cost !== "") {
1442
+ writer.uint32(18).string(message.cost);
1443
+ }
1444
+ if (message.costRounded !== "") {
1445
+ writer.uint32(26).string(message.costRounded);
1446
+ }
1447
+ if (message[index_js_1.unknownFieldsSymbol]) {
1448
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1449
+ }
1450
+ return writer;
1451
+ },
1452
+ decode(input, length) {
1453
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1454
+ const end = length === undefined ? reader.len : reader.pos + length;
1455
+ const message = createBaseCostBreakdown();
1456
+ let writer = undefined;
1457
+ while (reader.pos < end) {
1458
+ const tag = reader.uint32();
1459
+ switch (tag >>> 3) {
1460
+ case 1: {
1461
+ if (tag !== 10)
1462
+ break;
1463
+ message.skuCosts.push(exports.SkuCost.decode(reader, reader.uint32()));
1464
+ continue;
1465
+ }
1466
+ case 2: {
1467
+ if (tag !== 18)
1468
+ break;
1469
+ message.cost = reader.string();
1470
+ continue;
1471
+ }
1472
+ case 3: {
1473
+ if (tag !== 26)
1474
+ break;
1475
+ message.costRounded = reader.string();
1476
+ continue;
1477
+ }
1478
+ default:
1479
+ break;
1480
+ }
1481
+ if ((tag & 7) === 4 || tag === 0) {
1482
+ break;
1483
+ }
1484
+ {
1485
+ if (!writer)
1486
+ writer = new index_js_1.BinaryWriter();
1487
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1488
+ writer.uint32(tag).raw(skipped);
1489
+ }
1490
+ }
1491
+ if (writer) {
1492
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1493
+ }
1494
+ return message;
1495
+ },
1496
+ fromJSON(object) {
1497
+ return applyCostBreakdownCustom({
1498
+ $type: "nebius.billing.v1.CostBreakdown",
1499
+ skuCosts: globalThis.Array.isArray(object?.skuCosts ?? object?.sku_costs)
1500
+ ? (object.skuCosts ?? object.sku_costs).map((e) => exports.SkuCost.fromJSON(e))
1501
+ : [],
1502
+ cost: (0, index_js_1.isSet)(object.cost ?? object.cost)
1503
+ ? String(object.cost ?? object.cost)
1504
+ : "",
1505
+ costRounded: (0, index_js_1.isSet)(object.costRounded ?? object.cost_rounded)
1506
+ ? String(object.costRounded ?? object.cost_rounded)
1507
+ : "",
1508
+ });
1509
+ },
1510
+ toJSON(message, use = "json") {
1511
+ const obj = {};
1512
+ const pick = (json, pb) => (use === "json" ? json : pb);
1513
+ if (message.skuCosts?.length) {
1514
+ obj[pick("skuCosts", "sku_costs")] = message.skuCosts.map((e) => e ? exports.SkuCost.toJSON(e, use) : undefined);
1515
+ }
1516
+ if (message.cost !== "") {
1517
+ obj[pick("cost", "cost")] = message.cost;
1518
+ }
1519
+ if (message.costRounded !== "") {
1520
+ obj[pick("costRounded", "cost_rounded")] = message.costRounded;
1521
+ }
1522
+ return obj;
1523
+ },
1524
+ create(base) {
1525
+ return exports.CostBreakdown.fromPartial(base ?? {});
1526
+ },
1527
+ fromPartial(object) {
1528
+ const message = createBaseCostBreakdown();
1529
+ message.skuCosts = object.skuCosts?.map((e) => exports.SkuCost.fromPartial(e)) || [];
1530
+ message.cost = (object.cost !== undefined && object.cost !== null)
1531
+ ? object.cost
1532
+ : "";
1533
+ message.costRounded = (object.costRounded !== undefined && object.costRounded !== null)
1534
+ ? object.costRounded
1535
+ : "";
1536
+ return message;
1537
+ },
1538
+ };
1539
+ protobuf_js_1.protoRegistry.registerMessage(exports.CostBreakdown);
1540
+ function CostBreakdownCustomInspect() {
1541
+ const parts = [];
1542
+ if ((this.skuCosts?.length ?? 0) !== 0)
1543
+ parts.push("skuCosts" + "=" + (0, util_1.inspect)(this.skuCosts));
1544
+ if (this.cost !== "")
1545
+ parts.push("cost" + "=" + (0, util_1.inspect)(this.cost));
1546
+ if (this.costRounded !== "")
1547
+ parts.push("costRounded" + "=" + (0, util_1.inspect)(this.costRounded));
1548
+ return `${this.$type}(${parts.join(", ")})`;
1549
+ }
1550
+ function CostBreakdownCustomJson() {
1551
+ const obj = {
1552
+ type: this.$type,
1553
+ };
1554
+ if ((this.skuCosts?.length ?? 0) !== 0)
1555
+ obj.skuCosts = (0, logging_js_1.inspectJson)(this.skuCosts);
1556
+ if (this.cost !== "")
1557
+ obj.cost = (0, logging_js_1.inspectJson)(this.cost);
1558
+ if (this.costRounded !== "")
1559
+ obj.costRounded = (0, logging_js_1.inspectJson)(this.costRounded);
1560
+ return obj;
1561
+ }
1562
+ function applyCostBreakdownCustom(message) {
1563
+ message[logging_js_1.custom] = CostBreakdownCustomInspect;
1564
+ message[logging_js_1.customJson] = CostBreakdownCustomJson;
1565
+ return message;
1566
+ }
1567
+ function createBaseCostBreakdown() {
1568
+ const message = {
1569
+ $type: "nebius.billing.v1.CostBreakdown",
1570
+ skuCosts: [],
1571
+ cost: "",
1572
+ costRounded: "",
1573
+ };
1574
+ return applyCostBreakdownCustom(message);
1575
+ }
1576
+ exports.SkuCost = {
1577
+ $type: "nebius.billing.v1.SkuCost",
1578
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1579
+ if (message.skuId !== "") {
1580
+ writer.uint32(10).string(message.skuId);
1581
+ }
1582
+ if (message.quantity !== "") {
1583
+ writer.uint32(162).string(message.quantity);
1584
+ }
1585
+ if (message.quantityRounded !== "") {
1586
+ writer.uint32(170).string(message.quantityRounded);
1587
+ }
1588
+ if (message.cost !== "") {
1589
+ writer.uint32(242).string(message.cost);
1590
+ }
1591
+ if (message.costRounded !== "") {
1592
+ writer.uint32(250).string(message.costRounded);
1593
+ }
1594
+ if (message[index_js_1.unknownFieldsSymbol]) {
1595
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1596
+ }
1597
+ return writer;
1598
+ },
1599
+ decode(input, length) {
1600
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1601
+ const end = length === undefined ? reader.len : reader.pos + length;
1602
+ const message = createBaseSkuCost();
1603
+ let writer = undefined;
1604
+ while (reader.pos < end) {
1605
+ const tag = reader.uint32();
1606
+ switch (tag >>> 3) {
1607
+ case 1: {
1608
+ if (tag !== 10)
1609
+ break;
1610
+ message.skuId = reader.string();
1611
+ continue;
1612
+ }
1613
+ case 20: {
1614
+ if (tag !== 162)
1615
+ break;
1616
+ message.quantity = reader.string();
1617
+ continue;
1618
+ }
1619
+ case 21: {
1620
+ if (tag !== 170)
1621
+ break;
1622
+ message.quantityRounded = reader.string();
1623
+ continue;
1624
+ }
1625
+ case 30: {
1626
+ if (tag !== 242)
1627
+ break;
1628
+ message.cost = reader.string();
1629
+ continue;
1630
+ }
1631
+ case 31: {
1632
+ if (tag !== 250)
1633
+ break;
1634
+ message.costRounded = reader.string();
1635
+ continue;
1636
+ }
1637
+ default:
1638
+ break;
1639
+ }
1640
+ if ((tag & 7) === 4 || tag === 0) {
1641
+ break;
1642
+ }
1643
+ {
1644
+ if (!writer)
1645
+ writer = new index_js_1.BinaryWriter();
1646
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1647
+ writer.uint32(tag).raw(skipped);
1648
+ }
1649
+ }
1650
+ if (writer) {
1651
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1652
+ }
1653
+ return message;
1654
+ },
1655
+ fromJSON(object) {
1656
+ return applySkuCostCustom({
1657
+ $type: "nebius.billing.v1.SkuCost",
1658
+ skuId: (0, index_js_1.isSet)(object.skuId ?? object.sku_id)
1659
+ ? String(object.skuId ?? object.sku_id)
1660
+ : "",
1661
+ quantity: (0, index_js_1.isSet)(object.quantity ?? object.quantity)
1662
+ ? String(object.quantity ?? object.quantity)
1663
+ : "",
1664
+ quantityRounded: (0, index_js_1.isSet)(object.quantityRounded ?? object.quantity_rounded)
1665
+ ? String(object.quantityRounded ?? object.quantity_rounded)
1666
+ : "",
1667
+ cost: (0, index_js_1.isSet)(object.cost ?? object.cost)
1668
+ ? String(object.cost ?? object.cost)
1669
+ : "",
1670
+ costRounded: (0, index_js_1.isSet)(object.costRounded ?? object.cost_rounded)
1671
+ ? String(object.costRounded ?? object.cost_rounded)
1672
+ : "",
1673
+ });
1674
+ },
1675
+ toJSON(message, use = "json") {
1676
+ const obj = {};
1677
+ const pick = (json, pb) => (use === "json" ? json : pb);
1678
+ if (message.skuId !== "") {
1679
+ obj[pick("skuId", "sku_id")] = message.skuId;
1680
+ }
1681
+ if (message.quantity !== "") {
1682
+ obj[pick("quantity", "quantity")] = message.quantity;
1683
+ }
1684
+ if (message.quantityRounded !== "") {
1685
+ obj[pick("quantityRounded", "quantity_rounded")] = message.quantityRounded;
1686
+ }
1687
+ if (message.cost !== "") {
1688
+ obj[pick("cost", "cost")] = message.cost;
1689
+ }
1690
+ if (message.costRounded !== "") {
1691
+ obj[pick("costRounded", "cost_rounded")] = message.costRounded;
1692
+ }
1693
+ return obj;
1694
+ },
1695
+ create(base) {
1696
+ return exports.SkuCost.fromPartial(base ?? {});
1697
+ },
1698
+ fromPartial(object) {
1699
+ const message = createBaseSkuCost();
1700
+ message.skuId = (object.skuId !== undefined && object.skuId !== null)
1701
+ ? object.skuId
1702
+ : "";
1703
+ message.quantity = (object.quantity !== undefined && object.quantity !== null)
1704
+ ? object.quantity
1705
+ : "";
1706
+ message.quantityRounded = (object.quantityRounded !== undefined && object.quantityRounded !== null)
1707
+ ? object.quantityRounded
1708
+ : "";
1709
+ message.cost = (object.cost !== undefined && object.cost !== null)
1710
+ ? object.cost
1711
+ : "";
1712
+ message.costRounded = (object.costRounded !== undefined && object.costRounded !== null)
1713
+ ? object.costRounded
1714
+ : "";
1715
+ return message;
1716
+ },
1717
+ };
1718
+ protobuf_js_1.protoRegistry.registerMessage(exports.SkuCost);
1719
+ function SkuCostCustomInspect() {
1720
+ const parts = [];
1721
+ if (this.skuId !== "")
1722
+ parts.push("skuId" + "=" + (0, util_1.inspect)(this.skuId));
1723
+ if (this.quantity !== "")
1724
+ parts.push("quantity" + "=" + (0, util_1.inspect)(this.quantity));
1725
+ if (this.quantityRounded !== "")
1726
+ parts.push("quantityRounded" + "=" + (0, util_1.inspect)(this.quantityRounded));
1727
+ if (this.cost !== "")
1728
+ parts.push("cost" + "=" + (0, util_1.inspect)(this.cost));
1729
+ if (this.costRounded !== "")
1730
+ parts.push("costRounded" + "=" + (0, util_1.inspect)(this.costRounded));
1731
+ return `${this.$type}(${parts.join(", ")})`;
1732
+ }
1733
+ function SkuCostCustomJson() {
1734
+ const obj = {
1735
+ type: this.$type,
1736
+ };
1737
+ if (this.skuId !== "")
1738
+ obj.skuId = (0, logging_js_1.inspectJson)(this.skuId);
1739
+ if (this.quantity !== "")
1740
+ obj.quantity = (0, logging_js_1.inspectJson)(this.quantity);
1741
+ if (this.quantityRounded !== "")
1742
+ obj.quantityRounded = (0, logging_js_1.inspectJson)(this.quantityRounded);
1743
+ if (this.cost !== "")
1744
+ obj.cost = (0, logging_js_1.inspectJson)(this.cost);
1745
+ if (this.costRounded !== "")
1746
+ obj.costRounded = (0, logging_js_1.inspectJson)(this.costRounded);
1747
+ return obj;
1748
+ }
1749
+ function applySkuCostCustom(message) {
1750
+ message[logging_js_1.custom] = SkuCostCustomInspect;
1751
+ message[logging_js_1.customJson] = SkuCostCustomJson;
1752
+ return message;
1753
+ }
1754
+ function createBaseSkuCost() {
1755
+ const message = {
1756
+ $type: "nebius.billing.v1.SkuCost",
1757
+ skuId: "",
1758
+ quantity: "",
1759
+ quantityRounded: "",
1760
+ cost: "",
1761
+ costRounded: "",
1762
+ };
1763
+ return applySkuCostCustom(message);
1764
+ }
1765
+ exports.TotalCost = {
1766
+ $type: "nebius.billing.v1.TotalCost",
1767
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1768
+ if (message.aggregationUnit !== undefined) {
1769
+ const w = writer.uint32(10).fork();
1770
+ exports.AggregationUnit.encode(message.aggregationUnit, w);
1771
+ w.join();
1772
+ }
1773
+ if (message.costType?.$case === undefined) { /* noop */ }
1774
+ else if (message.costType?.$case === "general") {
1775
+ const w = writer.uint32(162).fork();
1776
+ exports.GeneralResourceCost.encode(message.costType.general, w);
1777
+ w.join();
1778
+ }
1779
+ else if (message.costType?.$case === "range") {
1780
+ const w = writer.uint32(170).fork();
1781
+ exports.RangeTotalCost.encode(message.costType.range, w);
1782
+ w.join();
1783
+ }
1784
+ if (message[index_js_1.unknownFieldsSymbol]) {
1785
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1786
+ }
1787
+ return writer;
1788
+ },
1789
+ decode(input, length) {
1790
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1791
+ const end = length === undefined ? reader.len : reader.pos + length;
1792
+ const message = createBaseTotalCost();
1793
+ let writer = undefined;
1794
+ while (reader.pos < end) {
1795
+ const tag = reader.uint32();
1796
+ switch (tag >>> 3) {
1797
+ case 1: {
1798
+ if (tag !== 10)
1799
+ break;
1800
+ message.aggregationUnit = exports.AggregationUnit.decode(reader, reader.uint32());
1801
+ continue;
1802
+ }
1803
+ case 20: {
1804
+ if (tag !== 162)
1805
+ break;
1806
+ message.costType = {
1807
+ $case: "general",
1808
+ general: exports.GeneralResourceCost.decode(reader, reader.uint32())
1809
+ };
1810
+ continue;
1811
+ }
1812
+ case 21: {
1813
+ if (tag !== 170)
1814
+ break;
1815
+ message.costType = {
1816
+ $case: "range",
1817
+ range: exports.RangeTotalCost.decode(reader, reader.uint32())
1818
+ };
1819
+ continue;
1820
+ }
1821
+ default:
1822
+ break;
1823
+ }
1824
+ if ((tag & 7) === 4 || tag === 0) {
1825
+ break;
1826
+ }
1827
+ {
1828
+ if (!writer)
1829
+ writer = new index_js_1.BinaryWriter();
1830
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1831
+ writer.uint32(tag).raw(skipped);
1832
+ }
1833
+ }
1834
+ if (writer) {
1835
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1836
+ }
1837
+ return message;
1838
+ },
1839
+ fromJSON(object) {
1840
+ return applyTotalCostCustom({
1841
+ $type: "nebius.billing.v1.TotalCost",
1842
+ aggregationUnit: (0, index_js_1.isSet)(object.aggregationUnit ?? object.aggregation_unit)
1843
+ ? exports.AggregationUnit.fromJSON(object.aggregationUnit ?? object.aggregation_unit)
1844
+ : undefined,
1845
+ costType: (() => {
1846
+ if ((0, index_js_1.isSet)(object.general) || (0, index_js_1.isSet)(object.general)) {
1847
+ return {
1848
+ $case: "general",
1849
+ general: exports.GeneralResourceCost.fromJSON(object.general ?? object.general)
1850
+ };
1851
+ }
1852
+ if ((0, index_js_1.isSet)(object.range) || (0, index_js_1.isSet)(object.range)) {
1853
+ return {
1854
+ $case: "range",
1855
+ range: exports.RangeTotalCost.fromJSON(object.range ?? object.range)
1856
+ };
1857
+ }
1858
+ return undefined;
1859
+ })(),
1860
+ });
1861
+ },
1862
+ toJSON(message, use = "json") {
1863
+ const obj = {};
1864
+ const pick = (json, pb) => (use === "json" ? json : pb);
1865
+ if (message.aggregationUnit !== undefined) {
1866
+ obj[pick("aggregationUnit", "aggregation_unit")] = message.aggregationUnit
1867
+ ? exports.AggregationUnit.toJSON(message.aggregationUnit, use)
1868
+ : undefined;
1869
+ }
1870
+ switch (message.costType?.$case) {
1871
+ case "general": {
1872
+ obj[pick("general", "general")] = exports.GeneralResourceCost.toJSON(message.costType.general, use);
1873
+ break;
1874
+ }
1875
+ case "range": {
1876
+ obj[pick("range", "range")] = exports.RangeTotalCost.toJSON(message.costType.range, use);
1877
+ break;
1878
+ }
1879
+ default: break;
1880
+ }
1881
+ return obj;
1882
+ },
1883
+ create(base) {
1884
+ return exports.TotalCost.fromPartial(base ?? {});
1885
+ },
1886
+ fromPartial(object) {
1887
+ const message = createBaseTotalCost();
1888
+ message.aggregationUnit = (object.aggregationUnit !== undefined && object.aggregationUnit !== null)
1889
+ ? exports.AggregationUnit.fromPartial(object.aggregationUnit)
1890
+ : undefined;
1891
+ switch (object.costType?.$case) {
1892
+ case "general": {
1893
+ if (object.costType.general !== undefined && object.costType.general !== null) {
1894
+ message.costType = {
1895
+ $case: "general",
1896
+ general: exports.GeneralResourceCost.fromPartial(object.costType.general),
1897
+ };
1898
+ }
1899
+ break;
1900
+ }
1901
+ case "range": {
1902
+ if (object.costType.range !== undefined && object.costType.range !== null) {
1903
+ message.costType = {
1904
+ $case: "range",
1905
+ range: exports.RangeTotalCost.fromPartial(object.costType.range),
1906
+ };
1907
+ }
1908
+ break;
1909
+ }
1910
+ default: break;
1911
+ }
1912
+ return message;
1913
+ },
1914
+ };
1915
+ protobuf_js_1.protoRegistry.registerMessage(exports.TotalCost);
1916
+ function TotalCostCustomInspect() {
1917
+ const parts = [];
1918
+ if (this.aggregationUnit !== undefined)
1919
+ parts.push("aggregationUnit" + "=" + (0, util_1.inspect)(this.aggregationUnit));
1920
+ return `${this.$type}(${parts.join(", ")})`;
1921
+ }
1922
+ function TotalCostCustomJson() {
1923
+ const obj = {
1924
+ type: this.$type,
1925
+ };
1926
+ if (this.aggregationUnit !== undefined)
1927
+ obj.aggregationUnit = (0, logging_js_1.inspectJson)(this.aggregationUnit);
1928
+ return obj;
1929
+ }
1930
+ function applyTotalCostCustom(message) {
1931
+ message[logging_js_1.custom] = TotalCostCustomInspect;
1932
+ message[logging_js_1.customJson] = TotalCostCustomJson;
1933
+ return message;
1934
+ }
1935
+ function createBaseTotalCost() {
1936
+ const message = {
1937
+ $type: "nebius.billing.v1.TotalCost",
1938
+ aggregationUnit: undefined,
1939
+ costType: undefined,
1940
+ };
1941
+ return applyTotalCostCustom(message);
1942
+ }
1943
+ exports.FilterAggregationUnit = {
1944
+ $type: "nebius.billing.v1.FilterAggregationUnit",
1945
+ encode(message, writer = new index_js_1.BinaryWriter()) {
1946
+ if (message.filterAggregationUnitValues?.length) {
1947
+ const w = writer.uint32(10).fork();
1948
+ for (const v of message.filterAggregationUnitValues)
1949
+ w.int32(v?.code | 0);
1950
+ w.join();
1951
+ }
1952
+ if (message[index_js_1.unknownFieldsSymbol]) {
1953
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
1954
+ }
1955
+ return writer;
1956
+ },
1957
+ decode(input, length) {
1958
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
1959
+ const end = length === undefined ? reader.len : reader.pos + length;
1960
+ const message = createBaseFilterAggregationUnit();
1961
+ let writer = undefined;
1962
+ while (reader.pos < end) {
1963
+ const tag = reader.uint32();
1964
+ switch (tag >>> 3) {
1965
+ case 1: {
1966
+ // packed or unpacked repeated enum
1967
+ if ((tag & 7) === 2) {
1968
+ const end2 = reader.uint32() + reader.pos;
1969
+ while (reader.pos < end2) {
1970
+ message.filterAggregationUnitValues.push(exports.FilterAggregationUnit_FilterAggregationUnitValue.fromNumber(reader.int32()));
1971
+ }
1972
+ continue;
1973
+ }
1974
+ else if ((tag & 7) === 0) {
1975
+ message.filterAggregationUnitValues.push(exports.FilterAggregationUnit_FilterAggregationUnitValue.fromNumber(reader.int32()));
1976
+ continue;
1977
+ }
1978
+ break; // wrong wire type
1979
+ }
1980
+ default:
1981
+ break;
1982
+ }
1983
+ if ((tag & 7) === 4 || tag === 0) {
1984
+ break;
1985
+ }
1986
+ {
1987
+ if (!writer)
1988
+ writer = new index_js_1.BinaryWriter();
1989
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1990
+ writer.uint32(tag).raw(skipped);
1991
+ }
1992
+ }
1993
+ if (writer) {
1994
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
1995
+ }
1996
+ return message;
1997
+ },
1998
+ fromJSON(object) {
1999
+ return applyFilterAggregationUnitCustom({
2000
+ $type: "nebius.billing.v1.FilterAggregationUnit",
2001
+ filterAggregationUnitValues: globalThis.Array.isArray(object?.filterAggregationUnitValues ?? object?.filter_aggregation_unit_values)
2002
+ ? (object.filterAggregationUnitValues ?? object.filter_aggregation_unit_values).map((e) => exports.FilterAggregationUnit_FilterAggregationUnitValue.fromJSON(e))
2003
+ : [],
2004
+ });
2005
+ },
2006
+ toJSON(message, use = "json") {
2007
+ const obj = {};
2008
+ const pick = (json, pb) => (use === "json" ? json : pb);
2009
+ if (message.filterAggregationUnitValues?.length) {
2010
+ obj[pick("filterAggregationUnitValues", "filter_aggregation_unit_values")] = message.filterAggregationUnitValues.map((e) => exports.FilterAggregationUnit_FilterAggregationUnitValue.toJSON(e));
2011
+ }
2012
+ return obj;
2013
+ },
2014
+ create(base) {
2015
+ return exports.FilterAggregationUnit.fromPartial(base ?? {});
2016
+ },
2017
+ fromPartial(object) {
2018
+ const message = createBaseFilterAggregationUnit();
2019
+ message.filterAggregationUnitValues = object.filterAggregationUnitValues?.map((e) => exports.FilterAggregationUnit_FilterAggregationUnitValue.fromJSON(e.name)) || [];
2020
+ return message;
2021
+ },
2022
+ };
2023
+ protobuf_js_1.protoRegistry.registerMessage(exports.FilterAggregationUnit);
2024
+ function FilterAggregationUnitCustomInspect() {
2025
+ const parts = [];
2026
+ if ((this.filterAggregationUnitValues?.length ?? 0) !== 0)
2027
+ parts.push("filterAggregationUnitValues" + "=" + (0, util_1.inspect)(this.filterAggregationUnitValues));
2028
+ return `${this.$type}(${parts.join(", ")})`;
2029
+ }
2030
+ function FilterAggregationUnitCustomJson() {
2031
+ const obj = {
2032
+ type: this.$type,
2033
+ };
2034
+ if ((this.filterAggregationUnitValues?.length ?? 0) !== 0)
2035
+ obj.filterAggregationUnitValues = (0, logging_js_1.inspectJson)(this.filterAggregationUnitValues);
2036
+ return obj;
2037
+ }
2038
+ function applyFilterAggregationUnitCustom(message) {
2039
+ message[logging_js_1.custom] = FilterAggregationUnitCustomInspect;
2040
+ message[logging_js_1.customJson] = FilterAggregationUnitCustomJson;
2041
+ return message;
2042
+ }
2043
+ function createBaseFilterAggregationUnit() {
2044
+ const message = {
2045
+ $type: "nebius.billing.v1.FilterAggregationUnit",
2046
+ filterAggregationUnitValues: [],
2047
+ };
2048
+ return applyFilterAggregationUnitCustom(message);
2049
+ }
2050
+ exports.AggregationUnit = {
2051
+ $type: "nebius.billing.v1.AggregationUnit",
2052
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2053
+ if (message.unit !== "") {
2054
+ writer.uint32(10).string(message.unit);
2055
+ }
2056
+ if ((message.unitType ?? exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED) !== exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED) {
2057
+ exports.AggregationUnit_UnitType.encodeField(writer, 2, message.unitType);
2058
+ }
2059
+ if (message[index_js_1.unknownFieldsSymbol]) {
2060
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2061
+ }
2062
+ return writer;
2063
+ },
2064
+ decode(input, length) {
2065
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2066
+ const end = length === undefined ? reader.len : reader.pos + length;
2067
+ const message = createBaseAggregationUnit();
2068
+ let writer = undefined;
2069
+ while (reader.pos < end) {
2070
+ const tag = reader.uint32();
2071
+ switch (tag >>> 3) {
2072
+ case 1: {
2073
+ if (tag !== 10)
2074
+ break;
2075
+ message.unit = reader.string();
2076
+ continue;
2077
+ }
2078
+ case 2: {
2079
+ if (tag !== 16)
2080
+ break;
2081
+ message.unitType = exports.AggregationUnit_UnitType.fromNumber(reader.int32());
2082
+ continue;
2083
+ }
2084
+ default:
2085
+ break;
2086
+ }
2087
+ if ((tag & 7) === 4 || tag === 0) {
2088
+ break;
2089
+ }
2090
+ {
2091
+ if (!writer)
2092
+ writer = new index_js_1.BinaryWriter();
2093
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2094
+ writer.uint32(tag).raw(skipped);
2095
+ }
2096
+ }
2097
+ if (writer) {
2098
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2099
+ }
2100
+ return message;
2101
+ },
2102
+ fromJSON(object) {
2103
+ return applyAggregationUnitCustom({
2104
+ $type: "nebius.billing.v1.AggregationUnit",
2105
+ unit: (0, index_js_1.isSet)(object.unit ?? object.unit)
2106
+ ? String(object.unit ?? object.unit)
2107
+ : "",
2108
+ unitType: (0, index_js_1.isSet)(object.unitType ?? object.unit_type)
2109
+ ? exports.AggregationUnit_UnitType.fromJSON(object.unitType ?? object.unit_type)
2110
+ : exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED,
2111
+ });
2112
+ },
2113
+ toJSON(message, use = "json") {
2114
+ const obj = {};
2115
+ const pick = (json, pb) => (use === "json" ? json : pb);
2116
+ if (message.unit !== "") {
2117
+ obj[pick("unit", "unit")] = message.unit;
2118
+ }
2119
+ if ((message.unitType ?? exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED) !== exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED) {
2120
+ obj[pick("unitType", "unit_type")] = exports.AggregationUnit_UnitType.toJSON(message.unitType);
2121
+ }
2122
+ return obj;
2123
+ },
2124
+ create(base) {
2125
+ return exports.AggregationUnit.fromPartial(base ?? {});
2126
+ },
2127
+ fromPartial(object) {
2128
+ const message = createBaseAggregationUnit();
2129
+ message.unit = (object.unit !== undefined && object.unit !== null)
2130
+ ? object.unit
2131
+ : "";
2132
+ message.unitType = (object.unitType !== undefined && object.unitType !== null)
2133
+ ? exports.AggregationUnit_UnitType.fromJSON(object.unitType.name)
2134
+ : exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED;
2135
+ return message;
2136
+ },
2137
+ };
2138
+ protobuf_js_1.protoRegistry.registerMessage(exports.AggregationUnit);
2139
+ function AggregationUnitCustomInspect() {
2140
+ const parts = [];
2141
+ if (this.unit !== "")
2142
+ parts.push("unit" + "=" + (0, util_1.inspect)(this.unit));
2143
+ if (this.unitType !== undefined)
2144
+ parts.push("unitType" + "=" + (0, util_1.inspect)(this.unitType));
2145
+ return `${this.$type}(${parts.join(", ")})`;
2146
+ }
2147
+ function AggregationUnitCustomJson() {
2148
+ const obj = {
2149
+ type: this.$type,
2150
+ };
2151
+ if (this.unit !== "")
2152
+ obj.unit = (0, logging_js_1.inspectJson)(this.unit);
2153
+ if (this.unitType !== undefined)
2154
+ obj.unitType = (0, logging_js_1.inspectJson)(this.unitType);
2155
+ return obj;
2156
+ }
2157
+ function applyAggregationUnitCustom(message) {
2158
+ message[logging_js_1.custom] = AggregationUnitCustomInspect;
2159
+ message[logging_js_1.customJson] = AggregationUnitCustomJson;
2160
+ return message;
2161
+ }
2162
+ function createBaseAggregationUnit() {
2163
+ const message = {
2164
+ $type: "nebius.billing.v1.AggregationUnit",
2165
+ unit: "",
2166
+ unitType: exports.AggregationUnit_UnitType.UNIT_TYPE_UNSPECIFIED,
2167
+ };
2168
+ return applyAggregationUnitCustom(message);
2169
+ }
2170
+ const OfferType_VALUE_COMMENTS = {
2171
+ OFFER_TYPE_CONTRACT_PRICE: " Contract price is a special price for SKU.\n",
2172
+ };
2173
+ exports.OfferType = (0, index_js_1.createEnum)("nebius.billing.v1.OfferType", {
2174
+ OFFER_TYPE_UNSPECIFIED: 0,
2175
+ /**
2176
+ * Contract price is a special price for SKU.
2177
+ *
2178
+ */
2179
+ OFFER_TYPE_CONTRACT_PRICE: 1,
2180
+ }, OfferType_VALUE_COMMENTS);
2181
+ protobuf_js_1.protoRegistry.registerEnum(exports.OfferType);
2182
+ //# sourceMappingURL=index.js.map