@nebius/js-sdk 0.2.63 → 0.2.65

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 (65) hide show
  1. package/dist/cjs/api/google/protobuf/index.d.ts +34 -20
  2. package/dist/cjs/api/google/protobuf/index.d.ts.map +1 -1
  3. package/dist/cjs/api/google/protobuf/index.js +32 -0
  4. package/dist/cjs/api/google/protobuf/index.js.map +1 -1
  5. package/dist/cjs/api/nebius/ai/v1/index.d.ts +81 -0
  6. package/dist/cjs/api/nebius/ai/v1/index.d.ts.map +1 -1
  7. package/dist/cjs/api/nebius/ai/v1/index.js +545 -1
  8. package/dist/cjs/api/nebius/ai/v1/index.js.map +1 -1
  9. package/dist/cjs/api/nebius/billing/v1/index.d.ts +714 -2
  10. package/dist/cjs/api/nebius/billing/v1/index.d.ts.map +1 -1
  11. package/dist/cjs/api/nebius/billing/v1/index.js +1970 -1
  12. package/dist/cjs/api/nebius/billing/v1/index.js.map +1 -1
  13. package/dist/cjs/api/nebius/compute/v1/index.d.ts +64 -3
  14. package/dist/cjs/api/nebius/compute/v1/index.d.ts.map +1 -1
  15. package/dist/cjs/api/nebius/compute/v1/index.js +382 -2
  16. package/dist/cjs/api/nebius/compute/v1/index.js.map +1 -1
  17. package/dist/cjs/api/nebius/iam/v1/index.d.ts +28 -8
  18. package/dist/cjs/api/nebius/iam/v1/index.d.ts.map +1 -1
  19. package/dist/cjs/api/nebius/iam/v1/index.js +25 -5
  20. package/dist/cjs/api/nebius/iam/v1/index.js.map +1 -1
  21. package/dist/cjs/api/nebius/mk8s/v1/index.d.ts +78 -1
  22. package/dist/cjs/api/nebius/mk8s/v1/index.d.ts.map +1 -1
  23. package/dist/cjs/api/nebius/mk8s/v1/index.js +340 -2
  24. package/dist/cjs/api/nebius/mk8s/v1/index.js.map +1 -1
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/api/google/protobuf/index.d.ts +34 -20
  28. package/dist/esm/api/google/protobuf/index.d.ts.map +1 -1
  29. package/dist/esm/api/google/protobuf/index.js +32 -0
  30. package/dist/esm/api/google/protobuf/index.js.map +1 -1
  31. package/dist/esm/api/nebius/ai/v1/index.d.ts +81 -0
  32. package/dist/esm/api/nebius/ai/v1/index.d.ts.map +1 -1
  33. package/dist/esm/api/nebius/ai/v1/index.js +544 -0
  34. package/dist/esm/api/nebius/ai/v1/index.js.map +1 -1
  35. package/dist/esm/api/nebius/billing/v1/index.d.ts +714 -2
  36. package/dist/esm/api/nebius/billing/v1/index.d.ts.map +1 -1
  37. package/dist/esm/api/nebius/billing/v1/index.js +1970 -2
  38. package/dist/esm/api/nebius/billing/v1/index.js.map +1 -1
  39. package/dist/esm/api/nebius/compute/v1/index.d.ts +64 -3
  40. package/dist/esm/api/nebius/compute/v1/index.d.ts.map +1 -1
  41. package/dist/esm/api/nebius/compute/v1/index.js +380 -0
  42. package/dist/esm/api/nebius/compute/v1/index.js.map +1 -1
  43. package/dist/esm/api/nebius/iam/v1/index.d.ts +28 -8
  44. package/dist/esm/api/nebius/iam/v1/index.d.ts.map +1 -1
  45. package/dist/esm/api/nebius/iam/v1/index.js +25 -5
  46. package/dist/esm/api/nebius/iam/v1/index.js.map +1 -1
  47. package/dist/esm/api/nebius/mk8s/v1/index.d.ts +78 -1
  48. package/dist/esm/api/nebius/mk8s/v1/index.d.ts.map +1 -1
  49. package/dist/esm/api/nebius/mk8s/v1/index.js +339 -1
  50. package/dist/esm/api/nebius/mk8s/v1/index.js.map +1 -1
  51. package/dist/esm/version.d.ts +1 -1
  52. package/dist/esm/version.js +1 -1
  53. package/package.json +1 -1
  54. package/dist/cjs/api/nebius/monitoring/v1/index.d.ts +0 -607
  55. package/dist/cjs/api/nebius/monitoring/v1/index.d.ts.map +0 -1
  56. package/dist/cjs/api/nebius/monitoring/v1/index.js +0 -1538
  57. package/dist/cjs/api/nebius/monitoring/v1/index.js.map +0 -1
  58. package/dist/cjs/api/nebius/monitoring/v1.d.ts +0 -1
  59. package/dist/cjs/api/nebius/monitoring/v1.js +0 -2
  60. package/dist/esm/api/nebius/monitoring/v1/index.d.ts +0 -607
  61. package/dist/esm/api/nebius/monitoring/v1/index.d.ts.map +0 -1
  62. package/dist/esm/api/nebius/monitoring/v1/index.js +0 -1534
  63. package/dist/esm/api/nebius/monitoring/v1/index.js.map +0 -1
  64. package/dist/esm/api/nebius/monitoring/v1.d.ts +0 -1
  65. package/dist/esm/api/nebius/monitoring/v1.js +0 -1
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  /* Generated by Nebius TS generator. DO NOT EDIT! */
3
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;
4
+ exports.PricingPolicyStatus = exports.MaxPriceV1 = exports.PricingMethod = exports.ComputeInstanceSpecV1 = exports.ComputeInstanceSpec = exports.PricingPolicySpec = exports.PricingPolicy = exports.PricingPolicyStatus_SchedulingState = exports.PricingPolicyStatus_State = exports.PricingPolicyService = exports.PricingPolicyServiceBaseClient = exports.PricingPolicyServiceServiceDescription = exports.DeletePricingPolicyRequest = exports.UpdatePricingPolicyRequest = exports.ListPricingPoliciesResponse = exports.ListPricingPoliciesRequest = exports.GetPricingPolicyRequest = exports.CreatePricingPolicyRequest = 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
5
  const index_js_1 = require("../../../../runtime/protos/index.js");
6
6
  const util_1 = require("util");
7
7
  const protobuf_js_1 = require("../../../protobuf.js");
8
8
  const logging_js_1 = require("../../../../runtime/util/logging.js");
9
9
  const grpc_js_1 = require("@grpc/grpc-js");
10
10
  const request_js_1 = require("../../../../runtime/request.js");
11
+ const operation_js_1 = require("../../../../runtime/operation.js");
11
12
  const index_js_2 = require("../../common/v1/index.js");
12
13
  const __deprecatedWarned = new Set();
