@nebius/js-sdk 0.1.39 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /* Generated by Nebius TS generator. DO NOT EDIT! */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ResourceAffinity = exports.ResourceAffinityComputeV1 = exports.CapacityInterval = exports.CapacityIntervalStatus = exports.CapacityIntervalSpec = exports.CapacityIntervalStatus_State = exports.CapacityIntervalService = exports.CapacityIntervalServiceBaseClient = exports.CapacityIntervalServiceServiceDescription = exports.ListCapacityIntervalsResponse = exports.ListCapacityIntervalsRequest = exports.GetCapacityIntervalRequest = exports.CapacityBlockGroup = exports.CapacityBlockGroupStatus = exports.CurrentContinuousInterval = exports.CapacityBlockGroupSpec = exports.CapacityBlockGroupStatus_UsageState = exports.CapacityBlockGroupStatus_State = exports.CurrentContinuousInterval_State = exports.CapacityBlockGroupService = exports.CapacityBlockGroupServiceBaseClient = exports.CapacityBlockGroupServiceServiceDescription = exports.ListCapacityBlockGroupResourcesResponse = exports.ListCapacityBlockGroupResourcesRequest = exports.ListCapacityBlockGroupsResponse = exports.ListCapacityBlockGroupsRequest = exports.GetCapacityBlockGroupByResourceAffinityRequest = exports.GetCapacityBlockGroupRequest = void 0;
4
+ exports.ResourceAffinity = exports.ResourceAffinityComputeV1 = exports.ResourceAdviceStatus_Availability = exports.ResourceAdviceStatus = exports.ComputeInstanceDetails_Preset_Resources = exports.ComputeInstanceDetails_Preset = exports.ComputeInstanceDetails = exports.ResourceAdviceSpec = exports.ResourceAdvice = exports.ResourceAdviceStatus_Availability_DataState = exports.ResourceAdviceService = exports.ResourceAdviceServiceBaseClient = exports.ResourceAdviceServiceServiceDescription = exports.ListResourceAdviceResponse = exports.ListResourceAdviceRequest = exports.CapacityInterval = exports.CapacityIntervalStatus = exports.CapacityIntervalSpec = exports.CapacityIntervalStatus_State = exports.CapacityIntervalService = exports.CapacityIntervalServiceBaseClient = exports.CapacityIntervalServiceServiceDescription = exports.ListCapacityIntervalsResponse = exports.ListCapacityIntervalsRequest = exports.GetCapacityIntervalRequest = exports.CapacityBlockGroup = exports.CapacityBlockGroupStatus = exports.CurrentContinuousInterval = exports.CapacityBlockGroupSpec = exports.CapacityBlockGroupStatus_UsageState = exports.CapacityBlockGroupStatus_State = exports.CurrentContinuousInterval_State = exports.CapacityBlockGroupService = exports.CapacityBlockGroupServiceBaseClient = exports.CapacityBlockGroupServiceServiceDescription = exports.ListCapacityBlockGroupResourcesResponse = exports.ListCapacityBlockGroupResourcesRequest = exports.ListCapacityBlockGroupsResponse = exports.ListCapacityBlockGroupsRequest = exports.GetCapacityBlockGroupByResourceAffinityRequest = exports.GetCapacityBlockGroupRequest = void 0;
5
5
  const index_1 = require("../../../../runtime/protos/index");
6
6
  const util_1 = require("util");
7
7
  const protobuf_1 = require("../../../protobuf");
@@ -2616,6 +2616,1390 @@ function createBaseCapacityInterval() {
2616
2616
  };
2617
2617
  return applyCapacityIntervalCustom(message);
2618
2618
  }