13
14
  const EstimateBatchRequest_MESSAGE_DESCRIPTOR = {
@@ -2362,4 +2363,1972 @@ exports.OfferType = (0, index_js_1.createEnum)("nebius.billing.v1.OfferType", {
2362
2363
  OFFER_TYPE_CONTRACT_PRICE: 1,
2363
2364
  }, OfferType_VALUE_COMMENTS);
2364
2365
  protobuf_js_1.protoRegistry.registerEnum(exports.OfferType);
2366
+ const CreatePricingPolicyRequest_MESSAGE_DESCRIPTOR = {
2367
+ fields: {
2368
+ "metadata": { pbName: "metadata", message: () => index_js_2.ResourceMetadata.$descriptor },
2369
+ "spec": { pbName: "spec", message: () => exports.PricingPolicySpec.$descriptor },
2370
+ },
2371
+ };
2372
+ /** Encodes, decodes, converts, and creates {@link CreatePricingPolicyRequest} messages. */
2373
+ exports.CreatePricingPolicyRequest = {
2374
+ $type: "nebius.billing.v1.CreatePricingPolicyRequest",
2375
+ $descriptor: CreatePricingPolicyRequest_MESSAGE_DESCRIPTOR,
2376
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2377
+ if (message.metadata !== undefined) {
2378
+ const w = writer.uint32(10).fork();
2379
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
2380
+ w.join();
2381
+ }
2382
+ if (message.spec !== undefined) {
2383
+ const w = writer.uint32(18).fork();
2384
+ exports.PricingPolicySpec.encode(message.spec, w);
2385
+ w.join();
2386
+ }
2387
+ if (message[index_js_1.unknownFieldsSymbol]) {
2388
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2389
+ }
2390
+ return writer;
2391
+ },
2392
+ decode(input, length) {
2393
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2394
+ const end = length === undefined ? reader.len : reader.pos + length;
2395
+ const message = createBaseCreatePricingPolicyRequest();
2396
+ let writer = undefined;
2397
+ while (reader.pos < end) {
2398
+ const tag = reader.uint32();
2399
+ switch (tag >>> 3) {
2400
+ case 1: {
2401
+ if (tag !== 10)
2402
+ break;
2403
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
2404
+ continue;
2405
+ }
2406
+ case 2: {
2407
+ if (tag !== 18)
2408
+ break;
2409
+ message.spec = exports.PricingPolicySpec.decode(reader, reader.uint32());
2410
+ continue;
2411
+ }
2412
+ default:
2413
+ break;
2414
+ }
2415
+ if ((tag & 7) === 4 || tag === 0) {
2416
+ break;
2417
+ }
2418
+ {
2419
+ if (!writer)
2420
+ writer = new index_js_1.BinaryWriter();
2421
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2422
+ writer.uint32(tag).raw(skipped);
2423
+ }
2424
+ }
2425
+ if (writer) {
2426
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2427
+ }
2428
+ return message;
2429
+ },
2430
+ fromJSON(object) {
2431
+ return applyCreatePricingPolicyRequestCustom({
2432
+ $type: "nebius.billing.v1.CreatePricingPolicyRequest",
2433
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
2434
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
2435
+ : undefined,
2436
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
2437
+ ? exports.PricingPolicySpec.fromJSON(object.spec ?? object.spec)
2438
+ : undefined,
2439
+ });
2440
+ },
2441
+ toJSON(message, use = "json") {
2442
+ const obj = {};
2443
+ const pick = (json, pb) => (use === "json" ? json : pb);
2444
+ if (message.metadata !== undefined) {
2445
+ obj[pick("metadata", "metadata")] = message.metadata
2446
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
2447
+ : undefined;
2448
+ }
2449
+ if (message.spec !== undefined) {
2450
+ obj[pick("spec", "spec")] = message.spec
2451
+ ? exports.PricingPolicySpec.toJSON(message.spec, use)
2452
+ : undefined;
2453
+ }
2454
+ return obj;
2455
+ },
2456
+ create(base) {
2457
+ return exports.CreatePricingPolicyRequest.fromPartial(base ?? {});
2458
+ },
2459
+ fromPartial(object) {
2460
+ const message = createBaseCreatePricingPolicyRequest();
2461
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
2462
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
2463
+ : undefined;
2464
+ message.spec = (object.spec !== undefined && object.spec !== null)
2465
+ ? exports.PricingPolicySpec.fromPartial(object.spec)
2466
+ : undefined;
2467
+ return message;
2468
+ },
2469
+ };
2470
+ protobuf_js_1.protoRegistry.registerMessage(exports.CreatePricingPolicyRequest);
2471
+ function CreatePricingPolicyRequestCustomInspect() {
2472
+ const parts = [];
2473
+ if (this.metadata !== undefined)
2474
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
2475
+ if (this.spec !== undefined)
2476
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
2477
+ return `${this.$type}(${parts.join(", ")})`;
2478
+ }
2479
+ function CreatePricingPolicyRequestCustomJson() {
2480
+ const obj = {
2481
+ type: this.$type,
2482
+ };
2483
+ if (this.metadata !== undefined)
2484
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
2485
+ if (this.spec !== undefined)
2486
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
2487
+ return obj;
2488
+ }
2489
+ function applyCreatePricingPolicyRequestCustom(message) {
2490
+ message[logging_js_1.custom] = CreatePricingPolicyRequestCustomInspect;
2491
+ message[logging_js_1.customJson] = CreatePricingPolicyRequestCustomJson;
2492
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.CreatePricingPolicyRequest.$descriptor);
2493
+ }
2494
+ function createBaseCreatePricingPolicyRequest() {
2495
+ const message = {
2496
+ $type: "nebius.billing.v1.CreatePricingPolicyRequest",
2497
+ metadata: undefined,
2498
+ spec: undefined,
2499
+ };
2500
+ return applyCreatePricingPolicyRequestCustom(message);
2501
+ }
2502
+ const GetPricingPolicyRequest_MESSAGE_DESCRIPTOR = {
2503
+ fields: {
2504
+ "id": { pbName: "id", scalarType: 9 },
2505
+ },
2506
+ };
2507
+ /** Encodes, decodes, converts, and creates {@link GetPricingPolicyRequest} messages. */
2508
+ exports.GetPricingPolicyRequest = {
2509
+ $type: "nebius.billing.v1.GetPricingPolicyRequest",
2510
+ $descriptor: GetPricingPolicyRequest_MESSAGE_DESCRIPTOR,
2511
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2512
+ if (message.id !== "") {
2513
+ writer.uint32(10).string(message.id);
2514
+ }
2515
+ if (message[index_js_1.unknownFieldsSymbol]) {
2516
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2517
+ }
2518
+ return writer;
2519
+ },
2520
+ decode(input, length) {
2521
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2522
+ const end = length === undefined ? reader.len : reader.pos + length;
2523
+ const message = createBaseGetPricingPolicyRequest();
2524
+ let writer = undefined;
2525
+ while (reader.pos < end) {
2526
+ const tag = reader.uint32();
2527
+ switch (tag >>> 3) {
2528
+ case 1: {
2529
+ if (tag !== 10)
2530
+ break;
2531
+ message.id = reader.string();
2532
+ continue;
2533
+ }
2534
+ default:
2535
+ break;
2536
+ }
2537
+ if ((tag & 7) === 4 || tag === 0) {
2538
+ break;
2539
+ }
2540
+ {
2541
+ if (!writer)
2542
+ writer = new index_js_1.BinaryWriter();
2543
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2544
+ writer.uint32(tag).raw(skipped);
2545
+ }
2546
+ }
2547
+ if (writer) {
2548
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2549
+ }
2550
+ return message;
2551
+ },
2552
+ fromJSON(object) {
2553
+ return applyGetPricingPolicyRequestCustom({
2554
+ $type: "nebius.billing.v1.GetPricingPolicyRequest",
2555
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
2556
+ ? String(object.id ?? object.id)
2557
+ : "",
2558
+ });
2559
+ },
2560
+ toJSON(message, use = "json") {
2561
+ const obj = {};
2562
+ const pick = (json, pb) => (use === "json" ? json : pb);
2563
+ if (message.id !== "") {
2564
+ obj[pick("id", "id")] = message.id;
2565
+ }
2566
+ return obj;
2567
+ },
2568
+ create(base) {
2569
+ return exports.GetPricingPolicyRequest.fromPartial(base ?? {});
2570
+ },
2571
+ fromPartial(object) {
2572
+ const message = createBaseGetPricingPolicyRequest();
2573
+ message.id = (object.id !== undefined && object.id !== null)
2574
+ ? object.id
2575
+ : "";
2576
+ return message;
2577
+ },
2578
+ };
2579
+ protobuf_js_1.protoRegistry.registerMessage(exports.GetPricingPolicyRequest);
2580
+ function GetPricingPolicyRequestCustomInspect() {
2581
+ const parts = [];
2582
+ if (this.id !== "")
2583
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
2584
+ return `${this.$type}(${parts.join(", ")})`;
2585
+ }
2586
+ function GetPricingPolicyRequestCustomJson() {
2587
+ const obj = {
2588
+ type: this.$type,
2589
+ };
2590
+ if (this.id !== "")
2591
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
2592
+ return obj;
2593
+ }
2594
+ function applyGetPricingPolicyRequestCustom(message) {
2595
+ message[logging_js_1.custom] = GetPricingPolicyRequestCustomInspect;
2596
+ message[logging_js_1.customJson] = GetPricingPolicyRequestCustomJson;
2597
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.GetPricingPolicyRequest.$descriptor);
2598
+ }
2599
+ function createBaseGetPricingPolicyRequest() {
2600
+ const message = {
2601
+ $type: "nebius.billing.v1.GetPricingPolicyRequest",
2602
+ id: "",
2603
+ };
2604
+ return applyGetPricingPolicyRequestCustom(message);
2605
+ }
2606
+ const ListPricingPoliciesRequest_MESSAGE_DESCRIPTOR = {
2607
+ fields: {
2608
+ "parentId": { pbName: "parent_id", scalarType: 9 },
2609
+ "pageSize": { pbName: "page_size", scalarType: 3 },
2610
+ "pageToken": { pbName: "page_token", scalarType: 9 },
2611
+ },
2612
+ };
2613
+ /** Encodes, decodes, converts, and creates {@link ListPricingPoliciesRequest} messages. */
2614
+ exports.ListPricingPoliciesRequest = {
2615
+ $type: "nebius.billing.v1.ListPricingPoliciesRequest",
2616
+ $descriptor: ListPricingPoliciesRequest_MESSAGE_DESCRIPTOR,
2617
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2618
+ if (message.parentId !== "") {
2619
+ writer.uint32(10).string(message.parentId);
2620
+ }
2621
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
2622
+ writer.uint32(16).int64(message.pageSize.toString());
2623
+ }
2624
+ if (message.pageToken !== "") {
2625
+ writer.uint32(26).string(message.pageToken);
2626
+ }
2627
+ if (message[index_js_1.unknownFieldsSymbol]) {
2628
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2629
+ }
2630
+ return writer;
2631
+ },
2632
+ decode(input, length) {
2633
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2634
+ const end = length === undefined ? reader.len : reader.pos + length;
2635
+ const message = createBaseListPricingPoliciesRequest();
2636
+ let writer = undefined;
2637
+ while (reader.pos < end) {
2638
+ const tag = reader.uint32();
2639
+ switch (tag >>> 3) {
2640
+ case 1: {
2641
+ if (tag !== 10)
2642
+ break;
2643
+ message.parentId = reader.string();
2644
+ continue;
2645
+ }
2646
+ case 2: {
2647
+ if (tag !== 16)
2648
+ break;
2649
+ message.pageSize = index_js_1.Long.fromValue(reader.int64());
2650
+ continue;
2651
+ }
2652
+ case 3: {
2653
+ if (tag !== 26)
2654
+ break;
2655
+ message.pageToken = reader.string();
2656
+ continue;
2657
+ }
2658
+ default:
2659
+ break;
2660
+ }
2661
+ if ((tag & 7) === 4 || tag === 0) {
2662
+ break;
2663
+ }
2664
+ {
2665
+ if (!writer)
2666
+ writer = new index_js_1.BinaryWriter();
2667
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2668
+ writer.uint32(tag).raw(skipped);
2669
+ }
2670
+ }
2671
+ if (writer) {
2672
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2673
+ }
2674
+ return message;
2675
+ },
2676
+ fromJSON(object) {
2677
+ return applyListPricingPoliciesRequestCustom({
2678
+ $type: "nebius.billing.v1.ListPricingPoliciesRequest",
2679
+ parentId: (0, index_js_1.isSet)(object.parentId ?? object.parent_id)
2680
+ ? String(object.parentId ?? object.parent_id)
2681
+ : "",
2682
+ pageSize: (0, index_js_1.isSet)(object.pageSize ?? object.page_size)
2683
+ ? index_js_1.Long.fromValue(object.pageSize ?? object.page_size)
2684
+ : index_js_1.Long.ZERO,
2685
+ pageToken: (0, index_js_1.isSet)(object.pageToken ?? object.page_token)
2686
+ ? String(object.pageToken ?? object.page_token)
2687
+ : "",
2688
+ });
2689
+ },
2690
+ toJSON(message, use = "json") {
2691
+ const obj = {};
2692
+ const pick = (json, pb) => (use === "json" ? json : pb);
2693
+ if (message.parentId !== "") {
2694
+ obj[pick("parentId", "parent_id")] = message.parentId;
2695
+ }
2696
+ if (!message.pageSize?.isZero?.()) {
2697
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_js_1.Long.ZERO).toString();
2698
+ }
2699
+ if (message.pageToken !== "") {
2700
+ obj[pick("pageToken", "page_token")] = message.pageToken;
2701
+ }
2702
+ return obj;
2703
+ },
2704
+ create(base) {
2705
+ return exports.ListPricingPoliciesRequest.fromPartial(base ?? {});
2706
+ },
2707
+ fromPartial(object) {
2708
+ const message = createBaseListPricingPoliciesRequest();
2709
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
2710
+ ? object.parentId
2711
+ : "";
2712
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
2713
+ ? index_js_1.Long.fromValue(object.pageSize)
2714
+ : index_js_1.Long.ZERO;
2715
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
2716
+ ? object.pageToken
2717
+ : "";
2718
+ return message;
2719
+ },
2720
+ };
2721
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListPricingPoliciesRequest);
2722
+ function ListPricingPoliciesRequestCustomInspect() {
2723
+ const parts = [];
2724
+ if (this.parentId !== "")
2725
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
2726
+ if (!this.pageSize?.isZero?.())
2727
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
2728
+ if (this.pageToken !== "")
2729
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
2730
+ return `${this.$type}(${parts.join(", ")})`;
2731
+ }
2732
+ function ListPricingPoliciesRequestCustomJson() {
2733
+ const obj = {
2734
+ type: this.$type,
2735
+ };
2736
+ if (this.parentId !== "")
2737
+ obj.parentId = (0, logging_js_1.inspectJson)(this.parentId);
2738
+ if (!this.pageSize?.isZero?.())
2739
+ obj.pageSize = (0, logging_js_1.inspectJson)(this.pageSize);
2740
+ if (this.pageToken !== "")
2741
+ obj.pageToken = (0, logging_js_1.inspectJson)(this.pageToken);
2742
+ return obj;
2743
+ }
2744
+ function applyListPricingPoliciesRequestCustom(message) {
2745
+ message[logging_js_1.custom] = ListPricingPoliciesRequestCustomInspect;
2746
+ message[logging_js_1.customJson] = ListPricingPoliciesRequestCustomJson;
2747
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.ListPricingPoliciesRequest.$descriptor);
2748
+ }
2749
+ function createBaseListPricingPoliciesRequest() {
2750
+ const message = {
2751
+ $type: "nebius.billing.v1.ListPricingPoliciesRequest",
2752
+ parentId: "",
2753
+ pageSize: index_js_1.Long.ZERO,
2754
+ pageToken: "",
2755
+ };
2756
+ return applyListPricingPoliciesRequestCustom(message);
2757
+ }
2758
+ const ListPricingPoliciesResponse_MESSAGE_DESCRIPTOR = {
2759
+ fields: {
2760
+ "items": { pbName: "items", repeated: true, message: () => exports.PricingPolicy.$descriptor },
2761
+ "nextPageToken": { pbName: "next_page_token", scalarType: 9 },
2762
+ },
2763
+ };
2764
+ /** Encodes, decodes, converts, and creates {@link ListPricingPoliciesResponse} messages. */
2765
+ exports.ListPricingPoliciesResponse = {
2766
+ $type: "nebius.billing.v1.ListPricingPoliciesResponse",
2767
+ $descriptor: ListPricingPoliciesResponse_MESSAGE_DESCRIPTOR,
2768
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2769
+ for (const v of (message.items ?? [])) {
2770
+ const w = writer.uint32(10).fork();
2771
+ exports.PricingPolicy.encode(v, w);
2772
+ w.join();
2773
+ }
2774
+ if (message.nextPageToken !== "") {
2775
+ writer.uint32(18).string(message.nextPageToken);
2776
+ }
2777
+ if (message[index_js_1.unknownFieldsSymbol]) {
2778
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2779
+ }
2780
+ return writer;
2781
+ },
2782
+ decode(input, length) {
2783
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2784
+ const end = length === undefined ? reader.len : reader.pos + length;
2785
+ const message = createBaseListPricingPoliciesResponse();
2786
+ let writer = undefined;
2787
+ while (reader.pos < end) {
2788
+ const tag = reader.uint32();
2789
+ switch (tag >>> 3) {
2790
+ case 1: {
2791
+ if (tag !== 10)
2792
+ break;
2793
+ message.items.push(exports.PricingPolicy.decode(reader, reader.uint32()));
2794
+ continue;
2795
+ }
2796
+ case 2: {
2797
+ if (tag !== 18)
2798
+ break;
2799
+ message.nextPageToken = reader.string();
2800
+ continue;
2801
+ }
2802
+ default:
2803
+ break;
2804
+ }
2805
+ if ((tag & 7) === 4 || tag === 0) {
2806
+ break;
2807
+ }
2808
+ {
2809
+ if (!writer)
2810
+ writer = new index_js_1.BinaryWriter();
2811
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2812
+ writer.uint32(tag).raw(skipped);
2813
+ }
2814
+ }
2815
+ if (writer) {
2816
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2817
+ }
2818
+ return message;
2819
+ },
2820
+ fromJSON(object) {
2821
+ return applyListPricingPoliciesResponseCustom({
2822
+ $type: "nebius.billing.v1.ListPricingPoliciesResponse",
2823
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
2824
+ ? (object.items ?? object.items).map((e) => exports.PricingPolicy.fromJSON(e))
2825
+ : [],
2826
+ nextPageToken: (0, index_js_1.isSet)(object.nextPageToken ?? object.next_page_token)
2827
+ ? String(object.nextPageToken ?? object.next_page_token)
2828
+ : "",
2829
+ });
2830
+ },
2831
+ toJSON(message, use = "json") {
2832
+ const obj = {};
2833
+ const pick = (json, pb) => (use === "json" ? json : pb);
2834
+ if (message.items?.length) {
2835
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.PricingPolicy.toJSON(e, use) : undefined);
2836
+ }
2837
+ if (message.nextPageToken !== "") {
2838
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
2839
+ }
2840
+ return obj;
2841
+ },
2842
+ create(base) {
2843
+ return exports.ListPricingPoliciesResponse.fromPartial(base ?? {});
2844
+ },
2845
+ fromPartial(object) {
2846
+ const message = createBaseListPricingPoliciesResponse();
2847
+ message.items = object.items?.map((e) => exports.PricingPolicy.fromPartial(e)) || [];
2848
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
2849
+ ? object.nextPageToken
2850
+ : "";
2851
+ return message;
2852
+ },
2853
+ };
2854
+ protobuf_js_1.protoRegistry.registerMessage(exports.ListPricingPoliciesResponse);
2855
+ function ListPricingPoliciesResponseCustomInspect() {
2856
+ const parts = [];
2857
+ if ((this.items?.length ?? 0) !== 0)
2858
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
2859
+ if (this.nextPageToken !== "")
2860
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
2861
+ return `${this.$type}(${parts.join(", ")})`;
2862
+ }
2863
+ function ListPricingPoliciesResponseCustomJson() {
2864
+ const obj = {
2865
+ type: this.$type,
2866
+ };
2867
+ if ((this.items?.length ?? 0) !== 0)
2868
+ obj.items = (0, logging_js_1.inspectJson)(this.items);
2869
+ if (this.nextPageToken !== "")
2870
+ obj.nextPageToken = (0, logging_js_1.inspectJson)(this.nextPageToken);
2871
+ return obj;
2872
+ }
2873
+ function applyListPricingPoliciesResponseCustom(message) {
2874
+ message[logging_js_1.custom] = ListPricingPoliciesResponseCustomInspect;
2875
+ message[logging_js_1.customJson] = ListPricingPoliciesResponseCustomJson;
2876
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.ListPricingPoliciesResponse.$descriptor);
2877
+ }
2878
+ function createBaseListPricingPoliciesResponse() {
2879
+ const message = {
2880
+ $type: "nebius.billing.v1.ListPricingPoliciesResponse",
2881
+ items: [],
2882
+ nextPageToken: "",
2883
+ };
2884
+ return applyListPricingPoliciesResponseCustom(message);
2885
+ }
2886
+ const UpdatePricingPolicyRequest_MESSAGE_DESCRIPTOR = {
2887
+ fields: {
2888
+ "metadata": { pbName: "metadata", message: () => index_js_2.ResourceMetadata.$descriptor },
2889
+ "spec": { pbName: "spec", message: () => exports.PricingPolicySpec.$descriptor },
2890
+ },
2891
+ };
2892
+ /** Encodes, decodes, converts, and creates {@link UpdatePricingPolicyRequest} messages. */
2893
+ exports.UpdatePricingPolicyRequest = {
2894
+ $type: "nebius.billing.v1.UpdatePricingPolicyRequest",
2895
+ $descriptor: UpdatePricingPolicyRequest_MESSAGE_DESCRIPTOR,
2896
+ encode(message, writer = new index_js_1.BinaryWriter()) {
2897
+ if (message.metadata !== undefined) {
2898
+ const w = writer.uint32(10).fork();
2899
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
2900
+ w.join();
2901
+ }
2902
+ if (message.spec !== undefined) {
2903
+ const w = writer.uint32(18).fork();
2904
+ exports.PricingPolicySpec.encode(message.spec, w);
2905
+ w.join();
2906
+ }
2907
+ if (message[index_js_1.unknownFieldsSymbol]) {
2908
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
2909
+ }
2910
+ return writer;
2911
+ },
2912
+ decode(input, length) {
2913
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
2914
+ const end = length === undefined ? reader.len : reader.pos + length;
2915
+ const message = createBaseUpdatePricingPolicyRequest();
2916
+ let writer = undefined;
2917
+ while (reader.pos < end) {
2918
+ const tag = reader.uint32();
2919
+ switch (tag >>> 3) {
2920
+ case 1: {
2921
+ if (tag !== 10)
2922
+ break;
2923
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
2924
+ continue;
2925
+ }
2926
+ case 2: {
2927
+ if (tag !== 18)
2928
+ break;
2929
+ message.spec = exports.PricingPolicySpec.decode(reader, reader.uint32());
2930
+ continue;
2931
+ }
2932
+ default:
2933
+ break;
2934
+ }
2935
+ if ((tag & 7) === 4 || tag === 0) {
2936
+ break;
2937
+ }
2938
+ {
2939
+ if (!writer)
2940
+ writer = new index_js_1.BinaryWriter();
2941
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2942
+ writer.uint32(tag).raw(skipped);
2943
+ }
2944
+ }
2945
+ if (writer) {
2946
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
2947
+ }
2948
+ return message;
2949
+ },
2950
+ fromJSON(object) {
2951
+ return applyUpdatePricingPolicyRequestCustom({
2952
+ $type: "nebius.billing.v1.UpdatePricingPolicyRequest",
2953
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
2954
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
2955
+ : undefined,
2956
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
2957
+ ? exports.PricingPolicySpec.fromJSON(object.spec ?? object.spec)
2958
+ : undefined,
2959
+ });
2960
+ },
2961
+ toJSON(message, use = "json") {
2962
+ const obj = {};
2963
+ const pick = (json, pb) => (use === "json" ? json : pb);
2964
+ if (message.metadata !== undefined) {
2965
+ obj[pick("metadata", "metadata")] = message.metadata
2966
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
2967
+ : undefined;
2968
+ }
2969
+ if (message.spec !== undefined) {
2970
+ obj[pick("spec", "spec")] = message.spec
2971
+ ? exports.PricingPolicySpec.toJSON(message.spec, use)
2972
+ : undefined;
2973
+ }
2974
+ return obj;
2975
+ },
2976
+ create(base) {
2977
+ return exports.UpdatePricingPolicyRequest.fromPartial(base ?? {});
2978
+ },
2979
+ fromPartial(object) {
2980
+ const message = createBaseUpdatePricingPolicyRequest();
2981
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
2982
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
2983
+ : undefined;
2984
+ message.spec = (object.spec !== undefined && object.spec !== null)
2985
+ ? exports.PricingPolicySpec.fromPartial(object.spec)
2986
+ : undefined;
2987
+ return message;
2988
+ },
2989
+ };
2990
+ protobuf_js_1.protoRegistry.registerMessage(exports.UpdatePricingPolicyRequest);
2991
+ function UpdatePricingPolicyRequestCustomInspect() {
2992
+ const parts = [];
2993
+ if (this.metadata !== undefined)
2994
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
2995
+ if (this.spec !== undefined)
2996
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
2997
+ return `${this.$type}(${parts.join(", ")})`;
2998
+ }
2999
+ function UpdatePricingPolicyRequestCustomJson() {
3000
+ const obj = {
3001
+ type: this.$type,
3002
+ };
3003
+ if (this.metadata !== undefined)
3004
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
3005
+ if (this.spec !== undefined)
3006
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
3007
+ return obj;
3008
+ }
3009
+ function applyUpdatePricingPolicyRequestCustom(message) {
3010
+ message[logging_js_1.custom] = UpdatePricingPolicyRequestCustomInspect;
3011
+ message[logging_js_1.customJson] = UpdatePricingPolicyRequestCustomJson;
3012
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.UpdatePricingPolicyRequest.$descriptor);
3013
+ }
3014
+ function createBaseUpdatePricingPolicyRequest() {
3015
+ const message = {
3016
+ $type: "nebius.billing.v1.UpdatePricingPolicyRequest",
3017
+ metadata: undefined,
3018
+ spec: undefined,
3019
+ };
3020
+ return applyUpdatePricingPolicyRequestCustom(message);
3021
+ }
3022
+ const DeletePricingPolicyRequest_MESSAGE_DESCRIPTOR = {
3023
+ fields: {
3024
+ "id": { pbName: "id", scalarType: 9 },
3025
+ },
3026
+ };
3027
+ /** Encodes, decodes, converts, and creates {@link DeletePricingPolicyRequest} messages. */
3028
+ exports.DeletePricingPolicyRequest = {
3029
+ $type: "nebius.billing.v1.DeletePricingPolicyRequest",
3030
+ $descriptor: DeletePricingPolicyRequest_MESSAGE_DESCRIPTOR,
3031
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3032
+ if (message.id !== "") {
3033
+ writer.uint32(10).string(message.id);
3034
+ }
3035
+ if (message[index_js_1.unknownFieldsSymbol]) {
3036
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3037
+ }
3038
+ return writer;
3039
+ },
3040
+ decode(input, length) {
3041
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3042
+ const end = length === undefined ? reader.len : reader.pos + length;
3043
+ const message = createBaseDeletePricingPolicyRequest();
3044
+ let writer = undefined;
3045
+ while (reader.pos < end) {
3046
+ const tag = reader.uint32();
3047
+ switch (tag >>> 3) {
3048
+ case 1: {
3049
+ if (tag !== 10)
3050
+ break;
3051
+ message.id = reader.string();
3052
+ continue;
3053
+ }
3054
+ default:
3055
+ break;
3056
+ }
3057
+ if ((tag & 7) === 4 || tag === 0) {
3058
+ break;
3059
+ }
3060
+ {
3061
+ if (!writer)
3062
+ writer = new index_js_1.BinaryWriter();
3063
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3064
+ writer.uint32(tag).raw(skipped);
3065
+ }
3066
+ }
3067
+ if (writer) {
3068
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3069
+ }
3070
+ return message;
3071
+ },
3072
+ fromJSON(object) {
3073
+ return applyDeletePricingPolicyRequestCustom({
3074
+ $type: "nebius.billing.v1.DeletePricingPolicyRequest",
3075
+ id: (0, index_js_1.isSet)(object.id ?? object.id)
3076
+ ? String(object.id ?? object.id)
3077
+ : "",
3078
+ });
3079
+ },
3080
+ toJSON(message, use = "json") {
3081
+ const obj = {};
3082
+ const pick = (json, pb) => (use === "json" ? json : pb);
3083
+ if (message.id !== "") {
3084
+ obj[pick("id", "id")] = message.id;
3085
+ }
3086
+ return obj;
3087
+ },
3088
+ create(base) {
3089
+ return exports.DeletePricingPolicyRequest.fromPartial(base ?? {});
3090
+ },
3091
+ fromPartial(object) {
3092
+ const message = createBaseDeletePricingPolicyRequest();
3093
+ message.id = (object.id !== undefined && object.id !== null)
3094
+ ? object.id
3095
+ : "";
3096
+ return message;
3097
+ },
3098
+ };
3099
+ protobuf_js_1.protoRegistry.registerMessage(exports.DeletePricingPolicyRequest);
3100
+ function DeletePricingPolicyRequestCustomInspect() {
3101
+ const parts = [];
3102
+ if (this.id !== "")
3103
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
3104
+ return `${this.$type}(${parts.join(", ")})`;
3105
+ }
3106
+ function DeletePricingPolicyRequestCustomJson() {
3107
+ const obj = {
3108
+ type: this.$type,
3109
+ };
3110
+ if (this.id !== "")
3111
+ obj.id = (0, logging_js_1.inspectJson)(this.id);
3112
+ return obj;
3113
+ }
3114
+ function applyDeletePricingPolicyRequestCustom(message) {
3115
+ message[logging_js_1.custom] = DeletePricingPolicyRequestCustomInspect;
3116
+ message[logging_js_1.customJson] = DeletePricingPolicyRequestCustomJson;
3117
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.DeletePricingPolicyRequest.$descriptor);
3118
+ }
3119
+ function createBaseDeletePricingPolicyRequest() {
3120
+ const message = {
3121
+ $type: "nebius.billing.v1.DeletePricingPolicyRequest",
3122
+ id: "",
3123
+ };
3124
+ return applyDeletePricingPolicyRequestCustom(message);
3125
+ }
3126
+ /**
3127
+ * Describes the gRPC methods for the `nebius.billing.v1.PricingPolicyService` service.
3128
+ */
3129
+ exports.PricingPolicyServiceServiceDescription = {
3130
+ create: {
3131
+ path: "/nebius.billing.v1.PricingPolicyService/Create",
3132
+ requestStream: false,
3133
+ responseStream: false,
3134
+ requestSerialize: (value) => Buffer.from(exports.CreatePricingPolicyRequest.encode(value).finish()),
3135
+ requestDescriptor: () => exports.CreatePricingPolicyRequest.$descriptor,
3136
+ sendResetMask: false,
3137
+ requestDeserialize: (value) => exports.CreatePricingPolicyRequest.decode(value),
3138
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
3139
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
3140
+ },
3141
+ get: {
3142
+ path: "/nebius.billing.v1.PricingPolicyService/Get",
3143
+ requestStream: false,
3144
+ responseStream: false,
3145
+ requestSerialize: (value) => Buffer.from(exports.GetPricingPolicyRequest.encode(value).finish()),
3146
+ requestDescriptor: () => exports.GetPricingPolicyRequest.$descriptor,
3147
+ sendResetMask: false,
3148
+ requestDeserialize: (value) => exports.GetPricingPolicyRequest.decode(value),
3149
+ responseSerialize: (value) => Buffer.from(exports.PricingPolicy.encode(value).finish()),
3150
+ responseDeserialize: (value) => exports.PricingPolicy.decode(value),
3151
+ },
3152
+ getByName: {
3153
+ path: "/nebius.billing.v1.PricingPolicyService/GetByName",
3154
+ requestStream: false,
3155
+ responseStream: false,
3156
+ requestSerialize: (value) => Buffer.from(index_js_2.GetByNameRequest.encode(value).finish()),
3157
+ requestDescriptor: () => index_js_2.GetByNameRequest.$descriptor,
3158
+ sendResetMask: false,
3159
+ requestDeserialize: (value) => index_js_2.GetByNameRequest.decode(value),
3160
+ responseSerialize: (value) => Buffer.from(exports.PricingPolicy.encode(value).finish()),
3161
+ responseDeserialize: (value) => exports.PricingPolicy.decode(value),
3162
+ },
3163
+ list: {
3164
+ path: "/nebius.billing.v1.PricingPolicyService/List",
3165
+ requestStream: false,
3166
+ responseStream: false,
3167
+ requestSerialize: (value) => Buffer.from(exports.ListPricingPoliciesRequest.encode(value).finish()),
3168
+ requestDescriptor: () => exports.ListPricingPoliciesRequest.$descriptor,
3169
+ sendResetMask: false,
3170
+ requestDeserialize: (value) => exports.ListPricingPoliciesRequest.decode(value),
3171
+ responseSerialize: (value) => Buffer.from(exports.ListPricingPoliciesResponse.encode(value).finish()),
3172
+ responseDeserialize: (value) => exports.ListPricingPoliciesResponse.decode(value),
3173
+ },
3174
+ update: {
3175
+ path: "/nebius.billing.v1.PricingPolicyService/Update",
3176
+ requestStream: false,
3177
+ responseStream: false,
3178
+ requestSerialize: (value) => Buffer.from(exports.UpdatePricingPolicyRequest.encode(value).finish()),
3179
+ requestDescriptor: () => exports.UpdatePricingPolicyRequest.$descriptor,
3180
+ sendResetMask: true,
3181
+ requestDeserialize: (value) => exports.UpdatePricingPolicyRequest.decode(value),
3182
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
3183
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
3184
+ },
3185
+ delete: {
3186
+ path: "/nebius.billing.v1.PricingPolicyService/Delete",
3187
+ requestStream: false,
3188
+ responseStream: false,
3189
+ requestSerialize: (value) => Buffer.from(exports.DeletePricingPolicyRequest.encode(value).finish()),
3190
+ requestDescriptor: () => exports.DeletePricingPolicyRequest.$descriptor,
3191
+ sendResetMask: false,
3192
+ requestDeserialize: (value) => exports.DeletePricingPolicyRequest.decode(value),
3193
+ responseSerialize: (value) => Buffer.from(index_js_2.Operation.encode(value).finish()),
3194
+ responseDeserialize: (value) => index_js_2.Operation.decode(value),
3195
+ },
3196
+ };
3197
+ /**
3198
+ * Creates low-level gRPC clients for the `nebius.billing.v1.PricingPolicyService` service.
3199
+ */
3200
+ exports.PricingPolicyServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.PricingPolicyServiceServiceDescription, "nebius.billing.v1.PricingPolicyService");
3201
+ /**
3202
+ * Calls the `nebius.billing.v1.PricingPolicyService` service through the Nebius SDK.
3203
+ */
3204
+ class PricingPolicyService {
3205
+ sdk;
3206
+ $type = "nebius.billing.v1.PricingPolicyService";
3207
+ addr;
3208
+ spec;
3209
+ apiServiceName = "pricing-policies.billing-cpl";
3210
+ /** Creates a client that uses the SDK service address. */
3211
+ constructor(sdk) {
3212
+ this.sdk = sdk;
3213
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
3214
+ this.addr = addr;
3215
+ this.spec = exports.PricingPolicyServiceServiceDescription;
3216
+ }
3217
+ /** Returns the operation service for this service address. */
3218
+ getOperationService() {
3219
+ return new index_js_2.OperationService(this.sdk, this.addr);
3220
+ }
3221
+ /**
3222
+ * Creates a pricing policy. A bid outside the allowed price range fails
3223
+ * with OUT_OF_RANGE; below the current market price it is accepted but the
3224
+ * policy starts SCHEDULING_STATE_BLOCKED. Policies per tenant are
3225
+ * quota-limited (RESOURCE_EXHAUSTED past the limit).
3226
+ * The Operation completes once the policy is ready to back VMs.
3227
+ *
3228
+ */
3229
+ create(...args) {
3230
+ const spec = this.spec.create;
3231
+ const request = args[0];
3232
+ const metadata = (args.length > 1 ? args[1] : undefined);
3233
+ const options = (args.length > 2 ? args[2] : undefined);
3234
+ const deserialize = (value) => {
3235
+ const resp = spec.responseDeserialize(value);
3236
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
3237
+ };
3238
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3239
+ }
3240
+ /**
3241
+ * Calls the `Get` RPC.
3242
+ */
3243
+ get(...args) {
3244
+ const spec = this.spec.get;
3245
+ const request = args[0];
3246
+ const metadata = (args.length > 1 ? args[1] : undefined);
3247
+ const options = (args.length > 2 ? args[2] : undefined);
3248
+ const deserialize = spec.responseDeserialize;
3249
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3250
+ }
3251
+ /**
3252
+ * Calls the `GetByName` RPC.
3253
+ */
3254
+ getByName(...args) {
3255
+ const spec = this.spec.getByName;
3256
+ const request = args[0];
3257
+ const metadata = (args.length > 1 ? args[1] : undefined);
3258
+ const options = (args.length > 2 ? args[2] : undefined);
3259
+ const deserialize = spec.responseDeserialize;
3260
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3261
+ }
3262
+ /**
3263
+ * Calls the `List` RPC.
3264
+ */
3265
+ list(...args) {
3266
+ const spec = this.spec.list;
3267
+ const request = args[0];
3268
+ const metadata = (args.length > 1 ? args[1] : undefined);
3269
+ const options = (args.length > 2 ? args[2] : undefined);
3270
+ const deserialize = spec.responseDeserialize;
3271
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3272
+ }
3273
+ /**
3274
+ * Updates a pricing policy. `metadata.name` may change any time; the bid in
3275
+ * `spec.pricing.max_price_v1` only while `status.running_vm_count` is 0
3276
+ * (FAILED_PRECONDITION otherwise). Other spec fields are immutable
3277
+ * (INVALID_ARGUMENT).
3278
+ *
3279
+ */
3280
+ update(...args) {
3281
+ const spec = this.spec.update;
3282
+ const request = args[0];
3283
+ const metadata = (args.length > 1 ? args[1] : undefined);
3284
+ const options = (args.length > 2 ? args[2] : undefined);
3285
+ const deserialize = (value) => {
3286
+ const resp = spec.responseDeserialize(value);
3287
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
3288
+ };
3289
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3290
+ }
3291
+ /**
3292
+ * Deletes a pricing policy. Requires that no VM runs under the policy and
3293
+ * nothing is being preempted (FAILED_PRECONDITION otherwise).
3294
+ *
3295
+ */
3296
+ delete(...args) {
3297
+ const spec = this.spec.delete;
3298
+ const request = args[0];
3299
+ const metadata = (args.length > 1 ? args[1] : undefined);
3300
+ const options = (args.length > 2 ? args[2] : undefined);
3301
+ const deserialize = (value) => {
3302
+ const resp = spec.responseDeserialize(value);
3303
+ return new operation_js_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
3304
+ };
3305
+ return new request_js_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
3306
+ }
3307
+ }
3308
+ exports.PricingPolicyService = PricingPolicyService;
3309
+ const PricingPolicyStatus_State_VALUE_COMMENTS = {
3310
+ STATE_CREATING: " Not ready yet; a VM referencing the policy gets a retryable error.\n",
3311
+ STATE_ACTIVE: " Ready; whether VMs may start is `scheduling_state`.\n",
3312
+ STATE_DELETING: " Being deleted; does not accept new VMs.\n",
3313
+ STATE_UPDATING: " The bid is being changed; scheduling is blocked until the change lands.\n",
3314
+ };
3315
+ /** Converts and creates {@link PricingPolicyStatus_State} values. */
3316
+ exports.PricingPolicyStatus_State = (0, index_js_1.createEnum)("nebius.billing.v1.PricingPolicyStatus.State", {
3317
+ /**
3318
+ * Represents the `STATE_UNSPECIFIED` protobuf enum value.
3319
+ */
3320
+ STATE_UNSPECIFIED: 0,
3321
+ /**
3322
+ * Not ready yet; a VM referencing the policy gets a retryable error.
3323
+ *
3324
+ */
3325
+ STATE_CREATING: 1,
3326
+ /**
3327
+ * Ready; whether VMs may start is `scheduling_state`.
3328
+ *
3329
+ */
3330
+ STATE_ACTIVE: 2,
3331
+ /**
3332
+ * Being deleted; does not accept new VMs.
3333
+ *
3334
+ */
3335
+ STATE_DELETING: 3,
3336
+ /**
3337
+ * The bid is being changed; scheduling is blocked until the change lands.
3338
+ *
3339
+ */
3340
+ STATE_UPDATING: 4,
3341
+ }, PricingPolicyStatus_State_VALUE_COMMENTS);
3342
+ protobuf_js_1.protoRegistry.registerEnum(exports.PricingPolicyStatus_State);
3343
+ const PricingPolicyStatus_SchedulingState_VALUE_COMMENTS = {
3344
+ SCHEDULING_STATE_ALLOWED: " New VMs may start.\n",
3345
+ SCHEDULING_STATE_BLOCKED: " The max_price limit is below the current market price; VM creation succeeds once\n the price falls to it.\n",
3346
+ };
3347
+ /** Converts and creates {@link PricingPolicyStatus_SchedulingState} values. */
3348
+ exports.PricingPolicyStatus_SchedulingState = (0, index_js_1.createEnum)("nebius.billing.v1.PricingPolicyStatus.SchedulingState", {
3349
+ /**
3350
+ * Represents the `SCHEDULING_STATE_UNSPECIFIED` protobuf enum value.
3351
+ */
3352
+ SCHEDULING_STATE_UNSPECIFIED: 0,
3353
+ /**
3354
+ * New VMs may start.
3355
+ *
3356
+ */
3357
+ SCHEDULING_STATE_ALLOWED: 1,
3358
+ /**
3359
+ * The max_price limit is below the current market price; VM creation succeeds once
3360
+ * the price falls to it.
3361
+ *
3362
+ */
3363
+ SCHEDULING_STATE_BLOCKED: 2,
3364
+ }, PricingPolicyStatus_SchedulingState_VALUE_COMMENTS);
3365
+ protobuf_js_1.protoRegistry.registerEnum(exports.PricingPolicyStatus_SchedulingState);
3366
+ const PricingPolicy_MESSAGE_DESCRIPTOR = {
3367
+ fields: {
3368
+ "metadata": { pbName: "metadata", message: () => index_js_2.ResourceMetadata.$descriptor },
3369
+ "spec": { pbName: "spec", message: () => exports.PricingPolicySpec.$descriptor },
3370
+ "status": { pbName: "status", message: () => exports.PricingPolicyStatus.$descriptor },
3371
+ },
3372
+ };
3373
+ /** Encodes, decodes, converts, and creates {@link PricingPolicy} messages. */
3374
+ exports.PricingPolicy = {
3375
+ $type: "nebius.billing.v1.PricingPolicy",
3376
+ $descriptor: PricingPolicy_MESSAGE_DESCRIPTOR,
3377
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3378
+ if (message.metadata !== undefined) {
3379
+ const w = writer.uint32(10).fork();
3380
+ index_js_2.ResourceMetadata.encode(message.metadata, w);
3381
+ w.join();
3382
+ }
3383
+ if (message.spec !== undefined) {
3384
+ const w = writer.uint32(18).fork();
3385
+ exports.PricingPolicySpec.encode(message.spec, w);
3386
+ w.join();
3387
+ }
3388
+ if (message.status !== undefined) {
3389
+ const w = writer.uint32(26).fork();
3390
+ exports.PricingPolicyStatus.encode(message.status, w);
3391
+ w.join();
3392
+ }
3393
+ if (message[index_js_1.unknownFieldsSymbol]) {
3394
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3395
+ }
3396
+ return writer;
3397
+ },
3398
+ decode(input, length) {
3399
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3400
+ const end = length === undefined ? reader.len : reader.pos + length;
3401
+ const message = createBasePricingPolicy();
3402
+ let writer = undefined;
3403
+ while (reader.pos < end) {
3404
+ const tag = reader.uint32();
3405
+ switch (tag >>> 3) {
3406
+ case 1: {
3407
+ if (tag !== 10)
3408
+ break;
3409
+ message.metadata = index_js_2.ResourceMetadata.decode(reader, reader.uint32());
3410
+ continue;
3411
+ }
3412
+ case 2: {
3413
+ if (tag !== 18)
3414
+ break;
3415
+ message.spec = exports.PricingPolicySpec.decode(reader, reader.uint32());
3416
+ continue;
3417
+ }
3418
+ case 3: {
3419
+ if (tag !== 26)
3420
+ break;
3421
+ message.status = exports.PricingPolicyStatus.decode(reader, reader.uint32());
3422
+ continue;
3423
+ }
3424
+ default:
3425
+ break;
3426
+ }
3427
+ if ((tag & 7) === 4 || tag === 0) {
3428
+ break;
3429
+ }
3430
+ {
3431
+ if (!writer)
3432
+ writer = new index_js_1.BinaryWriter();
3433
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3434
+ writer.uint32(tag).raw(skipped);
3435
+ }
3436
+ }
3437
+ if (writer) {
3438
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3439
+ }
3440
+ return message;
3441
+ },
3442
+ fromJSON(object) {
3443
+ return applyPricingPolicyCustom({
3444
+ $type: "nebius.billing.v1.PricingPolicy",
3445
+ metadata: (0, index_js_1.isSet)(object.metadata ?? object.metadata)
3446
+ ? index_js_2.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
3447
+ : undefined,
3448
+ spec: (0, index_js_1.isSet)(object.spec ?? object.spec)
3449
+ ? exports.PricingPolicySpec.fromJSON(object.spec ?? object.spec)
3450
+ : undefined,
3451
+ status: (0, index_js_1.isSet)(object.status ?? object.status)
3452
+ ? exports.PricingPolicyStatus.fromJSON(object.status ?? object.status)
3453
+ : undefined,
3454
+ });
3455
+ },
3456
+ toJSON(message, use = "json") {
3457
+ const obj = {};
3458
+ const pick = (json, pb) => (use === "json" ? json : pb);
3459
+ if (message.metadata !== undefined) {
3460
+ obj[pick("metadata", "metadata")] = message.metadata
3461
+ ? index_js_2.ResourceMetadata.toJSON(message.metadata, use)
3462
+ : undefined;
3463
+ }
3464
+ if (message.spec !== undefined) {
3465
+ obj[pick("spec", "spec")] = message.spec
3466
+ ? exports.PricingPolicySpec.toJSON(message.spec, use)
3467
+ : undefined;
3468
+ }
3469
+ if (message.status !== undefined) {
3470
+ obj[pick("status", "status")] = message.status
3471
+ ? exports.PricingPolicyStatus.toJSON(message.status, use)
3472
+ : undefined;
3473
+ }
3474
+ return obj;
3475
+ },
3476
+ create(base) {
3477
+ return exports.PricingPolicy.fromPartial(base ?? {});
3478
+ },
3479
+ fromPartial(object) {
3480
+ const message = createBasePricingPolicy();
3481
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
3482
+ ? index_js_2.ResourceMetadata.fromPartial(object.metadata)
3483
+ : undefined;
3484
+ message.spec = (object.spec !== undefined && object.spec !== null)
3485
+ ? exports.PricingPolicySpec.fromPartial(object.spec)
3486
+ : undefined;
3487
+ message.status = (object.status !== undefined && object.status !== null)
3488
+ ? exports.PricingPolicyStatus.fromPartial(object.status)
3489
+ : undefined;
3490
+ return message;
3491
+ },
3492
+ };
3493
+ protobuf_js_1.protoRegistry.registerMessage(exports.PricingPolicy);
3494
+ function PricingPolicyCustomInspect() {
3495
+ const parts = [];
3496
+ if (this.metadata !== undefined)
3497
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
3498
+ if (this.spec !== undefined)
3499
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
3500
+ if (this.status !== undefined)
3501
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
3502
+ return `${this.$type}(${parts.join(", ")})`;
3503
+ }
3504
+ function PricingPolicyCustomJson() {
3505
+ const obj = {
3506
+ type: this.$type,
3507
+ };
3508
+ if (this.metadata !== undefined)
3509
+ obj.metadata = (0, logging_js_1.inspectJson)(this.metadata);
3510
+ if (this.spec !== undefined)
3511
+ obj.spec = (0, logging_js_1.inspectJson)(this.spec);
3512
+ if (this.status !== undefined)
3513
+ obj.status = (0, logging_js_1.inspectJson)(this.status);
3514
+ return obj;
3515
+ }
3516
+ function applyPricingPolicyCustom(message) {
3517
+ message[logging_js_1.custom] = PricingPolicyCustomInspect;
3518
+ message[logging_js_1.customJson] = PricingPolicyCustomJson;
3519
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.PricingPolicy.$descriptor);
3520
+ }
3521
+ function createBasePricingPolicy() {
3522
+ const message = {
3523
+ $type: "nebius.billing.v1.PricingPolicy",
3524
+ metadata: undefined,
3525
+ spec: undefined,
3526
+ status: undefined,
3527
+ };
3528
+ return applyPricingPolicyCustom(message);
3529
+ }
3530
+ const PricingPolicySpec_MESSAGE_DESCRIPTOR = {
3531
+ fields: {
3532
+ "computeInstanceSpec": { pbName: "compute_instance_spec", immutable: true, message: () => exports.ComputeInstanceSpec.$descriptor },
3533
+ "pricing": { pbName: "pricing", message: () => exports.PricingMethod.$descriptor },
3534
+ },
3535
+ };
3536
+ /** Encodes, decodes, converts, and creates {@link PricingPolicySpec} messages. */
3537
+ exports.PricingPolicySpec = {
3538
+ $type: "nebius.billing.v1.PricingPolicySpec",
3539
+ $descriptor: PricingPolicySpec_MESSAGE_DESCRIPTOR,
3540
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3541
+ if (message.computeInstanceSpec !== undefined) {
3542
+ const w = writer.uint32(10).fork();
3543
+ exports.ComputeInstanceSpec.encode(message.computeInstanceSpec, w);
3544
+ w.join();
3545
+ }
3546
+ if (message.pricing !== undefined) {
3547
+ const w = writer.uint32(18).fork();
3548
+ exports.PricingMethod.encode(message.pricing, w);
3549
+ w.join();
3550
+ }
3551
+ if (message[index_js_1.unknownFieldsSymbol]) {
3552
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3553
+ }
3554
+ return writer;
3555
+ },
3556
+ decode(input, length) {
3557
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3558
+ const end = length === undefined ? reader.len : reader.pos + length;
3559
+ const message = createBasePricingPolicySpec();
3560
+ let writer = undefined;
3561
+ while (reader.pos < end) {
3562
+ const tag = reader.uint32();
3563
+ switch (tag >>> 3) {
3564
+ case 1: {
3565
+ if (tag !== 10)
3566
+ break;
3567
+ message.computeInstanceSpec = exports.ComputeInstanceSpec.decode(reader, reader.uint32());
3568
+ continue;
3569
+ }
3570
+ case 2: {
3571
+ if (tag !== 18)
3572
+ break;
3573
+ message.pricing = exports.PricingMethod.decode(reader, reader.uint32());
3574
+ continue;
3575
+ }
3576
+ default:
3577
+ break;
3578
+ }
3579
+ if ((tag & 7) === 4 || tag === 0) {
3580
+ break;
3581
+ }
3582
+ {
3583
+ if (!writer)
3584
+ writer = new index_js_1.BinaryWriter();
3585
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3586
+ writer.uint32(tag).raw(skipped);
3587
+ }
3588
+ }
3589
+ if (writer) {
3590
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3591
+ }
3592
+ return message;
3593
+ },
3594
+ fromJSON(object) {
3595
+ return applyPricingPolicySpecCustom({
3596
+ $type: "nebius.billing.v1.PricingPolicySpec",
3597
+ computeInstanceSpec: (0, index_js_1.isSet)(object.computeInstanceSpec ?? object.compute_instance_spec)
3598
+ ? exports.ComputeInstanceSpec.fromJSON(object.computeInstanceSpec ?? object.compute_instance_spec)
3599
+ : undefined,
3600
+ pricing: (0, index_js_1.isSet)(object.pricing ?? object.pricing)
3601
+ ? exports.PricingMethod.fromJSON(object.pricing ?? object.pricing)
3602
+ : undefined,
3603
+ });
3604
+ },
3605
+ toJSON(message, use = "json") {
3606
+ const obj = {};
3607
+ const pick = (json, pb) => (use === "json" ? json : pb);
3608
+ if (message.computeInstanceSpec !== undefined) {
3609
+ obj[pick("computeInstanceSpec", "compute_instance_spec")] = message.computeInstanceSpec
3610
+ ? exports.ComputeInstanceSpec.toJSON(message.computeInstanceSpec, use)
3611
+ : undefined;
3612
+ }
3613
+ if (message.pricing !== undefined) {
3614
+ obj[pick("pricing", "pricing")] = message.pricing
3615
+ ? exports.PricingMethod.toJSON(message.pricing, use)
3616
+ : undefined;
3617
+ }
3618
+ return obj;
3619
+ },
3620
+ create(base) {
3621
+ return exports.PricingPolicySpec.fromPartial(base ?? {});
3622
+ },
3623
+ fromPartial(object) {
3624
+ const message = createBasePricingPolicySpec();
3625
+ message.computeInstanceSpec = (object.computeInstanceSpec !== undefined && object.computeInstanceSpec !== null)
3626
+ ? exports.ComputeInstanceSpec.fromPartial(object.computeInstanceSpec)
3627
+ : undefined;
3628
+ message.pricing = (object.pricing !== undefined && object.pricing !== null)
3629
+ ? exports.PricingMethod.fromPartial(object.pricing)
3630
+ : undefined;
3631
+ return message;
3632
+ },
3633
+ };
3634
+ protobuf_js_1.protoRegistry.registerMessage(exports.PricingPolicySpec);
3635
+ function PricingPolicySpecCustomInspect() {
3636
+ const parts = [];
3637
+ if (this.computeInstanceSpec !== undefined)
3638
+ parts.push("computeInstanceSpec" + "=" + (0, util_1.inspect)(this.computeInstanceSpec));
3639
+ if (this.pricing !== undefined)
3640
+ parts.push("pricing" + "=" + (0, util_1.inspect)(this.pricing));
3641
+ return `${this.$type}(${parts.join(", ")})`;
3642
+ }
3643
+ function PricingPolicySpecCustomJson() {
3644
+ const obj = {
3645
+ type: this.$type,
3646
+ };
3647
+ if (this.computeInstanceSpec !== undefined)
3648
+ obj.computeInstanceSpec = (0, logging_js_1.inspectJson)(this.computeInstanceSpec);
3649
+ if (this.pricing !== undefined)
3650
+ obj.pricing = (0, logging_js_1.inspectJson)(this.pricing);
3651
+ return obj;
3652
+ }
3653
+ function applyPricingPolicySpecCustom(message) {
3654
+ message[logging_js_1.custom] = PricingPolicySpecCustomInspect;
3655
+ message[logging_js_1.customJson] = PricingPolicySpecCustomJson;
3656
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.PricingPolicySpec.$descriptor);
3657
+ }
3658
+ function createBasePricingPolicySpec() {
3659
+ const message = {
3660
+ $type: "nebius.billing.v1.PricingPolicySpec",
3661
+ computeInstanceSpec: undefined,
3662
+ pricing: undefined,
3663
+ };
3664
+ return applyPricingPolicySpecCustom(message);
3665
+ }
3666
+ const ComputeInstanceSpec_versions_ONEOF_DESCRIPTOR = {
3667
+ fields: {
3668
+ "v1": { pbName: "v1", message: () => exports.ComputeInstanceSpecV1.$descriptor },
3669
+ },
3670
+ };
3671
+ const ComputeInstanceSpec_MESSAGE_DESCRIPTOR = {
3672
+ fields: {
3673
+ "versions": { pbName: "versions", oneof: true, message: () => ComputeInstanceSpec_versions_ONEOF_DESCRIPTOR },
3674
+ },
3675
+ };
3676
+ /** Encodes, decodes, converts, and creates {@link ComputeInstanceSpec} messages. */
3677
+ exports.ComputeInstanceSpec = {
3678
+ $type: "nebius.billing.v1.ComputeInstanceSpec",
3679
+ $descriptor: ComputeInstanceSpec_MESSAGE_DESCRIPTOR,
3680
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3681
+ if (message.versions?.$case === undefined) { /* noop */ }
3682
+ else if (message.versions?.$case === "v1") {
3683
+ const w = writer.uint32(10).fork();
3684
+ exports.ComputeInstanceSpecV1.encode(message.versions.v1, w);
3685
+ w.join();
3686
+ }
3687
+ if (message[index_js_1.unknownFieldsSymbol]) {
3688
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3689
+ }
3690
+ return writer;
3691
+ },
3692
+ decode(input, length) {
3693
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3694
+ const end = length === undefined ? reader.len : reader.pos + length;
3695
+ const message = createBaseComputeInstanceSpec();
3696
+ let writer = undefined;
3697
+ while (reader.pos < end) {
3698
+ const tag = reader.uint32();
3699
+ switch (tag >>> 3) {
3700
+ case 1: {
3701
+ if (tag !== 10)
3702
+ break;
3703
+ message.versions = {
3704
+ $case: "v1",
3705
+ v1: exports.ComputeInstanceSpecV1.decode(reader, reader.uint32())
3706
+ };
3707
+ continue;
3708
+ }
3709
+ default:
3710
+ break;
3711
+ }
3712
+ if ((tag & 7) === 4 || tag === 0) {
3713
+ break;
3714
+ }
3715
+ {
3716
+ if (!writer)
3717
+ writer = new index_js_1.BinaryWriter();
3718
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3719
+ writer.uint32(tag).raw(skipped);
3720
+ }
3721
+ }
3722
+ if (writer) {
3723
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3724
+ }
3725
+ return message;
3726
+ },
3727
+ fromJSON(object) {
3728
+ return applyComputeInstanceSpecCustom({
3729
+ $type: "nebius.billing.v1.ComputeInstanceSpec",
3730
+ versions: (() => {
3731
+ if ((0, index_js_1.isSet)(object.v1) || (0, index_js_1.isSet)(object.v1)) {
3732
+ return {
3733
+ $case: "v1",
3734
+ v1: exports.ComputeInstanceSpecV1.fromJSON(object.v1 ?? object.v1)
3735
+ };
3736
+ }
3737
+ return undefined;
3738
+ })(),
3739
+ });
3740
+ },
3741
+ toJSON(message, use = "json") {
3742
+ const obj = {};
3743
+ const pick = (json, pb) => (use === "json" ? json : pb);
3744
+ switch (message.versions?.$case) {
3745
+ case "v1": {
3746
+ obj[pick("v1", "v1")] = exports.ComputeInstanceSpecV1.toJSON(message.versions.v1, use);
3747
+ break;
3748
+ }
3749
+ default: break;
3750
+ }
3751
+ return obj;
3752
+ },
3753
+ create(base) {
3754
+ return exports.ComputeInstanceSpec.fromPartial(base ?? {});
3755
+ },
3756
+ fromPartial(object) {
3757
+ const message = createBaseComputeInstanceSpec();
3758
+ switch (object.versions?.$case) {
3759
+ case "v1": {
3760
+ if (object.versions.v1 !== undefined && object.versions.v1 !== null) {
3761
+ message.versions = {
3762
+ $case: "v1",
3763
+ v1: exports.ComputeInstanceSpecV1.fromPartial(object.versions.v1),
3764
+ };
3765
+ }
3766
+ break;
3767
+ }
3768
+ default: break;
3769
+ }
3770
+ return message;
3771
+ },
3772
+ };
3773
+ protobuf_js_1.protoRegistry.registerMessage(exports.ComputeInstanceSpec);
3774
+ function ComputeInstanceSpecCustomInspect() {
3775
+ const parts = [];
3776
+ return `${this.$type}(${parts.join(", ")})`;
3777
+ }
3778
+ function ComputeInstanceSpecCustomJson() {
3779
+ const obj = {
3780
+ type: this.$type,
3781
+ };
3782
+ return obj;
3783
+ }
3784
+ function applyComputeInstanceSpecCustom(message) {
3785
+ message[logging_js_1.custom] = ComputeInstanceSpecCustomInspect;
3786
+ message[logging_js_1.customJson] = ComputeInstanceSpecCustomJson;
3787
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.ComputeInstanceSpec.$descriptor);
3788
+ }
3789
+ function createBaseComputeInstanceSpec() {
3790
+ const message = {
3791
+ $type: "nebius.billing.v1.ComputeInstanceSpec",
3792
+ versions: undefined,
3793
+ };
3794
+ return applyComputeInstanceSpecCustom(message);
3795
+ }
3796
+ const ComputeInstanceSpecV1_MESSAGE_DESCRIPTOR = {
3797
+ fields: {
3798
+ "platform": { pbName: "platform", scalarType: 9 },
3799
+ },
3800
+ };
3801
+ /** Encodes, decodes, converts, and creates {@link ComputeInstanceSpecV1} messages. */
3802
+ exports.ComputeInstanceSpecV1 = {
3803
+ $type: "nebius.billing.v1.ComputeInstanceSpecV1",
3804
+ $descriptor: ComputeInstanceSpecV1_MESSAGE_DESCRIPTOR,
3805
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3806
+ if (message.platform !== "") {
3807
+ writer.uint32(10).string(message.platform);
3808
+ }
3809
+ if (message[index_js_1.unknownFieldsSymbol]) {
3810
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3811
+ }
3812
+ return writer;
3813
+ },
3814
+ decode(input, length) {
3815
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3816
+ const end = length === undefined ? reader.len : reader.pos + length;
3817
+ const message = createBaseComputeInstanceSpecV1();
3818
+ let writer = undefined;
3819
+ while (reader.pos < end) {
3820
+ const tag = reader.uint32();
3821
+ switch (tag >>> 3) {
3822
+ case 1: {
3823
+ if (tag !== 10)
3824
+ break;
3825
+ message.platform = reader.string();
3826
+ continue;
3827
+ }
3828
+ default:
3829
+ break;
3830
+ }
3831
+ if ((tag & 7) === 4 || tag === 0) {
3832
+ break;
3833
+ }
3834
+ {
3835
+ if (!writer)
3836
+ writer = new index_js_1.BinaryWriter();
3837
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3838
+ writer.uint32(tag).raw(skipped);
3839
+ }
3840
+ }
3841
+ if (writer) {
3842
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3843
+ }
3844
+ return message;
3845
+ },
3846
+ fromJSON(object) {
3847
+ return applyComputeInstanceSpecV1Custom({
3848
+ $type: "nebius.billing.v1.ComputeInstanceSpecV1",
3849
+ platform: (0, index_js_1.isSet)(object.platform ?? object.platform)
3850
+ ? String(object.platform ?? object.platform)
3851
+ : "",
3852
+ });
3853
+ },
3854
+ toJSON(message, use = "json") {
3855
+ const obj = {};
3856
+ const pick = (json, pb) => (use === "json" ? json : pb);
3857
+ if (message.platform !== "") {
3858
+ obj[pick("platform", "platform")] = message.platform;
3859
+ }
3860
+ return obj;
3861
+ },
3862
+ create(base) {
3863
+ return exports.ComputeInstanceSpecV1.fromPartial(base ?? {});
3864
+ },
3865
+ fromPartial(object) {
3866
+ const message = createBaseComputeInstanceSpecV1();
3867
+ message.platform = (object.platform !== undefined && object.platform !== null)
3868
+ ? object.platform
3869
+ : "";
3870
+ return message;
3871
+ },
3872
+ };
3873
+ protobuf_js_1.protoRegistry.registerMessage(exports.ComputeInstanceSpecV1);
3874
+ function ComputeInstanceSpecV1CustomInspect() {
3875
+ const parts = [];
3876
+ if (this.platform !== "")
3877
+ parts.push("platform" + "=" + (0, util_1.inspect)(this.platform));
3878
+ return `${this.$type}(${parts.join(", ")})`;
3879
+ }
3880
+ function ComputeInstanceSpecV1CustomJson() {
3881
+ const obj = {
3882
+ type: this.$type,
3883
+ };
3884
+ if (this.platform !== "")
3885
+ obj.platform = (0, logging_js_1.inspectJson)(this.platform);
3886
+ return obj;
3887
+ }
3888
+ function applyComputeInstanceSpecV1Custom(message) {
3889
+ message[logging_js_1.custom] = ComputeInstanceSpecV1CustomInspect;
3890
+ message[logging_js_1.customJson] = ComputeInstanceSpecV1CustomJson;
3891
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.ComputeInstanceSpecV1.$descriptor);
3892
+ }
3893
+ function createBaseComputeInstanceSpecV1() {
3894
+ const message = {
3895
+ $type: "nebius.billing.v1.ComputeInstanceSpecV1",
3896
+ platform: "",
3897
+ };
3898
+ return applyComputeInstanceSpecV1Custom(message);
3899
+ }
3900
+ const PricingMethod_versions_ONEOF_DESCRIPTOR = {
3901
+ fields: {
3902
+ "maxPriceV1": { pbName: "max_price_v1", message: () => exports.MaxPriceV1.$descriptor },
3903
+ },
3904
+ };
3905
+ const PricingMethod_MESSAGE_DESCRIPTOR = {
3906
+ fields: {
3907
+ "versions": { pbName: "versions", oneof: true, message: () => PricingMethod_versions_ONEOF_DESCRIPTOR },
3908
+ },
3909
+ };
3910
+ /** Encodes, decodes, converts, and creates {@link PricingMethod} messages. */
3911
+ exports.PricingMethod = {
3912
+ $type: "nebius.billing.v1.PricingMethod",
3913
+ $descriptor: PricingMethod_MESSAGE_DESCRIPTOR,
3914
+ encode(message, writer = new index_js_1.BinaryWriter()) {
3915
+ if (message.versions?.$case === undefined) { /* noop */ }
3916
+ else if (message.versions?.$case === "maxPriceV1") {
3917
+ const w = writer.uint32(10).fork();
3918
+ exports.MaxPriceV1.encode(message.versions.maxPriceV1, w);
3919
+ w.join();
3920
+ }
3921
+ if (message[index_js_1.unknownFieldsSymbol]) {
3922
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
3923
+ }
3924
+ return writer;
3925
+ },
3926
+ decode(input, length) {
3927
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
3928
+ const end = length === undefined ? reader.len : reader.pos + length;
3929
+ const message = createBasePricingMethod();
3930
+ let writer = undefined;
3931
+ while (reader.pos < end) {
3932
+ const tag = reader.uint32();
3933
+ switch (tag >>> 3) {
3934
+ case 1: {
3935
+ if (tag !== 10)
3936
+ break;
3937
+ message.versions = {
3938
+ $case: "maxPriceV1",
3939
+ maxPriceV1: exports.MaxPriceV1.decode(reader, reader.uint32())
3940
+ };
3941
+ continue;
3942
+ }
3943
+ default:
3944
+ break;
3945
+ }
3946
+ if ((tag & 7) === 4 || tag === 0) {
3947
+ break;
3948
+ }
3949
+ {
3950
+ if (!writer)
3951
+ writer = new index_js_1.BinaryWriter();
3952
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3953
+ writer.uint32(tag).raw(skipped);
3954
+ }
3955
+ }
3956
+ if (writer) {
3957
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
3958
+ }
3959
+ return message;
3960
+ },
3961
+ fromJSON(object) {
3962
+ return applyPricingMethodCustom({
3963
+ $type: "nebius.billing.v1.PricingMethod",
3964
+ versions: (() => {
3965
+ if ((0, index_js_1.isSet)(object.maxPriceV1) || (0, index_js_1.isSet)(object.max_price_v1)) {
3966
+ return {
3967
+ $case: "maxPriceV1",
3968
+ maxPriceV1: exports.MaxPriceV1.fromJSON(object.maxPriceV1 ?? object.max_price_v1)
3969
+ };
3970
+ }
3971
+ return undefined;
3972
+ })(),
3973
+ });
3974
+ },
3975
+ toJSON(message, use = "json") {
3976
+ const obj = {};
3977
+ const pick = (json, pb) => (use === "json" ? json : pb);
3978
+ switch (message.versions?.$case) {
3979
+ case "maxPriceV1": {
3980
+ obj[pick("maxPriceV1", "max_price_v1")] = exports.MaxPriceV1.toJSON(message.versions.maxPriceV1, use);
3981
+ break;
3982
+ }
3983
+ default: break;
3984
+ }
3985
+ return obj;
3986
+ },
3987
+ create(base) {
3988
+ return exports.PricingMethod.fromPartial(base ?? {});
3989
+ },
3990
+ fromPartial(object) {
3991
+ const message = createBasePricingMethod();
3992
+ switch (object.versions?.$case) {
3993
+ case "maxPriceV1": {
3994
+ if (object.versions.maxPriceV1 !== undefined && object.versions.maxPriceV1 !== null) {
3995
+ message.versions = {
3996
+ $case: "maxPriceV1",
3997
+ maxPriceV1: exports.MaxPriceV1.fromPartial(object.versions.maxPriceV1),
3998
+ };
3999
+ }
4000
+ break;
4001
+ }
4002
+ default: break;
4003
+ }
4004
+ return message;
4005
+ },
4006
+ };
4007
+ protobuf_js_1.protoRegistry.registerMessage(exports.PricingMethod);
4008
+ function PricingMethodCustomInspect() {
4009
+ const parts = [];
4010
+ return `${this.$type}(${parts.join(", ")})`;
4011
+ }
4012
+ function PricingMethodCustomJson() {
4013
+ const obj = {
4014
+ type: this.$type,
4015
+ };
4016
+ return obj;
4017
+ }
4018
+ function applyPricingMethodCustom(message) {
4019
+ message[logging_js_1.custom] = PricingMethodCustomInspect;
4020
+ message[logging_js_1.customJson] = PricingMethodCustomJson;
4021
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.PricingMethod.$descriptor);
4022
+ }
4023
+ function createBasePricingMethod() {
4024
+ const message = {
4025
+ $type: "nebius.billing.v1.PricingMethod",
4026
+ versions: undefined,
4027
+ };
4028
+ return applyPricingMethodCustom(message);
4029
+ }
4030
+ const MaxPriceV1_MESSAGE_DESCRIPTOR = {
4031
+ fields: {
4032
+ "maxPrice": { pbName: "max_price", scalarType: 9 },
4033
+ },
4034
+ };
4035
+ /** Encodes, decodes, converts, and creates {@link MaxPriceV1} messages. */
4036
+ exports.MaxPriceV1 = {
4037
+ $type: "nebius.billing.v1.MaxPriceV1",
4038
+ $descriptor: MaxPriceV1_MESSAGE_DESCRIPTOR,
4039
+ encode(message, writer = new index_js_1.BinaryWriter()) {
4040
+ if (message.maxPrice !== "") {
4041
+ writer.uint32(10).string(message.maxPrice);
4042
+ }
4043
+ if (message[index_js_1.unknownFieldsSymbol]) {
4044
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
4045
+ }
4046
+ return writer;
4047
+ },
4048
+ decode(input, length) {
4049
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
4050
+ const end = length === undefined ? reader.len : reader.pos + length;
4051
+ const message = createBaseMaxPriceV1();
4052
+ let writer = undefined;
4053
+ while (reader.pos < end) {
4054
+ const tag = reader.uint32();
4055
+ switch (tag >>> 3) {
4056
+ case 1: {
4057
+ if (tag !== 10)
4058
+ break;
4059
+ message.maxPrice = reader.string();
4060
+ continue;
4061
+ }
4062
+ default:
4063
+ break;
4064
+ }
4065
+ if ((tag & 7) === 4 || tag === 0) {
4066
+ break;
4067
+ }
4068
+ {
4069
+ if (!writer)
4070
+ writer = new index_js_1.BinaryWriter();
4071
+ const skipped = reader.skip(tag & 7, tag >>> 3);
4072
+ writer.uint32(tag).raw(skipped);
4073
+ }
4074
+ }
4075
+ if (writer) {
4076
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
4077
+ }
4078
+ return message;
4079
+ },
4080
+ fromJSON(object) {
4081
+ return applyMaxPriceV1Custom({
4082
+ $type: "nebius.billing.v1.MaxPriceV1",
4083
+ maxPrice: (0, index_js_1.isSet)(object.maxPrice ?? object.max_price)
4084
+ ? String(object.maxPrice ?? object.max_price)
4085
+ : "",
4086
+ });
4087
+ },
4088
+ toJSON(message, use = "json") {
4089
+ const obj = {};
4090
+ const pick = (json, pb) => (use === "json" ? json : pb);
4091
+ if (message.maxPrice !== "") {
4092
+ obj[pick("maxPrice", "max_price")] = message.maxPrice;
4093
+ }
4094
+ return obj;
4095
+ },
4096
+ create(base) {
4097
+ return exports.MaxPriceV1.fromPartial(base ?? {});
4098
+ },
4099
+ fromPartial(object) {
4100
+ const message = createBaseMaxPriceV1();
4101
+ message.maxPrice = (object.maxPrice !== undefined && object.maxPrice !== null)
4102
+ ? object.maxPrice
4103
+ : "";
4104
+ return message;
4105
+ },
4106
+ };
4107
+ protobuf_js_1.protoRegistry.registerMessage(exports.MaxPriceV1);
4108
+ function MaxPriceV1CustomInspect() {
4109
+ const parts = [];
4110
+ if (this.maxPrice !== "")
4111
+ parts.push("maxPrice" + "=" + (0, util_1.inspect)(this.maxPrice));
4112
+ return `${this.$type}(${parts.join(", ")})`;
4113
+ }
4114
+ function MaxPriceV1CustomJson() {
4115
+ const obj = {
4116
+ type: this.$type,
4117
+ };
4118
+ if (this.maxPrice !== "")
4119
+ obj.maxPrice = (0, logging_js_1.inspectJson)(this.maxPrice);
4120
+ return obj;
4121
+ }
4122
+ function applyMaxPriceV1Custom(message) {
4123
+ message[logging_js_1.custom] = MaxPriceV1CustomInspect;
4124
+ message[logging_js_1.customJson] = MaxPriceV1CustomJson;
4125
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.MaxPriceV1.$descriptor);
4126
+ }
4127
+ function createBaseMaxPriceV1() {
4128
+ const message = {
4129
+ $type: "nebius.billing.v1.MaxPriceV1",
4130
+ maxPrice: "",
4131
+ };
4132
+ return applyMaxPriceV1Custom(message);
4133
+ }
4134
+ const PricingPolicyStatus_MESSAGE_DESCRIPTOR = {
4135
+ fields: {
4136
+ "state": { pbName: "state", scalarType: 14 },
4137
+ "skuId": { pbName: "sku_id", scalarType: 9 },
4138
+ "schedulingState": { pbName: "scheduling_state", scalarType: 14 },
4139
+ "runningVmCount": { pbName: "running_vm_count", scalarType: 3 },
4140
+ "currency": { pbName: "currency", scalarType: 9 },
4141
+ },
4142
+ };
4143
+ /** Encodes, decodes, converts, and creates {@link PricingPolicyStatus} messages. */
4144
+ exports.PricingPolicyStatus = {
4145
+ $type: "nebius.billing.v1.PricingPolicyStatus",
4146
+ $descriptor: PricingPolicyStatus_MESSAGE_DESCRIPTOR,
4147
+ encode(message, writer = new index_js_1.BinaryWriter()) {
4148
+ if ((message.state ?? exports.PricingPolicyStatus_State.STATE_UNSPECIFIED) !== exports.PricingPolicyStatus_State.STATE_UNSPECIFIED) {
4149
+ exports.PricingPolicyStatus_State.encodeField(writer, 1, message.state);
4150
+ }
4151
+ if (message.skuId !== "") {
4152
+ writer.uint32(18).string(message.skuId);
4153
+ }
4154
+ if ((message.schedulingState ?? exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED) !== exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED) {
4155
+ exports.PricingPolicyStatus_SchedulingState.encodeField(writer, 3, message.schedulingState);
4156
+ }
4157
+ if (message.runningVmCount !== undefined && !message.runningVmCount.isZero?.()) {
4158
+ writer.uint32(32).int64(message.runningVmCount.toString());
4159
+ }
4160
+ if (message.currency !== "") {
4161
+ writer.uint32(42).string(message.currency);
4162
+ }
4163
+ if (message[index_js_1.unknownFieldsSymbol]) {
4164
+ writer.raw(message[index_js_1.unknownFieldsSymbol]);
4165
+ }
4166
+ return writer;
4167
+ },
4168
+ decode(input, length) {
4169
+ const reader = input instanceof index_js_1.BinaryReader ? input : new index_js_1.BinaryReader(input);
4170
+ const end = length === undefined ? reader.len : reader.pos + length;
4171
+ const message = createBasePricingPolicyStatus();
4172
+ let writer = undefined;
4173
+ while (reader.pos < end) {
4174
+ const tag = reader.uint32();
4175
+ switch (tag >>> 3) {
4176
+ case 1: {
4177
+ if (tag !== 8)
4178
+ break;
4179
+ message.state = exports.PricingPolicyStatus_State.fromNumber(reader.int32());
4180
+ continue;
4181
+ }
4182
+ case 2: {
4183
+ if (tag !== 18)
4184
+ break;
4185
+ message.skuId = reader.string();
4186
+ continue;
4187
+ }
4188
+ case 3: {
4189
+ if (tag !== 24)
4190
+ break;
4191
+ message.schedulingState = exports.PricingPolicyStatus_SchedulingState.fromNumber(reader.int32());
4192
+ continue;
4193
+ }
4194
+ case 4: {
4195
+ if (tag !== 32)
4196
+ break;
4197
+ message.runningVmCount = index_js_1.Long.fromValue(reader.int64());
4198
+ continue;
4199
+ }
4200
+ case 5: {
4201
+ if (tag !== 42)
4202
+ break;
4203
+ message.currency = reader.string();
4204
+ continue;
4205
+ }
4206
+ default:
4207
+ break;
4208
+ }
4209
+ if ((tag & 7) === 4 || tag === 0) {
4210
+ break;
4211
+ }
4212
+ {
4213
+ if (!writer)
4214
+ writer = new index_js_1.BinaryWriter();
4215
+ const skipped = reader.skip(tag & 7, tag >>> 3);
4216
+ writer.uint32(tag).raw(skipped);
4217
+ }
4218
+ }
4219
+ if (writer) {
4220
+ message[index_js_1.unknownFieldsSymbol] = writer.finish();
4221
+ }
4222
+ return message;
4223
+ },
4224
+ fromJSON(object) {
4225
+ return applyPricingPolicyStatusCustom({
4226
+ $type: "nebius.billing.v1.PricingPolicyStatus",
4227
+ state: (0, index_js_1.isSet)(object.state ?? object.state)
4228
+ ? exports.PricingPolicyStatus_State.fromJSON(object.state ?? object.state)
4229
+ : exports.PricingPolicyStatus_State.STATE_UNSPECIFIED,
4230
+ skuId: (0, index_js_1.isSet)(object.skuId ?? object.sku_id)
4231
+ ? String(object.skuId ?? object.sku_id)
4232
+ : "",
4233
+ schedulingState: (0, index_js_1.isSet)(object.schedulingState ?? object.scheduling_state)
4234
+ ? exports.PricingPolicyStatus_SchedulingState.fromJSON(object.schedulingState ?? object.scheduling_state)
4235
+ : exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED,
4236
+ runningVmCount: (0, index_js_1.isSet)(object.runningVmCount ?? object.running_vm_count)
4237
+ ? index_js_1.Long.fromValue(object.runningVmCount ?? object.running_vm_count)
4238
+ : index_js_1.Long.ZERO,
4239
+ currency: (0, index_js_1.isSet)(object.currency ?? object.currency)
4240
+ ? String(object.currency ?? object.currency)
4241
+ : "",
4242
+ });
4243
+ },
4244
+ toJSON(message, use = "json") {
4245
+ const obj = {};
4246
+ const pick = (json, pb) => (use === "json" ? json : pb);
4247
+ if ((message.state ?? exports.PricingPolicyStatus_State.STATE_UNSPECIFIED) !== exports.PricingPolicyStatus_State.STATE_UNSPECIFIED) {
4248
+ obj[pick("state", "state")] = exports.PricingPolicyStatus_State.toJSON(message.state);
4249
+ }
4250
+ if (message.skuId !== "") {
4251
+ obj[pick("skuId", "sku_id")] = message.skuId;
4252
+ }
4253
+ if ((message.schedulingState ?? exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED) !== exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED) {
4254
+ obj[pick("schedulingState", "scheduling_state")] = exports.PricingPolicyStatus_SchedulingState.toJSON(message.schedulingState);
4255
+ }
4256
+ if (!message.runningVmCount?.isZero?.()) {
4257
+ obj[pick("runningVmCount", "running_vm_count")] = (message.runningVmCount || index_js_1.Long.ZERO).toString();
4258
+ }
4259
+ if (message.currency !== "") {
4260
+ obj[pick("currency", "currency")] = message.currency;
4261
+ }
4262
+ return obj;
4263
+ },
4264
+ create(base) {
4265
+ return exports.PricingPolicyStatus.fromPartial(base ?? {});
4266
+ },
4267
+ fromPartial(object) {
4268
+ const message = createBasePricingPolicyStatus();
4269
+ message.state = (object.state !== undefined && object.state !== null)
4270
+ ? exports.PricingPolicyStatus_State.fromJSON(object.state.name)
4271
+ : exports.PricingPolicyStatus_State.STATE_UNSPECIFIED;
4272
+ message.skuId = (object.skuId !== undefined && object.skuId !== null)
4273
+ ? object.skuId
4274
+ : "";
4275
+ message.schedulingState = (object.schedulingState !== undefined && object.schedulingState !== null)
4276
+ ? exports.PricingPolicyStatus_SchedulingState.fromJSON(object.schedulingState.name)
4277
+ : exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED;
4278
+ message.runningVmCount = (object.runningVmCount !== undefined && object.runningVmCount !== null)
4279
+ ? index_js_1.Long.fromValue(object.runningVmCount)
4280
+ : index_js_1.Long.ZERO;
4281
+ message.currency = (object.currency !== undefined && object.currency !== null)
4282
+ ? object.currency
4283
+ : "";
4284
+ return message;
4285
+ },
4286
+ };
4287
+ protobuf_js_1.protoRegistry.registerMessage(exports.PricingPolicyStatus);
4288
+ function PricingPolicyStatusCustomInspect() {
4289
+ const parts = [];
4290
+ if (this.state !== undefined)
4291
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
4292
+ if (this.skuId !== "")
4293
+ parts.push("skuId" + "=" + (0, util_1.inspect)(this.skuId));
4294
+ if (this.schedulingState !== undefined)
4295
+ parts.push("schedulingState" + "=" + (0, util_1.inspect)(this.schedulingState));
4296
+ if (!this.runningVmCount?.isZero?.())
4297
+ parts.push("runningVmCount" + "=" + (0, util_1.inspect)(this.runningVmCount));
4298
+ if (this.currency !== "")
4299
+ parts.push("currency" + "=" + (0, util_1.inspect)(this.currency));
4300
+ return `${this.$type}(${parts.join(", ")})`;
4301
+ }
4302
+ function PricingPolicyStatusCustomJson() {
4303
+ const obj = {
4304
+ type: this.$type,
4305
+ };
4306
+ if (this.state !== undefined)
4307
+ obj.state = (0, logging_js_1.inspectJson)(this.state);
4308
+ if (this.skuId !== "")
4309
+ obj.skuId = (0, logging_js_1.inspectJson)(this.skuId);
4310
+ if (this.schedulingState !== undefined)
4311
+ obj.schedulingState = (0, logging_js_1.inspectJson)(this.schedulingState);
4312
+ if (!this.runningVmCount?.isZero?.())
4313
+ obj.runningVmCount = (0, logging_js_1.inspectJson)(this.runningVmCount);
4314
+ if (this.currency !== "")
4315
+ obj.currency = (0, logging_js_1.inspectJson)(this.currency);
4316
+ return obj;
4317
+ }
4318
+ function applyPricingPolicyStatusCustom(message) {
4319
+ message[logging_js_1.custom] = PricingPolicyStatusCustomInspect;
4320
+ message[logging_js_1.customJson] = PricingPolicyStatusCustomJson;
4321
+ return (0, index_js_1.attachMessageDescriptor)(message, exports.PricingPolicyStatus.$descriptor);
4322
+ }
4323
+ function createBasePricingPolicyStatus() {
4324
+ const message = {
4325
+ $type: "nebius.billing.v1.PricingPolicyStatus",
4326
+ state: exports.PricingPolicyStatus_State.STATE_UNSPECIFIED,
4327
+ skuId: "",
4328
+ schedulingState: exports.PricingPolicyStatus_SchedulingState.SCHEDULING_STATE_UNSPECIFIED,
4329
+ runningVmCount: index_js_1.Long.ZERO,
4330
+ currency: "",
4331
+ };
4332
+ return applyPricingPolicyStatusCustom(message);
4333
+ }
2365
4334
  //# sourceMappingURL=index.js.map