2619
+ exports.ListResourceAdviceRequest = {
2620
+ $type: "nebius.capacity.v1.ListResourceAdviceRequest",
2621
+ encode(message, writer = new index_1.BinaryWriter()) {
2622
+ if (message.parentId !== "") {
2623
+ writer.uint32(10).string(message.parentId);
2624
+ }
2625
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
2626
+ writer.uint32(16).int64(message.pageSize.toString());
2627
+ }
2628
+ if (message.pageToken !== "") {
2629
+ writer.uint32(26).string(message.pageToken);
2630
+ }
2631
+ if (message[index_1.unknownFieldsSymbol]) {
2632
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2633
+ }
2634
+ return writer;
2635
+ },
2636
+ decode(input, length) {
2637
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2638
+ const end = length === undefined ? reader.len : reader.pos + length;
2639
+ const message = createBaseListResourceAdviceRequest();
2640
+ let writer = undefined;
2641
+ while (reader.pos < end) {
2642
+ const tag = reader.uint32();
2643
+ switch (tag >>> 3) {
2644
+ case 1: {
2645
+ if (tag !== 10)
2646
+ break;
2647
+ message.parentId = reader.string();
2648
+ continue;
2649
+ }
2650
+ case 2: {
2651
+ if (tag !== 16)
2652
+ break;
2653
+ message.pageSize = index_1.Long.fromValue(reader.int64());
2654
+ continue;
2655
+ }
2656
+ case 3: {
2657
+ if (tag !== 26)
2658
+ break;
2659
+ message.pageToken = reader.string();
2660
+ continue;
2661
+ }
2662
+ default:
2663
+ break;
2664
+ }
2665
+ if ((tag & 7) === 4 || tag === 0) {
2666
+ break;
2667
+ }
2668
+ {
2669
+ if (!writer)
2670
+ writer = new index_1.BinaryWriter();
2671
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2672
+ writer.uint32(tag).raw(skipped);
2673
+ }
2674
+ }
2675
+ if (writer) {
2676
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2677
+ }
2678
+ return message;
2679
+ },
2680
+ fromJSON(object) {
2681
+ return applyListResourceAdviceRequestCustom({
2682
+ $type: "nebius.capacity.v1.ListResourceAdviceRequest",
2683
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
2684
+ ? String(object.parentId ?? object.parent_id)
2685
+ : "",
2686
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
2687
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
2688
+ : index_1.Long.ZERO,
2689
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
2690
+ ? String(object.pageToken ?? object.page_token)
2691
+ : "",
2692
+ });
2693
+ },
2694
+ toJSON(message, use = "json") {
2695
+ const obj = {};
2696
+ const pick = (json, pb) => (use === "json" ? json : pb);
2697
+ if (message.parentId !== "") {
2698
+ obj[pick("parentId", "parent_id")] = message.parentId;
2699
+ }
2700
+ if (!message.pageSize?.isZero?.()) {
2701
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
2702
+ }
2703
+ if (message.pageToken !== "") {
2704
+ obj[pick("pageToken", "page_token")] = message.pageToken;
2705
+ }
2706
+ return obj;
2707
+ },
2708
+ create(base) {
2709
+ return exports.ListResourceAdviceRequest.fromPartial(base ?? {});
2710
+ },
2711
+ fromPartial(object) {
2712
+ const message = createBaseListResourceAdviceRequest();
2713
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
2714
+ ? object.parentId
2715
+ : "";
2716
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
2717
+ ? index_1.Long.fromValue(object.pageSize)
2718
+ : index_1.Long.ZERO;
2719
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
2720
+ ? object.pageToken
2721
+ : "";
2722
+ return message;
2723
+ },
2724
+ };
2725
+ protobuf_1.protoRegistry.registerMessage(exports.ListResourceAdviceRequest);
2726
+ function ListResourceAdviceRequestCustomInspect() {
2727
+ const parts = [];
2728
+ if (this.parentId !== "")
2729
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
2730
+ if (!this.pageSize?.isZero?.())
2731
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
2732
+ if (this.pageToken !== "")
2733
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
2734
+ return `${this.$type}(${parts.join(", ")})`;
2735
+ }
2736
+ function ListResourceAdviceRequestCustomJson() {
2737
+ const obj = {
2738
+ type: this.$type,
2739
+ };
2740
+ if (this.parentId !== "")
2741
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
2742
+ if (!this.pageSize?.isZero?.())
2743
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
2744
+ if (this.pageToken !== "")
2745
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
2746
+ return obj;
2747
+ }
2748
+ function applyListResourceAdviceRequestCustom(message) {
2749
+ message[logging_1.custom] = ListResourceAdviceRequestCustomInspect;
2750
+ message[logging_1.customJson] = ListResourceAdviceRequestCustomJson;
2751
+ return message;
2752
+ }
2753
+ function createBaseListResourceAdviceRequest() {
2754
+ const message = {
2755
+ $type: "nebius.capacity.v1.ListResourceAdviceRequest",
2756
+ parentId: "",
2757
+ pageSize: index_1.Long.ZERO,
2758
+ pageToken: "",
2759
+ };
2760
+ return applyListResourceAdviceRequestCustom(message);
2761
+ }
2762
+ exports.ListResourceAdviceResponse = {
2763
+ $type: "nebius.capacity.v1.ListResourceAdviceResponse",
2764
+ encode(message, writer = new index_1.BinaryWriter()) {
2765
+ for (const v of (message.items ?? [])) {
2766
+ const w = writer.uint32(10).fork();
2767
+ exports.ResourceAdvice.encode(v, w);
2768
+ w.join();
2769
+ }
2770
+ if (message.nextPageToken !== "") {
2771
+ writer.uint32(18).string(message.nextPageToken);
2772
+ }
2773
+ if (message[index_1.unknownFieldsSymbol]) {
2774
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2775
+ }
2776
+ return writer;
2777
+ },
2778
+ decode(input, length) {
2779
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2780
+ const end = length === undefined ? reader.len : reader.pos + length;
2781
+ const message = createBaseListResourceAdviceResponse();
2782
+ let writer = undefined;
2783
+ while (reader.pos < end) {
2784
+ const tag = reader.uint32();
2785
+ switch (tag >>> 3) {
2786
+ case 1: {
2787
+ if (tag !== 10)
2788
+ break;
2789
+ message.items.push(exports.ResourceAdvice.decode(reader, reader.uint32()));
2790
+ continue;
2791
+ }
2792
+ case 2: {
2793
+ if (tag !== 18)
2794
+ break;
2795
+ message.nextPageToken = reader.string();
2796
+ continue;
2797
+ }
2798
+ default:
2799
+ break;
2800
+ }
2801
+ if ((tag & 7) === 4 || tag === 0) {
2802
+ break;
2803
+ }
2804
+ {
2805
+ if (!writer)
2806
+ writer = new index_1.BinaryWriter();
2807
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2808
+ writer.uint32(tag).raw(skipped);
2809
+ }
2810
+ }
2811
+ if (writer) {
2812
+ message[index_1.unknownFieldsSymbol] = writer.finish();
2813
+ }
2814
+ return message;
2815
+ },
2816
+ fromJSON(object) {
2817
+ return applyListResourceAdviceResponseCustom({
2818
+ $type: "nebius.capacity.v1.ListResourceAdviceResponse",
2819
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
2820
+ ? (object.items ?? object.items).map((e) => exports.ResourceAdvice.fromJSON(e))
2821
+ : [],
2822
+ nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
2823
+ ? String(object.nextPageToken ?? object.next_page_token)
2824
+ : "",
2825
+ });
2826
+ },
2827
+ toJSON(message, use = "json") {
2828
+ const obj = {};
2829
+ const pick = (json, pb) => (use === "json" ? json : pb);
2830
+ if (message.items?.length) {
2831
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.ResourceAdvice.toJSON(e, use) : undefined);
2832
+ }
2833
+ if (message.nextPageToken !== "") {
2834
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
2835
+ }
2836
+ return obj;
2837
+ },
2838
+ create(base) {
2839
+ return exports.ListResourceAdviceResponse.fromPartial(base ?? {});
2840
+ },
2841
+ fromPartial(object) {
2842
+ const message = createBaseListResourceAdviceResponse();
2843
+ message.items = object.items?.map((e) => exports.ResourceAdvice.fromPartial(e)) || [];
2844
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
2845
+ ? object.nextPageToken
2846
+ : "";
2847
+ return message;
2848
+ },
2849
+ };
2850
+ protobuf_1.protoRegistry.registerMessage(exports.ListResourceAdviceResponse);
2851
+ function ListResourceAdviceResponseCustomInspect() {
2852
+ const parts = [];
2853
+ if ((this.items?.length ?? 0) !== 0)
2854
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
2855
+ if (this.nextPageToken !== "")
2856
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
2857
+ return `${this.$type}(${parts.join(", ")})`;
2858
+ }
2859
+ function ListResourceAdviceResponseCustomJson() {
2860
+ const obj = {
2861
+ type: this.$type,
2862
+ };
2863
+ if ((this.items?.length ?? 0) !== 0)
2864
+ obj.items = (0, logging_1.inspectJson)(this.items);
2865
+ if (this.nextPageToken !== "")
2866
+ obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
2867
+ return obj;
2868
+ }
2869
+ function applyListResourceAdviceResponseCustom(message) {
2870
+ message[logging_1.custom] = ListResourceAdviceResponseCustomInspect;
2871
+ message[logging_1.customJson] = ListResourceAdviceResponseCustomJson;
2872
+ return message;
2873
+ }
2874
+ function createBaseListResourceAdviceResponse() {
2875
+ const message = {
2876
+ $type: "nebius.capacity.v1.ListResourceAdviceResponse",
2877
+ items: [],
2878
+ nextPageToken: "",
2879
+ };
2880
+ return applyListResourceAdviceResponseCustom(message);
2881
+ }
2882
+ exports.ResourceAdviceServiceServiceDescription = {
2883
+ list: {
2884
+ path: "/nebius.capacity.v1.ResourceAdviceService/List",
2885
+ requestStream: false,
2886
+ responseStream: false,
2887
+ requestSerialize: (value) => Buffer.from(exports.ListResourceAdviceRequest.encode(value).finish()),
2888
+ sendResetMask: false,
2889
+ requestDeserialize: (value) => exports.ListResourceAdviceRequest.decode(value),
2890
+ responseSerialize: (value) => Buffer.from(exports.ListResourceAdviceResponse.encode(value).finish()),
2891
+ responseDeserialize: (value) => exports.ListResourceAdviceResponse.decode(value),
2892
+ },
2893
+ };
2894
+ exports.ResourceAdviceServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.ResourceAdviceServiceServiceDescription, "nebius.capacity.v1.ResourceAdviceService");
2895
+ class ResourceAdviceService {
2896
+ sdk;
2897
+ $type = "nebius.capacity.v1.ResourceAdviceService";
2898
+ addr;
2899
+ spec;
2900
+ apiServiceName = "capacity-advisor.billing-cpl";
2901
+ constructor(sdk) {
2902
+ this.sdk = sdk;
2903
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
2904
+ this.addr = addr;
2905
+ this.spec = exports.ResourceAdviceServiceServiceDescription;
2906
+ }
2907
+ list(...args) {
2908
+ const spec = this.spec.list;
2909
+ const request = args[0];
2910
+ const metadata = (args.length > 1 ? args[1] : undefined);
2911
+ const options = (args.length > 2 ? args[2] : undefined);
2912
+ const deserialize = spec.responseDeserialize;
2913
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2914
+ }
2915
+ }
2916
+ exports.ResourceAdviceService = ResourceAdviceService;
2917
+ const ResourceAdviceStatus_Availability_DataState_VALUE_COMMENTS = {
2918
+ DATA_STATE_UNSPECIFIED: " Shouldn't ever happen.\n",
2919
+ DATA_STATE_FRESH: " Data is relevant and reflects current state of the system.\n",
2920
+ DATA_STATE_STALE: " Data is not relevant anymore as it was fetched long time ago.\n",
2921
+ DATA_STATE_UNKNOWN: " Failed to retrieve data.\n",
2922
+ };
2923
+ exports.ResourceAdviceStatus_Availability_DataState = (0, index_1.createEnum)("nebius.capacity.v1.ResourceAdviceStatus.Availability.DataState", {
2924
+ /**
2925
+ * Shouldn't ever happen.
2926
+ *
2927
+ */
2928
+ DATA_STATE_UNSPECIFIED: 0,
2929
+ /**
2930
+ * Data is relevant and reflects current state of the system.
2931
+ *
2932
+ */
2933
+ DATA_STATE_FRESH: 1,
2934
+ /**
2935
+ * Data is not relevant anymore as it was fetched long time ago.
2936
+ *
2937
+ */
2938
+ DATA_STATE_STALE: 2,
2939
+ /**
2940
+ * Failed to retrieve data.
2941
+ *
2942
+ */
2943
+ DATA_STATE_UNKNOWN: 10,
2944
+ }, ResourceAdviceStatus_Availability_DataState_VALUE_COMMENTS);
2945
+ protobuf_1.protoRegistry.registerEnum(exports.ResourceAdviceStatus_Availability_DataState);
2946
+ exports.ResourceAdvice = {
2947
+ $type: "nebius.capacity.v1.ResourceAdvice",
2948
+ encode(message, writer = new index_1.BinaryWriter()) {
2949
+ if (message.metadata !== undefined) {
2950
+ const w = writer.uint32(10).fork();
2951
+ v1_1.ResourceMetadata.encode(message.metadata, w);
2952
+ w.join();
2953
+ }
2954
+ if (message.spec !== undefined) {
2955
+ const w = writer.uint32(18).fork();
2956
+ exports.ResourceAdviceSpec.encode(message.spec, w);
2957
+ w.join();
2958
+ }
2959
+ if (message.status !== undefined) {
2960
+ const w = writer.uint32(26).fork();
2961
+ exports.ResourceAdviceStatus.encode(message.status, w);
2962
+ w.join();
2963
+ }
2964
+ if (message[index_1.unknownFieldsSymbol]) {
2965
+ writer.raw(message[index_1.unknownFieldsSymbol]);
2966
+ }
2967
+ return writer;
2968
+ },
2969
+ decode(input, length) {
2970
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
2971
+ const end = length === undefined ? reader.len : reader.pos + length;
2972
+ const message = createBaseResourceAdvice();
2973
+ let writer = undefined;
2974
+ while (reader.pos < end) {
2975
+ const tag = reader.uint32();
2976
+ switch (tag >>> 3) {
2977
+ case 1: {
2978
+ if (tag !== 10)
2979
+ break;
2980
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
2981
+ continue;
2982
+ }
2983
+ case 2: {
2984
+ if (tag !== 18)
2985
+ break;
2986
+ message.spec = exports.ResourceAdviceSpec.decode(reader, reader.uint32());
2987
+ continue;
2988
+ }
2989
+ case 3: {
2990
+ if (tag !== 26)
2991
+ break;
2992
+ message.status = exports.ResourceAdviceStatus.decode(reader, reader.uint32());
2993
+ continue;
2994
+ }
2995
+ default:
2996
+ break;
2997
+ }
2998
+ if ((tag & 7) === 4 || tag === 0) {
2999
+ break;
3000
+ }
3001
+ {
3002
+ if (!writer)
3003
+ writer = new index_1.BinaryWriter();
3004
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3005
+ writer.uint32(tag).raw(skipped);
3006
+ }
3007
+ }
3008
+ if (writer) {
3009
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3010
+ }
3011
+ return message;
3012
+ },
3013
+ fromJSON(object) {
3014
+ return applyResourceAdviceCustom({
3015
+ $type: "nebius.capacity.v1.ResourceAdvice",
3016
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
3017
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
3018
+ : undefined,
3019
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
3020
+ ? exports.ResourceAdviceSpec.fromJSON(object.spec ?? object.spec)
3021
+ : undefined,
3022
+ status: (0, index_1.isSet)(object.status ?? object.status)
3023
+ ? exports.ResourceAdviceStatus.fromJSON(object.status ?? object.status)
3024
+ : undefined,
3025
+ });
3026
+ },
3027
+ toJSON(message, use = "json") {
3028
+ const obj = {};
3029
+ const pick = (json, pb) => (use === "json" ? json : pb);
3030
+ if (message.metadata !== undefined) {
3031
+ obj[pick("metadata", "metadata")] = message.metadata
3032
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
3033
+ : undefined;
3034
+ }
3035
+ if (message.spec !== undefined) {
3036
+ obj[pick("spec", "spec")] = message.spec
3037
+ ? exports.ResourceAdviceSpec.toJSON(message.spec, use)
3038
+ : undefined;
3039
+ }
3040
+ if (message.status !== undefined) {
3041
+ obj[pick("status", "status")] = message.status
3042
+ ? exports.ResourceAdviceStatus.toJSON(message.status, use)
3043
+ : undefined;
3044
+ }
3045
+ return obj;
3046
+ },
3047
+ create(base) {
3048
+ return exports.ResourceAdvice.fromPartial(base ?? {});
3049
+ },
3050
+ fromPartial(object) {
3051
+ const message = createBaseResourceAdvice();
3052
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
3053
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
3054
+ : undefined;
3055
+ message.spec = (object.spec !== undefined && object.spec !== null)
3056
+ ? exports.ResourceAdviceSpec.fromPartial(object.spec)
3057
+ : undefined;
3058
+ message.status = (object.status !== undefined && object.status !== null)
3059
+ ? exports.ResourceAdviceStatus.fromPartial(object.status)
3060
+ : undefined;
3061
+ return message;
3062
+ },
3063
+ };
3064
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAdvice);
3065
+ function ResourceAdviceCustomInspect() {
3066
+ const parts = [];
3067
+ if (this.metadata !== undefined)
3068
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
3069
+ if (this.spec !== undefined)
3070
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
3071
+ if (this.status !== undefined)
3072
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
3073
+ return `${this.$type}(${parts.join(", ")})`;
3074
+ }
3075
+ function ResourceAdviceCustomJson() {
3076
+ const obj = {
3077
+ type: this.$type,
3078
+ };
3079
+ if (this.metadata !== undefined)
3080
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
3081
+ if (this.spec !== undefined)
3082
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
3083
+ if (this.status !== undefined)
3084
+ obj.status = (0, logging_1.inspectJson)(this.status);
3085
+ return obj;
3086
+ }
3087
+ function applyResourceAdviceCustom(message) {
3088
+ message[logging_1.custom] = ResourceAdviceCustomInspect;
3089
+ message[logging_1.customJson] = ResourceAdviceCustomJson;
3090
+ return message;
3091
+ }
3092
+ function createBaseResourceAdvice() {
3093
+ const message = {
3094
+ $type: "nebius.capacity.v1.ResourceAdvice",
3095
+ metadata: undefined,
3096
+ spec: undefined,
3097
+ status: undefined,
3098
+ };
3099
+ return applyResourceAdviceCustom(message);
3100
+ }
3101
+ exports.ResourceAdviceSpec = {
3102
+ $type: "nebius.capacity.v1.ResourceAdviceSpec",
3103
+ encode(message, writer = new index_1.BinaryWriter()) {
3104
+ if (message.region !== "") {
3105
+ writer.uint32(10).string(message.region);
3106
+ }
3107
+ if (message.fabric !== "") {
3108
+ writer.uint32(18).string(message.fabric);
3109
+ }
3110
+ if (message.resourceDetails?.$case === undefined) { /* noop */ }
3111
+ else if (message.resourceDetails?.$case === "computeInstance") {
3112
+ const w = writer.uint32(82).fork();
3113
+ exports.ComputeInstanceDetails.encode(message.resourceDetails.computeInstance, w);
3114
+ w.join();
3115
+ }
3116
+ if (message[index_1.unknownFieldsSymbol]) {
3117
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3118
+ }
3119
+ return writer;
3120
+ },
3121
+ decode(input, length) {
3122
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3123
+ const end = length === undefined ? reader.len : reader.pos + length;
3124
+ const message = createBaseResourceAdviceSpec();
3125
+ let writer = undefined;
3126
+ while (reader.pos < end) {
3127
+ const tag = reader.uint32();
3128
+ switch (tag >>> 3) {
3129
+ case 1: {
3130
+ if (tag !== 10)
3131
+ break;
3132
+ message.region = reader.string();
3133
+ continue;
3134
+ }
3135
+ case 2: {
3136
+ if (tag !== 18)
3137
+ break;
3138
+ message.fabric = reader.string();
3139
+ continue;
3140
+ }
3141
+ case 10: {
3142
+ if (tag !== 82)
3143
+ break;
3144
+ message.resourceDetails = {
3145
+ $case: "computeInstance",
3146
+ computeInstance: exports.ComputeInstanceDetails.decode(reader, reader.uint32())
3147
+ };
3148
+ continue;
3149
+ }
3150
+ default:
3151
+ break;
3152
+ }
3153
+ if ((tag & 7) === 4 || tag === 0) {
3154
+ break;
3155
+ }
3156
+ {
3157
+ if (!writer)
3158
+ writer = new index_1.BinaryWriter();
3159
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3160
+ writer.uint32(tag).raw(skipped);
3161
+ }
3162
+ }
3163
+ if (writer) {
3164
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3165
+ }
3166
+ return message;
3167
+ },
3168
+ fromJSON(object) {
3169
+ return applyResourceAdviceSpecCustom({
3170
+ $type: "nebius.capacity.v1.ResourceAdviceSpec",
3171
+ region: (0, index_1.isSet)(object.region ?? object.region)
3172
+ ? String(object.region ?? object.region)
3173
+ : "",
3174
+ fabric: (0, index_1.isSet)(object.fabric ?? object.fabric)
3175
+ ? String(object.fabric ?? object.fabric)
3176
+ : "",
3177
+ resourceDetails: (() => {
3178
+ if ((0, index_1.isSet)(object.computeInstance) || (0, index_1.isSet)(object.compute_instance)) {
3179
+ return {
3180
+ $case: "computeInstance",
3181
+ computeInstance: exports.ComputeInstanceDetails.fromJSON(object.computeInstance ?? object.compute_instance)
3182
+ };
3183
+ }
3184
+ return undefined;
3185
+ })(),
3186
+ });
3187
+ },
3188
+ toJSON(message, use = "json") {
3189
+ const obj = {};
3190
+ const pick = (json, pb) => (use === "json" ? json : pb);
3191
+ if (message.region !== "") {
3192
+ obj[pick("region", "region")] = message.region;
3193
+ }
3194
+ if (message.fabric !== "") {
3195
+ obj[pick("fabric", "fabric")] = message.fabric;
3196
+ }
3197
+ switch (message.resourceDetails?.$case) {
3198
+ case "computeInstance": {
3199
+ obj[pick("computeInstance", "compute_instance")] = exports.ComputeInstanceDetails.toJSON(message.resourceDetails.computeInstance, use);
3200
+ break;
3201
+ }
3202
+ default: break;
3203
+ }
3204
+ return obj;
3205
+ },
3206
+ create(base) {
3207
+ return exports.ResourceAdviceSpec.fromPartial(base ?? {});
3208
+ },
3209
+ fromPartial(object) {
3210
+ const message = createBaseResourceAdviceSpec();
3211
+ message.region = (object.region !== undefined && object.region !== null)
3212
+ ? object.region
3213
+ : "";
3214
+ message.fabric = (object.fabric !== undefined && object.fabric !== null)
3215
+ ? object.fabric
3216
+ : "";
3217
+ switch (object.resourceDetails?.$case) {
3218
+ case "computeInstance": {
3219
+ if (object.resourceDetails.computeInstance !== undefined && object.resourceDetails.computeInstance !== null) {
3220
+ message.resourceDetails = {
3221
+ $case: "computeInstance",
3222
+ computeInstance: exports.ComputeInstanceDetails.fromPartial(object.resourceDetails.computeInstance),
3223
+ };
3224
+ }
3225
+ break;
3226
+ }
3227
+ default: break;
3228
+ }
3229
+ return message;
3230
+ },
3231
+ };
3232
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAdviceSpec);
3233
+ function ResourceAdviceSpecCustomInspect() {
3234
+ const parts = [];
3235
+ if (this.region !== "")
3236
+ parts.push("region" + "=" + (0, util_1.inspect)(this.region));
3237
+ if (this.fabric !== "")
3238
+ parts.push("fabric" + "=" + (0, util_1.inspect)(this.fabric));
3239
+ return `${this.$type}(${parts.join(", ")})`;
3240
+ }
3241
+ function ResourceAdviceSpecCustomJson() {
3242
+ const obj = {
3243
+ type: this.$type,
3244
+ };
3245
+ if (this.region !== "")
3246
+ obj.region = (0, logging_1.inspectJson)(this.region);
3247
+ if (this.fabric !== "")
3248
+ obj.fabric = (0, logging_1.inspectJson)(this.fabric);
3249
+ return obj;
3250
+ }
3251
+ function applyResourceAdviceSpecCustom(message) {
3252
+ message[logging_1.custom] = ResourceAdviceSpecCustomInspect;
3253
+ message[logging_1.customJson] = ResourceAdviceSpecCustomJson;
3254
+ return message;
3255
+ }
3256
+ function createBaseResourceAdviceSpec() {
3257
+ const message = {
3258
+ $type: "nebius.capacity.v1.ResourceAdviceSpec",
3259
+ region: "",
3260
+ fabric: "",
3261
+ resourceDetails: undefined,
3262
+ };
3263
+ return applyResourceAdviceSpecCustom(message);
3264
+ }
3265
+ exports.ComputeInstanceDetails = {
3266
+ $type: "nebius.capacity.v1.ComputeInstanceDetails",
3267
+ encode(message, writer = new index_1.BinaryWriter()) {
3268
+ if (message.platform !== "") {
3269
+ writer.uint32(10).string(message.platform);
3270
+ }
3271
+ if (message.preset !== undefined) {
3272
+ const w = writer.uint32(18).fork();
3273
+ exports.ComputeInstanceDetails_Preset.encode(message.preset, w);
3274
+ w.join();
3275
+ }
3276
+ if ((message.gpuMemoryGigabytes ?? 0) !== 0) {
3277
+ writer.uint32(24).int32(message.gpuMemoryGigabytes);
3278
+ }
3279
+ if (message[index_1.unknownFieldsSymbol]) {
3280
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3281
+ }
3282
+ return writer;
3283
+ },
3284
+ decode(input, length) {
3285
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3286
+ const end = length === undefined ? reader.len : reader.pos + length;
3287
+ const message = createBaseComputeInstanceDetails();
3288
+ let writer = undefined;
3289
+ while (reader.pos < end) {
3290
+ const tag = reader.uint32();
3291
+ switch (tag >>> 3) {
3292
+ case 1: {
3293
+ if (tag !== 10)
3294
+ break;
3295
+ message.platform = reader.string();
3296
+ continue;
3297
+ }
3298
+ case 2: {
3299
+ if (tag !== 18)
3300
+ break;
3301
+ message.preset = exports.ComputeInstanceDetails_Preset.decode(reader, reader.uint32());
3302
+ continue;
3303
+ }
3304
+ case 3: {
3305
+ if (tag !== 24)
3306
+ break;
3307
+ message.gpuMemoryGigabytes = reader.int32();
3308
+ continue;
3309
+ }
3310
+ default:
3311
+ break;
3312
+ }
3313
+ if ((tag & 7) === 4 || tag === 0) {
3314
+ break;
3315
+ }
3316
+ {
3317
+ if (!writer)
3318
+ writer = new index_1.BinaryWriter();
3319
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3320
+ writer.uint32(tag).raw(skipped);
3321
+ }
3322
+ }
3323
+ if (writer) {
3324
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3325
+ }
3326
+ return message;
3327
+ },
3328
+ fromJSON(object) {
3329
+ return applyComputeInstanceDetailsCustom({
3330
+ $type: "nebius.capacity.v1.ComputeInstanceDetails",
3331
+ platform: (0, index_1.isSet)(object.platform ?? object.platform)
3332
+ ? String(object.platform ?? object.platform)
3333
+ : "",
3334
+ preset: (0, index_1.isSet)(object.preset ?? object.preset)
3335
+ ? exports.ComputeInstanceDetails_Preset.fromJSON(object.preset ?? object.preset)
3336
+ : undefined,
3337
+ gpuMemoryGigabytes: (0, index_1.isSet)(object.gpuMemoryGigabytes ?? object.gpu_memory_gigabytes)
3338
+ ? Number(object.gpuMemoryGigabytes ?? object.gpu_memory_gigabytes)
3339
+ : 0,
3340
+ });
3341
+ },
3342
+ toJSON(message, use = "json") {
3343
+ const obj = {};
3344
+ const pick = (json, pb) => (use === "json" ? json : pb);
3345
+ if (message.platform !== "") {
3346
+ obj[pick("platform", "platform")] = message.platform;
3347
+ }
3348
+ if (message.preset !== undefined) {
3349
+ obj[pick("preset", "preset")] = message.preset
3350
+ ? exports.ComputeInstanceDetails_Preset.toJSON(message.preset, use)
3351
+ : undefined;
3352
+ }
3353
+ if ((message.gpuMemoryGigabytes ?? 0) !== 0) {
3354
+ obj[pick("gpuMemoryGigabytes", "gpu_memory_gigabytes")] = message.gpuMemoryGigabytes;
3355
+ }
3356
+ return obj;
3357
+ },
3358
+ create(base) {
3359
+ return exports.ComputeInstanceDetails.fromPartial(base ?? {});
3360
+ },
3361
+ fromPartial(object) {
3362
+ const message = createBaseComputeInstanceDetails();
3363
+ message.platform = (object.platform !== undefined && object.platform !== null)
3364
+ ? object.platform
3365
+ : "";
3366
+ message.preset = (object.preset !== undefined && object.preset !== null)
3367
+ ? exports.ComputeInstanceDetails_Preset.fromPartial(object.preset)
3368
+ : undefined;
3369
+ message.gpuMemoryGigabytes = (object.gpuMemoryGigabytes !== undefined && object.gpuMemoryGigabytes !== null)
3370
+ ? object.gpuMemoryGigabytes
3371
+ : 0;
3372
+ return message;
3373
+ },
3374
+ };
3375
+ protobuf_1.protoRegistry.registerMessage(exports.ComputeInstanceDetails);
3376
+ function ComputeInstanceDetailsCustomInspect() {
3377
+ const parts = [];
3378
+ if (this.platform !== "")
3379
+ parts.push("platform" + "=" + (0, util_1.inspect)(this.platform));
3380
+ if (this.preset !== undefined)
3381
+ parts.push("preset" + "=" + (0, util_1.inspect)(this.preset));
3382
+ if ((this.gpuMemoryGigabytes ?? 0) !== 0)
3383
+ parts.push("gpuMemoryGigabytes" + "=" + (0, util_1.inspect)(this.gpuMemoryGigabytes));
3384
+ return `${this.$type}(${parts.join(", ")})`;
3385
+ }
3386
+ function ComputeInstanceDetailsCustomJson() {
3387
+ const obj = {
3388
+ type: this.$type,
3389
+ };
3390
+ if (this.platform !== "")
3391
+ obj.platform = (0, logging_1.inspectJson)(this.platform);
3392
+ if (this.preset !== undefined)
3393
+ obj.preset = (0, logging_1.inspectJson)(this.preset);
3394
+ if ((this.gpuMemoryGigabytes ?? 0) !== 0)
3395
+ obj.gpuMemoryGigabytes = (0, logging_1.inspectJson)(this.gpuMemoryGigabytes);
3396
+ return obj;
3397
+ }
3398
+ function applyComputeInstanceDetailsCustom(message) {
3399
+ message[logging_1.custom] = ComputeInstanceDetailsCustomInspect;
3400
+ message[logging_1.customJson] = ComputeInstanceDetailsCustomJson;
3401
+ return message;
3402
+ }
3403
+ function createBaseComputeInstanceDetails() {
3404
+ const message = {
3405
+ $type: "nebius.capacity.v1.ComputeInstanceDetails",
3406
+ platform: "",
3407
+ preset: undefined,
3408
+ gpuMemoryGigabytes: 0,
3409
+ };
3410
+ return applyComputeInstanceDetailsCustom(message);
3411
+ }
3412
+ exports.ComputeInstanceDetails_Preset = {
3413
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset",
3414
+ encode(message, writer = new index_1.BinaryWriter()) {
3415
+ if (message.name !== "") {
3416
+ writer.uint32(10).string(message.name);
3417
+ }
3418
+ if (message.resources !== undefined) {
3419
+ const w = writer.uint32(18).fork();
3420
+ exports.ComputeInstanceDetails_Preset_Resources.encode(message.resources, w);
3421
+ w.join();
3422
+ }
3423
+ if (message[index_1.unknownFieldsSymbol]) {
3424
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3425
+ }
3426
+ return writer;
3427
+ },
3428
+ decode(input, length) {
3429
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3430
+ const end = length === undefined ? reader.len : reader.pos + length;
3431
+ const message = createBaseComputeInstanceDetails_Preset();
3432
+ let writer = undefined;
3433
+ while (reader.pos < end) {
3434
+ const tag = reader.uint32();
3435
+ switch (tag >>> 3) {
3436
+ case 1: {
3437
+ if (tag !== 10)
3438
+ break;
3439
+ message.name = reader.string();
3440
+ continue;
3441
+ }
3442
+ case 2: {
3443
+ if (tag !== 18)
3444
+ break;
3445
+ message.resources = exports.ComputeInstanceDetails_Preset_Resources.decode(reader, reader.uint32());
3446
+ continue;
3447
+ }
3448
+ default:
3449
+ break;
3450
+ }
3451
+ if ((tag & 7) === 4 || tag === 0) {
3452
+ break;
3453
+ }
3454
+ {
3455
+ if (!writer)
3456
+ writer = new index_1.BinaryWriter();
3457
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3458
+ writer.uint32(tag).raw(skipped);
3459
+ }
3460
+ }
3461
+ if (writer) {
3462
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3463
+ }
3464
+ return message;
3465
+ },
3466
+ fromJSON(object) {
3467
+ return applyComputeInstanceDetails_PresetCustom({
3468
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset",
3469
+ name: (0, index_1.isSet)(object.name ?? object.name)
3470
+ ? String(object.name ?? object.name)
3471
+ : "",
3472
+ resources: (0, index_1.isSet)(object.resources ?? object.resources)
3473
+ ? exports.ComputeInstanceDetails_Preset_Resources.fromJSON(object.resources ?? object.resources)
3474
+ : undefined,
3475
+ });
3476
+ },
3477
+ toJSON(message, use = "json") {
3478
+ const obj = {};
3479
+ const pick = (json, pb) => (use === "json" ? json : pb);
3480
+ if (message.name !== "") {
3481
+ obj[pick("name", "name")] = message.name;
3482
+ }
3483
+ if (message.resources !== undefined) {
3484
+ obj[pick("resources", "resources")] = message.resources
3485
+ ? exports.ComputeInstanceDetails_Preset_Resources.toJSON(message.resources, use)
3486
+ : undefined;
3487
+ }
3488
+ return obj;
3489
+ },
3490
+ create(base) {
3491
+ return exports.ComputeInstanceDetails_Preset.fromPartial(base ?? {});
3492
+ },
3493
+ fromPartial(object) {
3494
+ const message = createBaseComputeInstanceDetails_Preset();
3495
+ message.name = (object.name !== undefined && object.name !== null)
3496
+ ? object.name
3497
+ : "";
3498
+ message.resources = (object.resources !== undefined && object.resources !== null)
3499
+ ? exports.ComputeInstanceDetails_Preset_Resources.fromPartial(object.resources)
3500
+ : undefined;
3501
+ return message;
3502
+ },
3503
+ };
3504
+ protobuf_1.protoRegistry.registerMessage(exports.ComputeInstanceDetails_Preset);
3505
+ function ComputeInstanceDetails_PresetCustomInspect() {
3506
+ const parts = [];
3507
+ if (this.name !== "")
3508
+ parts.push("name" + "=" + (0, util_1.inspect)(this.name));
3509
+ if (this.resources !== undefined)
3510
+ parts.push("resources" + "=" + (0, util_1.inspect)(this.resources));
3511
+ return `${this.$type}(${parts.join(", ")})`;
3512
+ }
3513
+ function ComputeInstanceDetails_PresetCustomJson() {
3514
+ const obj = {
3515
+ type: this.$type,
3516
+ };
3517
+ if (this.name !== "")
3518
+ obj.name = (0, logging_1.inspectJson)(this.name);
3519
+ if (this.resources !== undefined)
3520
+ obj.resources = (0, logging_1.inspectJson)(this.resources);
3521
+ return obj;
3522
+ }
3523
+ function applyComputeInstanceDetails_PresetCustom(message) {
3524
+ message[logging_1.custom] = ComputeInstanceDetails_PresetCustomInspect;
3525
+ message[logging_1.customJson] = ComputeInstanceDetails_PresetCustomJson;
3526
+ return message;
3527
+ }
3528
+ function createBaseComputeInstanceDetails_Preset() {
3529
+ const message = {
3530
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset",
3531
+ name: "",
3532
+ resources: undefined,
3533
+ };
3534
+ return applyComputeInstanceDetails_PresetCustom(message);
3535
+ }
3536
+ exports.ComputeInstanceDetails_Preset_Resources = {
3537
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset.Resources",
3538
+ encode(message, writer = new index_1.BinaryWriter()) {
3539
+ if ((message.vcpuCount ?? 0) !== 0) {
3540
+ writer.uint32(8).int32(message.vcpuCount);
3541
+ }
3542
+ if ((message.memoryGibibytes ?? 0) !== 0) {
3543
+ writer.uint32(16).int32(message.memoryGibibytes);
3544
+ }
3545
+ if ((message.gpuCount ?? 0) !== 0) {
3546
+ writer.uint32(24).int32(message.gpuCount);
3547
+ }
3548
+ if (message[index_1.unknownFieldsSymbol]) {
3549
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3550
+ }
3551
+ return writer;
3552
+ },
3553
+ decode(input, length) {
3554
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3555
+ const end = length === undefined ? reader.len : reader.pos + length;
3556
+ const message = createBaseComputeInstanceDetails_Preset_Resources();
3557
+ let writer = undefined;
3558
+ while (reader.pos < end) {
3559
+ const tag = reader.uint32();
3560
+ switch (tag >>> 3) {
3561
+ case 1: {
3562
+ if (tag !== 8)
3563
+ break;
3564
+ message.vcpuCount = reader.int32();
3565
+ continue;
3566
+ }
3567
+ case 2: {
3568
+ if (tag !== 16)
3569
+ break;
3570
+ message.memoryGibibytes = reader.int32();
3571
+ continue;
3572
+ }
3573
+ case 3: {
3574
+ if (tag !== 24)
3575
+ break;
3576
+ message.gpuCount = reader.int32();
3577
+ continue;
3578
+ }
3579
+ default:
3580
+ break;
3581
+ }
3582
+ if ((tag & 7) === 4 || tag === 0) {
3583
+ break;
3584
+ }
3585
+ {
3586
+ if (!writer)
3587
+ writer = new index_1.BinaryWriter();
3588
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3589
+ writer.uint32(tag).raw(skipped);
3590
+ }
3591
+ }
3592
+ if (writer) {
3593
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3594
+ }
3595
+ return message;
3596
+ },
3597
+ fromJSON(object) {
3598
+ return applyComputeInstanceDetails_Preset_ResourcesCustom({
3599
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset.Resources",
3600
+ vcpuCount: (0, index_1.isSet)(object.vcpuCount ?? object.vcpu_count)
3601
+ ? Number(object.vcpuCount ?? object.vcpu_count)
3602
+ : 0,
3603
+ memoryGibibytes: (0, index_1.isSet)(object.memoryGibibytes ?? object.memory_gibibytes)
3604
+ ? Number(object.memoryGibibytes ?? object.memory_gibibytes)
3605
+ : 0,
3606
+ gpuCount: (0, index_1.isSet)(object.gpuCount ?? object.gpu_count)
3607
+ ? Number(object.gpuCount ?? object.gpu_count)
3608
+ : 0,
3609
+ });
3610
+ },
3611
+ toJSON(message, use = "json") {
3612
+ const obj = {};
3613
+ const pick = (json, pb) => (use === "json" ? json : pb);
3614
+ if ((message.vcpuCount ?? 0) !== 0) {
3615
+ obj[pick("vcpuCount", "vcpu_count")] = message.vcpuCount;
3616
+ }
3617
+ if ((message.memoryGibibytes ?? 0) !== 0) {
3618
+ obj[pick("memoryGibibytes", "memory_gibibytes")] = message.memoryGibibytes;
3619
+ }
3620
+ if ((message.gpuCount ?? 0) !== 0) {
3621
+ obj[pick("gpuCount", "gpu_count")] = message.gpuCount;
3622
+ }
3623
+ return obj;
3624
+ },
3625
+ create(base) {
3626
+ return exports.ComputeInstanceDetails_Preset_Resources.fromPartial(base ?? {});
3627
+ },
3628
+ fromPartial(object) {
3629
+ const message = createBaseComputeInstanceDetails_Preset_Resources();
3630
+ message.vcpuCount = (object.vcpuCount !== undefined && object.vcpuCount !== null)
3631
+ ? object.vcpuCount
3632
+ : 0;
3633
+ message.memoryGibibytes = (object.memoryGibibytes !== undefined && object.memoryGibibytes !== null)
3634
+ ? object.memoryGibibytes
3635
+ : 0;
3636
+ message.gpuCount = (object.gpuCount !== undefined && object.gpuCount !== null)
3637
+ ? object.gpuCount
3638
+ : 0;
3639
+ return message;
3640
+ },
3641
+ };
3642
+ protobuf_1.protoRegistry.registerMessage(exports.ComputeInstanceDetails_Preset_Resources);
3643
+ function ComputeInstanceDetails_Preset_ResourcesCustomInspect() {
3644
+ const parts = [];
3645
+ if ((this.vcpuCount ?? 0) !== 0)
3646
+ parts.push("vcpuCount" + "=" + (0, util_1.inspect)(this.vcpuCount));
3647
+ if ((this.memoryGibibytes ?? 0) !== 0)
3648
+ parts.push("memoryGibibytes" + "=" + (0, util_1.inspect)(this.memoryGibibytes));
3649
+ if ((this.gpuCount ?? 0) !== 0)
3650
+ parts.push("gpuCount" + "=" + (0, util_1.inspect)(this.gpuCount));
3651
+ return `${this.$type}(${parts.join(", ")})`;
3652
+ }
3653
+ function ComputeInstanceDetails_Preset_ResourcesCustomJson() {
3654
+ const obj = {
3655
+ type: this.$type,
3656
+ };
3657
+ if ((this.vcpuCount ?? 0) !== 0)
3658
+ obj.vcpuCount = (0, logging_1.inspectJson)(this.vcpuCount);
3659
+ if ((this.memoryGibibytes ?? 0) !== 0)
3660
+ obj.memoryGibibytes = (0, logging_1.inspectJson)(this.memoryGibibytes);
3661
+ if ((this.gpuCount ?? 0) !== 0)
3662
+ obj.gpuCount = (0, logging_1.inspectJson)(this.gpuCount);
3663
+ return obj;
3664
+ }
3665
+ function applyComputeInstanceDetails_Preset_ResourcesCustom(message) {
3666
+ message[logging_1.custom] = ComputeInstanceDetails_Preset_ResourcesCustomInspect;
3667
+ message[logging_1.customJson] = ComputeInstanceDetails_Preset_ResourcesCustomJson;
3668
+ return message;
3669
+ }
3670
+ function createBaseComputeInstanceDetails_Preset_Resources() {
3671
+ const message = {
3672
+ $type: "nebius.capacity.v1.ComputeInstanceDetails.Preset.Resources",
3673
+ vcpuCount: 0,
3674
+ memoryGibibytes: 0,
3675
+ gpuCount: 0,
3676
+ };
3677
+ return applyComputeInstanceDetails_Preset_ResourcesCustom(message);
3678
+ }
3679
+ exports.ResourceAdviceStatus = {
3680
+ $type: "nebius.capacity.v1.ResourceAdviceStatus",
3681
+ encode(message, writer = new index_1.BinaryWriter()) {
3682
+ if (message.reserved !== undefined) {
3683
+ const w = writer.uint32(10).fork();
3684
+ exports.ResourceAdviceStatus_Availability.encode(message.reserved, w);
3685
+ w.join();
3686
+ }
3687
+ if (message.onDemand !== undefined) {
3688
+ const w = writer.uint32(18).fork();
3689
+ exports.ResourceAdviceStatus_Availability.encode(message.onDemand, w);
3690
+ w.join();
3691
+ }
3692
+ if (message.preemptible !== undefined) {
3693
+ const w = writer.uint32(26).fork();
3694
+ exports.ResourceAdviceStatus_Availability.encode(message.preemptible, w);
3695
+ w.join();
3696
+ }
3697
+ if (message[index_1.unknownFieldsSymbol]) {
3698
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3699
+ }
3700
+ return writer;
3701
+ },
3702
+ decode(input, length) {
3703
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3704
+ const end = length === undefined ? reader.len : reader.pos + length;
3705
+ const message = createBaseResourceAdviceStatus();
3706
+ let writer = undefined;
3707
+ while (reader.pos < end) {
3708
+ const tag = reader.uint32();
3709
+ switch (tag >>> 3) {
3710
+ case 1: {
3711
+ if (tag !== 10)
3712
+ break;
3713
+ message.reserved = exports.ResourceAdviceStatus_Availability.decode(reader, reader.uint32());
3714
+ continue;
3715
+ }
3716
+ case 2: {
3717
+ if (tag !== 18)
3718
+ break;
3719
+ message.onDemand = exports.ResourceAdviceStatus_Availability.decode(reader, reader.uint32());
3720
+ continue;
3721
+ }
3722
+ case 3: {
3723
+ if (tag !== 26)
3724
+ break;
3725
+ message.preemptible = exports.ResourceAdviceStatus_Availability.decode(reader, reader.uint32());
3726
+ continue;
3727
+ }
3728
+ default:
3729
+ break;
3730
+ }
3731
+ if ((tag & 7) === 4 || tag === 0) {
3732
+ break;
3733
+ }
3734
+ {
3735
+ if (!writer)
3736
+ writer = new index_1.BinaryWriter();
3737
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3738
+ writer.uint32(tag).raw(skipped);
3739
+ }
3740
+ }
3741
+ if (writer) {
3742
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3743
+ }
3744
+ return message;
3745
+ },
3746
+ fromJSON(object) {
3747
+ return applyResourceAdviceStatusCustom({
3748
+ $type: "nebius.capacity.v1.ResourceAdviceStatus",
3749
+ reserved: (0, index_1.isSet)(object.reserved ?? object.reserved)
3750
+ ? exports.ResourceAdviceStatus_Availability.fromJSON(object.reserved ?? object.reserved)
3751
+ : undefined,
3752
+ onDemand: (0, index_1.isSet)(object.onDemand ?? object.on_demand)
3753
+ ? exports.ResourceAdviceStatus_Availability.fromJSON(object.onDemand ?? object.on_demand)
3754
+ : undefined,
3755
+ preemptible: (0, index_1.isSet)(object.preemptible ?? object.preemptible)
3756
+ ? exports.ResourceAdviceStatus_Availability.fromJSON(object.preemptible ?? object.preemptible)
3757
+ : undefined,
3758
+ });
3759
+ },
3760
+ toJSON(message, use = "json") {
3761
+ const obj = {};
3762
+ const pick = (json, pb) => (use === "json" ? json : pb);
3763
+ if (message.reserved !== undefined) {
3764
+ obj[pick("reserved", "reserved")] = message.reserved
3765
+ ? exports.ResourceAdviceStatus_Availability.toJSON(message.reserved, use)
3766
+ : undefined;
3767
+ }
3768
+ if (message.onDemand !== undefined) {
3769
+ obj[pick("onDemand", "on_demand")] = message.onDemand
3770
+ ? exports.ResourceAdviceStatus_Availability.toJSON(message.onDemand, use)
3771
+ : undefined;
3772
+ }
3773
+ if (message.preemptible !== undefined) {
3774
+ obj[pick("preemptible", "preemptible")] = message.preemptible
3775
+ ? exports.ResourceAdviceStatus_Availability.toJSON(message.preemptible, use)
3776
+ : undefined;
3777
+ }
3778
+ return obj;
3779
+ },
3780
+ create(base) {
3781
+ return exports.ResourceAdviceStatus.fromPartial(base ?? {});
3782
+ },
3783
+ fromPartial(object) {
3784
+ const message = createBaseResourceAdviceStatus();
3785
+ message.reserved = (object.reserved !== undefined && object.reserved !== null)
3786
+ ? exports.ResourceAdviceStatus_Availability.fromPartial(object.reserved)
3787
+ : undefined;
3788
+ message.onDemand = (object.onDemand !== undefined && object.onDemand !== null)
3789
+ ? exports.ResourceAdviceStatus_Availability.fromPartial(object.onDemand)
3790
+ : undefined;
3791
+ message.preemptible = (object.preemptible !== undefined && object.preemptible !== null)
3792
+ ? exports.ResourceAdviceStatus_Availability.fromPartial(object.preemptible)
3793
+ : undefined;
3794
+ return message;
3795
+ },
3796
+ };
3797
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAdviceStatus);
3798
+ function ResourceAdviceStatusCustomInspect() {
3799
+ const parts = [];
3800
+ if (this.reserved !== undefined)
3801
+ parts.push("reserved" + "=" + (0, util_1.inspect)(this.reserved));
3802
+ if (this.onDemand !== undefined)
3803
+ parts.push("onDemand" + "=" + (0, util_1.inspect)(this.onDemand));
3804
+ if (this.preemptible !== undefined)
3805
+ parts.push("preemptible" + "=" + (0, util_1.inspect)(this.preemptible));
3806
+ return `${this.$type}(${parts.join(", ")})`;
3807
+ }
3808
+ function ResourceAdviceStatusCustomJson() {
3809
+ const obj = {
3810
+ type: this.$type,
3811
+ };
3812
+ if (this.reserved !== undefined)
3813
+ obj.reserved = (0, logging_1.inspectJson)(this.reserved);
3814
+ if (this.onDemand !== undefined)
3815
+ obj.onDemand = (0, logging_1.inspectJson)(this.onDemand);
3816
+ if (this.preemptible !== undefined)
3817
+ obj.preemptible = (0, logging_1.inspectJson)(this.preemptible);
3818
+ return obj;
3819
+ }
3820
+ function applyResourceAdviceStatusCustom(message) {
3821
+ message[logging_1.custom] = ResourceAdviceStatusCustomInspect;
3822
+ message[logging_1.customJson] = ResourceAdviceStatusCustomJson;
3823
+ return message;
3824
+ }
3825
+ function createBaseResourceAdviceStatus() {
3826
+ const message = {
3827
+ $type: "nebius.capacity.v1.ResourceAdviceStatus",
3828
+ reserved: undefined,
3829
+ onDemand: undefined,
3830
+ preemptible: undefined,
3831
+ };
3832
+ return applyResourceAdviceStatusCustom(message);
3833
+ }
3834
+ exports.ResourceAdviceStatus_Availability = {
3835
+ $type: "nebius.capacity.v1.ResourceAdviceStatus.Availability",
3836
+ encode(message, writer = new index_1.BinaryWriter()) {
3837
+ if ((message.dataState ?? exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED) !== exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED) {
3838
+ exports.ResourceAdviceStatus_Availability_DataState.encodeField(writer, 1, message.dataState);
3839
+ }
3840
+ if ((message.available ?? 0) !== 0) {
3841
+ writer.uint32(16).uint32(message.available);
3842
+ }
3843
+ if ((message.limit ?? 0) !== 0) {
3844
+ writer.uint32(32).uint32(message.limit);
3845
+ }
3846
+ if (message.effectiveAt !== undefined) {
3847
+ const w = writer.uint32(82).fork();
3848
+ index_1.wkt[".google.protobuf.Timestamp"].writeMessage(w, message.effectiveAt);
3849
+ w.join();
3850
+ }
3851
+ if (message[index_1.unknownFieldsSymbol]) {
3852
+ writer.raw(message[index_1.unknownFieldsSymbol]);
3853
+ }
3854
+ return writer;
3855
+ },
3856
+ decode(input, length) {
3857
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
3858
+ const end = length === undefined ? reader.len : reader.pos + length;
3859
+ const message = createBaseResourceAdviceStatus_Availability();
3860
+ let writer = undefined;
3861
+ while (reader.pos < end) {
3862
+ const tag = reader.uint32();
3863
+ switch (tag >>> 3) {
3864
+ case 1: {
3865
+ if (tag !== 8)
3866
+ break;
3867
+ message.dataState = exports.ResourceAdviceStatus_Availability_DataState.fromNumber(reader.int32());
3868
+ continue;
3869
+ }
3870
+ case 2: {
3871
+ if (tag !== 16)
3872
+ break;
3873
+ message.available = reader.uint32();
3874
+ continue;
3875
+ }
3876
+ case 4: {
3877
+ if (tag !== 32)
3878
+ break;
3879
+ message.limit = reader.uint32();
3880
+ continue;
3881
+ }
3882
+ case 10: {
3883
+ if (tag !== 82)
3884
+ break;
3885
+ const len = reader.uint32();
3886
+ message.effectiveAt = index_1.wkt[".google.protobuf.Timestamp"].readMessage(reader, len);
3887
+ continue;
3888
+ }
3889
+ default:
3890
+ break;
3891
+ }
3892
+ if ((tag & 7) === 4 || tag === 0) {
3893
+ break;
3894
+ }
3895
+ {
3896
+ if (!writer)
3897
+ writer = new index_1.BinaryWriter();
3898
+ const skipped = reader.skip(tag & 7, tag >>> 3);
3899
+ writer.uint32(tag).raw(skipped);
3900
+ }
3901
+ }
3902
+ if (writer) {
3903
+ message[index_1.unknownFieldsSymbol] = writer.finish();
3904
+ }
3905
+ return message;
3906
+ },
3907
+ fromJSON(object) {
3908
+ return applyResourceAdviceStatus_AvailabilityCustom({
3909
+ $type: "nebius.capacity.v1.ResourceAdviceStatus.Availability",
3910
+ dataState: (0, index_1.isSet)(object.dataState ?? object.data_state)
3911
+ ? exports.ResourceAdviceStatus_Availability_DataState.fromJSON(object.dataState ?? object.data_state)
3912
+ : exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED,
3913
+ available: (0, index_1.isSet)(object.available ?? object.available)
3914
+ ? Number(object.available ?? object.available)
3915
+ : 0,
3916
+ limit: (0, index_1.isSet)(object.limit ?? object.limit)
3917
+ ? Number(object.limit ?? object.limit)
3918
+ : 0,
3919
+ effectiveAt: (0, index_1.isSet)(object.effectiveAt ?? object.effective_at)
3920
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromJSON(object.effectiveAt ?? object.effective_at)
3921
+ : undefined,
3922
+ });
3923
+ },
3924
+ toJSON(message, use = "json") {
3925
+ const obj = {};
3926
+ const pick = (json, pb) => (use === "json" ? json : pb);
3927
+ if ((message.dataState ?? exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED) !== exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED) {
3928
+ obj[pick("dataState", "data_state")] = exports.ResourceAdviceStatus_Availability_DataState.toJSON(message.dataState);
3929
+ }
3930
+ if ((message.available ?? 0) !== 0) {
3931
+ obj[pick("available", "available")] = message.available;
3932
+ }
3933
+ if ((message.limit ?? 0) !== 0) {
3934
+ obj[pick("limit", "limit")] = message.limit;
3935
+ }
3936
+ if (message.effectiveAt !== undefined) {
3937
+ obj[pick("effectiveAt", "effective_at")] = index_1.wkt[".google.protobuf.Timestamp"].toJSON(message.effectiveAt, use);
3938
+ }
3939
+ return obj;
3940
+ },
3941
+ create(base) {
3942
+ return exports.ResourceAdviceStatus_Availability.fromPartial(base ?? {});
3943
+ },
3944
+ fromPartial(object) {
3945
+ const message = createBaseResourceAdviceStatus_Availability();
3946
+ message.dataState = (object.dataState !== undefined && object.dataState !== null)
3947
+ ? exports.ResourceAdviceStatus_Availability_DataState.fromJSON(object.dataState.name)
3948
+ : exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED;
3949
+ message.available = (object.available !== undefined && object.available !== null)
3950
+ ? object.available
3951
+ : 0;
3952
+ message.limit = (object.limit !== undefined && object.limit !== null)
3953
+ ? object.limit
3954
+ : 0;
3955
+ message.effectiveAt = (object.effectiveAt !== undefined && object.effectiveAt !== null)
3956
+ ? index_1.wkt[".google.protobuf.Timestamp"].fromPartial(object.effectiveAt)
3957
+ : undefined;
3958
+ return message;
3959
+ },
3960
+ };
3961
+ protobuf_1.protoRegistry.registerMessage(exports.ResourceAdviceStatus_Availability);
3962
+ function ResourceAdviceStatus_AvailabilityCustomInspect() {
3963
+ const parts = [];
3964
+ if (this.dataState !== undefined)
3965
+ parts.push("dataState" + "=" + (0, util_1.inspect)(this.dataState));
3966
+ if ((this.available ?? 0) !== 0)
3967
+ parts.push("available" + "=" + (0, util_1.inspect)(this.available));
3968
+ if ((this.limit ?? 0) !== 0)
3969
+ parts.push("limit" + "=" + (0, util_1.inspect)(this.limit));
3970
+ if (this.effectiveAt !== undefined)
3971
+ parts.push("effectiveAt" + "=" + (0, util_1.inspect)(this.effectiveAt));
3972
+ return `${this.$type}(${parts.join(", ")})`;
3973
+ }
3974
+ function ResourceAdviceStatus_AvailabilityCustomJson() {
3975
+ const obj = {
3976
+ type: this.$type,
3977
+ };
3978
+ if (this.dataState !== undefined)
3979
+ obj.dataState = (0, logging_1.inspectJson)(this.dataState);
3980
+ if ((this.available ?? 0) !== 0)
3981
+ obj.available = (0, logging_1.inspectJson)(this.available);
3982
+ if ((this.limit ?? 0) !== 0)
3983
+ obj.limit = (0, logging_1.inspectJson)(this.limit);
3984
+ if (this.effectiveAt !== undefined)
3985
+ obj.effectiveAt = (0, logging_1.inspectJson)(this.effectiveAt);
3986
+ return obj;
3987
+ }
3988
+ function applyResourceAdviceStatus_AvailabilityCustom(message) {
3989
+ message[logging_1.custom] = ResourceAdviceStatus_AvailabilityCustomInspect;
3990
+ message[logging_1.customJson] = ResourceAdviceStatus_AvailabilityCustomJson;
3991
+ return message;
3992
+ }
3993
+ function createBaseResourceAdviceStatus_Availability() {
3994
+ const message = {
3995
+ $type: "nebius.capacity.v1.ResourceAdviceStatus.Availability",
3996
+ dataState: exports.ResourceAdviceStatus_Availability_DataState.DATA_STATE_UNSPECIFIED,
3997
+ available: 0,
3998
+ limit: 0,
3999
+ effectiveAt: undefined,
4000
+ };
4001
+ return applyResourceAdviceStatus_AvailabilityCustom(message);
4002
+ }
2619
4003
  exports.ResourceAffinityComputeV1 = {
2620
4004
  $type: "nebius.capacity.v1.ResourceAffinityComputeV1",
2621
4005
  encode(message, writer = new index_1.BinaryWriter()) {