@nebius/js-sdk 0.2.30 → 0.2.32

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.
@@ -905,6 +905,1713 @@ export class DiskService {
905
905
  return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
906
906
  }
907
907
  }
908
+ export const GetDiskSnapshotRequest = {
909
+ $type: "nebius.compute.v1.GetDiskSnapshotRequest",
910
+ encode(message, writer = new BinaryWriter()) {
911
+ if (message.id !== "") {
912
+ writer.uint32(10).string(message.id);
913
+ }
914
+ if (message[unknownFieldsSymbol]) {
915
+ writer.raw(message[unknownFieldsSymbol]);
916
+ }
917
+ return writer;
918
+ },
919
+ decode(input, length) {
920
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
921
+ const end = length === undefined ? reader.len : reader.pos + length;
922
+ const message = createBaseGetDiskSnapshotRequest();
923
+ let writer = undefined;
924
+ while (reader.pos < end) {
925
+ const tag = reader.uint32();
926
+ switch (tag >>> 3) {
927
+ case 1: {
928
+ if (tag !== 10)
929
+ break;
930
+ message.id = reader.string();
931
+ continue;
932
+ }
933
+ default:
934
+ break;
935
+ }
936
+ if ((tag & 7) === 4 || tag === 0) {
937
+ break;
938
+ }
939
+ {
940
+ if (!writer)
941
+ writer = new BinaryWriter();
942
+ const skipped = reader.skip(tag & 7, tag >>> 3);
943
+ writer.uint32(tag).raw(skipped);
944
+ }
945
+ }
946
+ if (writer) {
947
+ message[unknownFieldsSymbol] = writer.finish();
948
+ }
949
+ return message;
950
+ },
951
+ fromJSON(object) {
952
+ return applyGetDiskSnapshotRequestCustom({
953
+ $type: "nebius.compute.v1.GetDiskSnapshotRequest",
954
+ id: isSet(object.id ?? object.id)
955
+ ? String(object.id ?? object.id)
956
+ : "",
957
+ });
958
+ },
959
+ toJSON(message, use = "json") {
960
+ const obj = {};
961
+ const pick = (json, pb) => (use === "json" ? json : pb);
962
+ if (message.id !== "") {
963
+ obj[pick("id", "id")] = message.id;
964
+ }
965
+ return obj;
966
+ },
967
+ create(base) {
968
+ return GetDiskSnapshotRequest.fromPartial(base ?? {});
969
+ },
970
+ fromPartial(object) {
971
+ const message = createBaseGetDiskSnapshotRequest();
972
+ message.id = (object.id !== undefined && object.id !== null)
973
+ ? object.id
974
+ : "";
975
+ return message;
976
+ },
977
+ };
978
+ protoRegistry.registerMessage(GetDiskSnapshotRequest);
979
+ function GetDiskSnapshotRequestCustomInspect() {
980
+ const parts = [];
981
+ if (this.id !== "")
982
+ parts.push("id" + "=" + inspect(this.id));
983
+ return `${this.$type}(${parts.join(", ")})`;
984
+ }
985
+ function GetDiskSnapshotRequestCustomJson() {
986
+ const obj = {
987
+ type: this.$type,
988
+ };
989
+ if (this.id !== "")
990
+ obj.id = inspectJson(this.id);
991
+ return obj;
992
+ }
993
+ function applyGetDiskSnapshotRequestCustom(message) {
994
+ message[custom] = GetDiskSnapshotRequestCustomInspect;
995
+ message[customJson] = GetDiskSnapshotRequestCustomJson;
996
+ return message;
997
+ }
998
+ function createBaseGetDiskSnapshotRequest() {
999
+ const message = {
1000
+ $type: "nebius.compute.v1.GetDiskSnapshotRequest",
1001
+ id: "",
1002
+ };
1003
+ return applyGetDiskSnapshotRequestCustom(message);
1004
+ }
1005
+ export const ListDiskSnapshotsRequest = {
1006
+ $type: "nebius.compute.v1.ListDiskSnapshotsRequest",
1007
+ encode(message, writer = new BinaryWriter()) {
1008
+ if (message.parentId !== "") {
1009
+ writer.uint32(10).string(message.parentId);
1010
+ }
1011
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
1012
+ writer.uint32(16).int64(message.pageSize.toString());
1013
+ }
1014
+ if (message.pageToken !== "") {
1015
+ writer.uint32(26).string(message.pageToken);
1016
+ }
1017
+ if (message[unknownFieldsSymbol]) {
1018
+ writer.raw(message[unknownFieldsSymbol]);
1019
+ }
1020
+ return writer;
1021
+ },
1022
+ decode(input, length) {
1023
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1024
+ const end = length === undefined ? reader.len : reader.pos + length;
1025
+ const message = createBaseListDiskSnapshotsRequest();
1026
+ let writer = undefined;
1027
+ while (reader.pos < end) {
1028
+ const tag = reader.uint32();
1029
+ switch (tag >>> 3) {
1030
+ case 1: {
1031
+ if (tag !== 10)
1032
+ break;
1033
+ message.parentId = reader.string();
1034
+ continue;
1035
+ }
1036
+ case 2: {
1037
+ if (tag !== 16)
1038
+ break;
1039
+ message.pageSize = Long.fromValue(reader.int64());
1040
+ continue;
1041
+ }
1042
+ case 3: {
1043
+ if (tag !== 26)
1044
+ break;
1045
+ message.pageToken = reader.string();
1046
+ continue;
1047
+ }
1048
+ default:
1049
+ break;
1050
+ }
1051
+ if ((tag & 7) === 4 || tag === 0) {
1052
+ break;
1053
+ }
1054
+ {
1055
+ if (!writer)
1056
+ writer = new BinaryWriter();
1057
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1058
+ writer.uint32(tag).raw(skipped);
1059
+ }
1060
+ }
1061
+ if (writer) {
1062
+ message[unknownFieldsSymbol] = writer.finish();
1063
+ }
1064
+ return message;
1065
+ },
1066
+ fromJSON(object) {
1067
+ return applyListDiskSnapshotsRequestCustom({
1068
+ $type: "nebius.compute.v1.ListDiskSnapshotsRequest",
1069
+ parentId: isSet(object.parentId ?? object.parent_id)
1070
+ ? String(object.parentId ?? object.parent_id)
1071
+ : "",
1072
+ pageSize: isSet(object.pageSize ?? object.page_size)
1073
+ ? Long.fromValue(object.pageSize ?? object.page_size)
1074
+ : Long.ZERO,
1075
+ pageToken: isSet(object.pageToken ?? object.page_token)
1076
+ ? String(object.pageToken ?? object.page_token)
1077
+ : "",
1078
+ });
1079
+ },
1080
+ toJSON(message, use = "json") {
1081
+ const obj = {};
1082
+ const pick = (json, pb) => (use === "json" ? json : pb);
1083
+ if (message.parentId !== "") {
1084
+ obj[pick("parentId", "parent_id")] = message.parentId;
1085
+ }
1086
+ if (!message.pageSize?.isZero?.()) {
1087
+ obj[pick("pageSize", "page_size")] = (message.pageSize || Long.ZERO).toString();
1088
+ }
1089
+ if (message.pageToken !== "") {
1090
+ obj[pick("pageToken", "page_token")] = message.pageToken;
1091
+ }
1092
+ return obj;
1093
+ },
1094
+ create(base) {
1095
+ return ListDiskSnapshotsRequest.fromPartial(base ?? {});
1096
+ },
1097
+ fromPartial(object) {
1098
+ const message = createBaseListDiskSnapshotsRequest();
1099
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
1100
+ ? object.parentId
1101
+ : "";
1102
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
1103
+ ? Long.fromValue(object.pageSize)
1104
+ : Long.ZERO;
1105
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
1106
+ ? object.pageToken
1107
+ : "";
1108
+ return message;
1109
+ },
1110
+ };
1111
+ protoRegistry.registerMessage(ListDiskSnapshotsRequest);
1112
+ function ListDiskSnapshotsRequestCustomInspect() {
1113
+ const parts = [];
1114
+ if (this.parentId !== "")
1115
+ parts.push("parentId" + "=" + inspect(this.parentId));
1116
+ if (!this.pageSize?.isZero?.())
1117
+ parts.push("pageSize" + "=" + inspect(this.pageSize));
1118
+ if (this.pageToken !== "")
1119
+ parts.push("pageToken" + "=" + inspect(this.pageToken));
1120
+ return `${this.$type}(${parts.join(", ")})`;
1121
+ }
1122
+ function ListDiskSnapshotsRequestCustomJson() {
1123
+ const obj = {
1124
+ type: this.$type,
1125
+ };
1126
+ if (this.parentId !== "")
1127
+ obj.parentId = inspectJson(this.parentId);
1128
+ if (!this.pageSize?.isZero?.())
1129
+ obj.pageSize = inspectJson(this.pageSize);
1130
+ if (this.pageToken !== "")
1131
+ obj.pageToken = inspectJson(this.pageToken);
1132
+ return obj;
1133
+ }
1134
+ function applyListDiskSnapshotsRequestCustom(message) {
1135
+ message[custom] = ListDiskSnapshotsRequestCustomInspect;
1136
+ message[customJson] = ListDiskSnapshotsRequestCustomJson;
1137
+ return message;
1138
+ }
1139
+ function createBaseListDiskSnapshotsRequest() {
1140
+ const message = {
1141
+ $type: "nebius.compute.v1.ListDiskSnapshotsRequest",
1142
+ parentId: "",
1143
+ pageSize: Long.ZERO,
1144
+ pageToken: "",
1145
+ };
1146
+ return applyListDiskSnapshotsRequestCustom(message);
1147
+ }
1148
+ export const ListDiskSnapshotsResponse = {
1149
+ $type: "nebius.compute.v1.ListDiskSnapshotsResponse",
1150
+ encode(message, writer = new BinaryWriter()) {
1151
+ for (const v of (message.items ?? [])) {
1152
+ const w = writer.uint32(10).fork();
1153
+ DiskSnapshot.encode(v, w);
1154
+ w.join();
1155
+ }
1156
+ if (message.nextPageToken !== "") {
1157
+ writer.uint32(18).string(message.nextPageToken);
1158
+ }
1159
+ if (message[unknownFieldsSymbol]) {
1160
+ writer.raw(message[unknownFieldsSymbol]);
1161
+ }
1162
+ return writer;
1163
+ },
1164
+ decode(input, length) {
1165
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1166
+ const end = length === undefined ? reader.len : reader.pos + length;
1167
+ const message = createBaseListDiskSnapshotsResponse();
1168
+ let writer = undefined;
1169
+ while (reader.pos < end) {
1170
+ const tag = reader.uint32();
1171
+ switch (tag >>> 3) {
1172
+ case 1: {
1173
+ if (tag !== 10)
1174
+ break;
1175
+ message.items.push(DiskSnapshot.decode(reader, reader.uint32()));
1176
+ continue;
1177
+ }
1178
+ case 2: {
1179
+ if (tag !== 18)
1180
+ break;
1181
+ message.nextPageToken = reader.string();
1182
+ continue;
1183
+ }
1184
+ default:
1185
+ break;
1186
+ }
1187
+ if ((tag & 7) === 4 || tag === 0) {
1188
+ break;
1189
+ }
1190
+ {
1191
+ if (!writer)
1192
+ writer = new BinaryWriter();
1193
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1194
+ writer.uint32(tag).raw(skipped);
1195
+ }
1196
+ }
1197
+ if (writer) {
1198
+ message[unknownFieldsSymbol] = writer.finish();
1199
+ }
1200
+ return message;
1201
+ },
1202
+ fromJSON(object) {
1203
+ return applyListDiskSnapshotsResponseCustom({
1204
+ $type: "nebius.compute.v1.ListDiskSnapshotsResponse",
1205
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
1206
+ ? (object.items ?? object.items).map((e) => DiskSnapshot.fromJSON(e))
1207
+ : [],
1208
+ nextPageToken: isSet(object.nextPageToken ?? object.next_page_token)
1209
+ ? String(object.nextPageToken ?? object.next_page_token)
1210
+ : "",
1211
+ });
1212
+ },
1213
+ toJSON(message, use = "json") {
1214
+ const obj = {};
1215
+ const pick = (json, pb) => (use === "json" ? json : pb);
1216
+ if (message.items?.length) {
1217
+ obj[pick("items", "items")] = message.items.map((e) => e ? DiskSnapshot.toJSON(e, use) : undefined);
1218
+ }
1219
+ if (message.nextPageToken !== "") {
1220
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
1221
+ }
1222
+ return obj;
1223
+ },
1224
+ create(base) {
1225
+ return ListDiskSnapshotsResponse.fromPartial(base ?? {});
1226
+ },
1227
+ fromPartial(object) {
1228
+ const message = createBaseListDiskSnapshotsResponse();
1229
+ message.items = object.items?.map((e) => DiskSnapshot.fromPartial(e)) || [];
1230
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
1231
+ ? object.nextPageToken
1232
+ : "";
1233
+ return message;
1234
+ },
1235
+ };
1236
+ protoRegistry.registerMessage(ListDiskSnapshotsResponse);
1237
+ function ListDiskSnapshotsResponseCustomInspect() {
1238
+ const parts = [];
1239
+ if ((this.items?.length ?? 0) !== 0)
1240
+ parts.push("items" + "=" + inspect(this.items));
1241
+ if (this.nextPageToken !== "")
1242
+ parts.push("nextPageToken" + "=" + inspect(this.nextPageToken));
1243
+ return `${this.$type}(${parts.join(", ")})`;
1244
+ }
1245
+ function ListDiskSnapshotsResponseCustomJson() {
1246
+ const obj = {
1247
+ type: this.$type,
1248
+ };
1249
+ if ((this.items?.length ?? 0) !== 0)
1250
+ obj.items = inspectJson(this.items);
1251
+ if (this.nextPageToken !== "")
1252
+ obj.nextPageToken = inspectJson(this.nextPageToken);
1253
+ return obj;
1254
+ }
1255
+ function applyListDiskSnapshotsResponseCustom(message) {
1256
+ message[custom] = ListDiskSnapshotsResponseCustomInspect;
1257
+ message[customJson] = ListDiskSnapshotsResponseCustomJson;
1258
+ return message;
1259
+ }
1260
+ function createBaseListDiskSnapshotsResponse() {
1261
+ const message = {
1262
+ $type: "nebius.compute.v1.ListDiskSnapshotsResponse",
1263
+ items: [],
1264
+ nextPageToken: "",
1265
+ };
1266
+ return applyListDiskSnapshotsResponseCustom(message);
1267
+ }
1268
+ export const ListDiskSnapshotsByDiskRequest = {
1269
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskRequest",
1270
+ encode(message, writer = new BinaryWriter()) {
1271
+ if (message.diskId !== "") {
1272
+ writer.uint32(10).string(message.diskId);
1273
+ }
1274
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
1275
+ writer.uint32(16).int64(message.pageSize.toString());
1276
+ }
1277
+ if (message.pageToken !== "") {
1278
+ writer.uint32(26).string(message.pageToken);
1279
+ }
1280
+ if (message[unknownFieldsSymbol]) {
1281
+ writer.raw(message[unknownFieldsSymbol]);
1282
+ }
1283
+ return writer;
1284
+ },
1285
+ decode(input, length) {
1286
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1287
+ const end = length === undefined ? reader.len : reader.pos + length;
1288
+ const message = createBaseListDiskSnapshotsByDiskRequest();
1289
+ let writer = undefined;
1290
+ while (reader.pos < end) {
1291
+ const tag = reader.uint32();
1292
+ switch (tag >>> 3) {
1293
+ case 1: {
1294
+ if (tag !== 10)
1295
+ break;
1296
+ message.diskId = reader.string();
1297
+ continue;
1298
+ }
1299
+ case 2: {
1300
+ if (tag !== 16)
1301
+ break;
1302
+ message.pageSize = Long.fromValue(reader.int64());
1303
+ continue;
1304
+ }
1305
+ case 3: {
1306
+ if (tag !== 26)
1307
+ break;
1308
+ message.pageToken = reader.string();
1309
+ continue;
1310
+ }
1311
+ default:
1312
+ break;
1313
+ }
1314
+ if ((tag & 7) === 4 || tag === 0) {
1315
+ break;
1316
+ }
1317
+ {
1318
+ if (!writer)
1319
+ writer = new BinaryWriter();
1320
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1321
+ writer.uint32(tag).raw(skipped);
1322
+ }
1323
+ }
1324
+ if (writer) {
1325
+ message[unknownFieldsSymbol] = writer.finish();
1326
+ }
1327
+ return message;
1328
+ },
1329
+ fromJSON(object) {
1330
+ return applyListDiskSnapshotsByDiskRequestCustom({
1331
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskRequest",
1332
+ diskId: isSet(object.diskId ?? object.disk_id)
1333
+ ? String(object.diskId ?? object.disk_id)
1334
+ : "",
1335
+ pageSize: isSet(object.pageSize ?? object.page_size)
1336
+ ? Long.fromValue(object.pageSize ?? object.page_size)
1337
+ : Long.ZERO,
1338
+ pageToken: isSet(object.pageToken ?? object.page_token)
1339
+ ? String(object.pageToken ?? object.page_token)
1340
+ : "",
1341
+ });
1342
+ },
1343
+ toJSON(message, use = "json") {
1344
+ const obj = {};
1345
+ const pick = (json, pb) => (use === "json" ? json : pb);
1346
+ if (message.diskId !== "") {
1347
+ obj[pick("diskId", "disk_id")] = message.diskId;
1348
+ }
1349
+ if (!message.pageSize?.isZero?.()) {
1350
+ obj[pick("pageSize", "page_size")] = (message.pageSize || Long.ZERO).toString();
1351
+ }
1352
+ if (message.pageToken !== "") {
1353
+ obj[pick("pageToken", "page_token")] = message.pageToken;
1354
+ }
1355
+ return obj;
1356
+ },
1357
+ create(base) {
1358
+ return ListDiskSnapshotsByDiskRequest.fromPartial(base ?? {});
1359
+ },
1360
+ fromPartial(object) {
1361
+ const message = createBaseListDiskSnapshotsByDiskRequest();
1362
+ message.diskId = (object.diskId !== undefined && object.diskId !== null)
1363
+ ? object.diskId
1364
+ : "";
1365
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
1366
+ ? Long.fromValue(object.pageSize)
1367
+ : Long.ZERO;
1368
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
1369
+ ? object.pageToken
1370
+ : "";
1371
+ return message;
1372
+ },
1373
+ };
1374
+ protoRegistry.registerMessage(ListDiskSnapshotsByDiskRequest);
1375
+ function ListDiskSnapshotsByDiskRequestCustomInspect() {
1376
+ const parts = [];
1377
+ if (this.diskId !== "")
1378
+ parts.push("diskId" + "=" + inspect(this.diskId));
1379
+ if (!this.pageSize?.isZero?.())
1380
+ parts.push("pageSize" + "=" + inspect(this.pageSize));
1381
+ if (this.pageToken !== "")
1382
+ parts.push("pageToken" + "=" + inspect(this.pageToken));
1383
+ return `${this.$type}(${parts.join(", ")})`;
1384
+ }
1385
+ function ListDiskSnapshotsByDiskRequestCustomJson() {
1386
+ const obj = {
1387
+ type: this.$type,
1388
+ };
1389
+ if (this.diskId !== "")
1390
+ obj.diskId = inspectJson(this.diskId);
1391
+ if (!this.pageSize?.isZero?.())
1392
+ obj.pageSize = inspectJson(this.pageSize);
1393
+ if (this.pageToken !== "")
1394
+ obj.pageToken = inspectJson(this.pageToken);
1395
+ return obj;
1396
+ }
1397
+ function applyListDiskSnapshotsByDiskRequestCustom(message) {
1398
+ message[custom] = ListDiskSnapshotsByDiskRequestCustomInspect;
1399
+ message[customJson] = ListDiskSnapshotsByDiskRequestCustomJson;
1400
+ return message;
1401
+ }
1402
+ function createBaseListDiskSnapshotsByDiskRequest() {
1403
+ const message = {
1404
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskRequest",
1405
+ diskId: "",
1406
+ pageSize: Long.ZERO,
1407
+ pageToken: "",
1408
+ };
1409
+ return applyListDiskSnapshotsByDiskRequestCustom(message);
1410
+ }
1411
+ export const ListDiskSnapshotsByDiskResponse = {
1412
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskResponse",
1413
+ encode(message, writer = new BinaryWriter()) {
1414
+ for (const v of (message.items ?? [])) {
1415
+ const w = writer.uint32(10).fork();
1416
+ DiskSnapshot.encode(v, w);
1417
+ w.join();
1418
+ }
1419
+ if (message.nextPageToken !== "") {
1420
+ writer.uint32(18).string(message.nextPageToken);
1421
+ }
1422
+ if (message[unknownFieldsSymbol]) {
1423
+ writer.raw(message[unknownFieldsSymbol]);
1424
+ }
1425
+ return writer;
1426
+ },
1427
+ decode(input, length) {
1428
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1429
+ const end = length === undefined ? reader.len : reader.pos + length;
1430
+ const message = createBaseListDiskSnapshotsByDiskResponse();
1431
+ let writer = undefined;
1432
+ while (reader.pos < end) {
1433
+ const tag = reader.uint32();
1434
+ switch (tag >>> 3) {
1435
+ case 1: {
1436
+ if (tag !== 10)
1437
+ break;
1438
+ message.items.push(DiskSnapshot.decode(reader, reader.uint32()));
1439
+ continue;
1440
+ }
1441
+ case 2: {
1442
+ if (tag !== 18)
1443
+ break;
1444
+ message.nextPageToken = reader.string();
1445
+ continue;
1446
+ }
1447
+ default:
1448
+ break;
1449
+ }
1450
+ if ((tag & 7) === 4 || tag === 0) {
1451
+ break;
1452
+ }
1453
+ {
1454
+ if (!writer)
1455
+ writer = new BinaryWriter();
1456
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1457
+ writer.uint32(tag).raw(skipped);
1458
+ }
1459
+ }
1460
+ if (writer) {
1461
+ message[unknownFieldsSymbol] = writer.finish();
1462
+ }
1463
+ return message;
1464
+ },
1465
+ fromJSON(object) {
1466
+ return applyListDiskSnapshotsByDiskResponseCustom({
1467
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskResponse",
1468
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
1469
+ ? (object.items ?? object.items).map((e) => DiskSnapshot.fromJSON(e))
1470
+ : [],
1471
+ nextPageToken: isSet(object.nextPageToken ?? object.next_page_token)
1472
+ ? String(object.nextPageToken ?? object.next_page_token)
1473
+ : "",
1474
+ });
1475
+ },
1476
+ toJSON(message, use = "json") {
1477
+ const obj = {};
1478
+ const pick = (json, pb) => (use === "json" ? json : pb);
1479
+ if (message.items?.length) {
1480
+ obj[pick("items", "items")] = message.items.map((e) => e ? DiskSnapshot.toJSON(e, use) : undefined);
1481
+ }
1482
+ if (message.nextPageToken !== "") {
1483
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
1484
+ }
1485
+ return obj;
1486
+ },
1487
+ create(base) {
1488
+ return ListDiskSnapshotsByDiskResponse.fromPartial(base ?? {});
1489
+ },
1490
+ fromPartial(object) {
1491
+ const message = createBaseListDiskSnapshotsByDiskResponse();
1492
+ message.items = object.items?.map((e) => DiskSnapshot.fromPartial(e)) || [];
1493
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
1494
+ ? object.nextPageToken
1495
+ : "";
1496
+ return message;
1497
+ },
1498
+ };
1499
+ protoRegistry.registerMessage(ListDiskSnapshotsByDiskResponse);
1500
+ function ListDiskSnapshotsByDiskResponseCustomInspect() {
1501
+ const parts = [];
1502
+ if ((this.items?.length ?? 0) !== 0)
1503
+ parts.push("items" + "=" + inspect(this.items));
1504
+ if (this.nextPageToken !== "")
1505
+ parts.push("nextPageToken" + "=" + inspect(this.nextPageToken));
1506
+ return `${this.$type}(${parts.join(", ")})`;
1507
+ }
1508
+ function ListDiskSnapshotsByDiskResponseCustomJson() {
1509
+ const obj = {
1510
+ type: this.$type,
1511
+ };
1512
+ if ((this.items?.length ?? 0) !== 0)
1513
+ obj.items = inspectJson(this.items);
1514
+ if (this.nextPageToken !== "")
1515
+ obj.nextPageToken = inspectJson(this.nextPageToken);
1516
+ return obj;
1517
+ }
1518
+ function applyListDiskSnapshotsByDiskResponseCustom(message) {
1519
+ message[custom] = ListDiskSnapshotsByDiskResponseCustomInspect;
1520
+ message[customJson] = ListDiskSnapshotsByDiskResponseCustomJson;
1521
+ return message;
1522
+ }
1523
+ function createBaseListDiskSnapshotsByDiskResponse() {
1524
+ const message = {
1525
+ $type: "nebius.compute.v1.ListDiskSnapshotsByDiskResponse",
1526
+ items: [],
1527
+ nextPageToken: "",
1528
+ };
1529
+ return applyListDiskSnapshotsByDiskResponseCustom(message);
1530
+ }
1531
+ export const CreateDiskSnapshotRequest = {
1532
+ $type: "nebius.compute.v1.CreateDiskSnapshotRequest",
1533
+ encode(message, writer = new BinaryWriter()) {
1534
+ if (message.metadata !== undefined) {
1535
+ const w = writer.uint32(10).fork();
1536
+ ResourceMetadata.encode(message.metadata, w);
1537
+ w.join();
1538
+ }
1539
+ if (message.spec !== undefined) {
1540
+ const w = writer.uint32(18).fork();
1541
+ DiskSnapshotSpec.encode(message.spec, w);
1542
+ w.join();
1543
+ }
1544
+ if (message[unknownFieldsSymbol]) {
1545
+ writer.raw(message[unknownFieldsSymbol]);
1546
+ }
1547
+ return writer;
1548
+ },
1549
+ decode(input, length) {
1550
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1551
+ const end = length === undefined ? reader.len : reader.pos + length;
1552
+ const message = createBaseCreateDiskSnapshotRequest();
1553
+ let writer = undefined;
1554
+ while (reader.pos < end) {
1555
+ const tag = reader.uint32();
1556
+ switch (tag >>> 3) {
1557
+ case 1: {
1558
+ if (tag !== 10)
1559
+ break;
1560
+ message.metadata = ResourceMetadata.decode(reader, reader.uint32());
1561
+ continue;
1562
+ }
1563
+ case 2: {
1564
+ if (tag !== 18)
1565
+ break;
1566
+ message.spec = DiskSnapshotSpec.decode(reader, reader.uint32());
1567
+ continue;
1568
+ }
1569
+ default:
1570
+ break;
1571
+ }
1572
+ if ((tag & 7) === 4 || tag === 0) {
1573
+ break;
1574
+ }
1575
+ {
1576
+ if (!writer)
1577
+ writer = new BinaryWriter();
1578
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1579
+ writer.uint32(tag).raw(skipped);
1580
+ }
1581
+ }
1582
+ if (writer) {
1583
+ message[unknownFieldsSymbol] = writer.finish();
1584
+ }
1585
+ return message;
1586
+ },
1587
+ fromJSON(object) {
1588
+ return applyCreateDiskSnapshotRequestCustom({
1589
+ $type: "nebius.compute.v1.CreateDiskSnapshotRequest",
1590
+ metadata: isSet(object.metadata ?? object.metadata)
1591
+ ? ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
1592
+ : undefined,
1593
+ spec: isSet(object.spec ?? object.spec)
1594
+ ? DiskSnapshotSpec.fromJSON(object.spec ?? object.spec)
1595
+ : undefined,
1596
+ });
1597
+ },
1598
+ toJSON(message, use = "json") {
1599
+ const obj = {};
1600
+ const pick = (json, pb) => (use === "json" ? json : pb);
1601
+ if (message.metadata !== undefined) {
1602
+ obj[pick("metadata", "metadata")] = message.metadata
1603
+ ? ResourceMetadata.toJSON(message.metadata, use)
1604
+ : undefined;
1605
+ }
1606
+ if (message.spec !== undefined) {
1607
+ obj[pick("spec", "spec")] = message.spec
1608
+ ? DiskSnapshotSpec.toJSON(message.spec, use)
1609
+ : undefined;
1610
+ }
1611
+ return obj;
1612
+ },
1613
+ create(base) {
1614
+ return CreateDiskSnapshotRequest.fromPartial(base ?? {});
1615
+ },
1616
+ fromPartial(object) {
1617
+ const message = createBaseCreateDiskSnapshotRequest();
1618
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
1619
+ ? ResourceMetadata.fromPartial(object.metadata)
1620
+ : undefined;
1621
+ message.spec = (object.spec !== undefined && object.spec !== null)
1622
+ ? DiskSnapshotSpec.fromPartial(object.spec)
1623
+ : undefined;
1624
+ return message;
1625
+ },
1626
+ };
1627
+ protoRegistry.registerMessage(CreateDiskSnapshotRequest);
1628
+ function CreateDiskSnapshotRequestCustomInspect() {
1629
+ const parts = [];
1630
+ if (this.metadata !== undefined)
1631
+ parts.push("metadata" + "=" + inspect(this.metadata));
1632
+ if (this.spec !== undefined)
1633
+ parts.push("spec" + "=" + inspect(this.spec));
1634
+ return `${this.$type}(${parts.join(", ")})`;
1635
+ }
1636
+ function CreateDiskSnapshotRequestCustomJson() {
1637
+ const obj = {
1638
+ type: this.$type,
1639
+ };
1640
+ if (this.metadata !== undefined)
1641
+ obj.metadata = inspectJson(this.metadata);
1642
+ if (this.spec !== undefined)
1643
+ obj.spec = inspectJson(this.spec);
1644
+ return obj;
1645
+ }
1646
+ function applyCreateDiskSnapshotRequestCustom(message) {
1647
+ message[custom] = CreateDiskSnapshotRequestCustomInspect;
1648
+ message[customJson] = CreateDiskSnapshotRequestCustomJson;
1649
+ return message;
1650
+ }
1651
+ function createBaseCreateDiskSnapshotRequest() {
1652
+ const message = {
1653
+ $type: "nebius.compute.v1.CreateDiskSnapshotRequest",
1654
+ metadata: undefined,
1655
+ spec: undefined,
1656
+ };
1657
+ return applyCreateDiskSnapshotRequestCustom(message);
1658
+ }
1659
+ export const UpdateDiskSnapshotRequest = {
1660
+ $type: "nebius.compute.v1.UpdateDiskSnapshotRequest",
1661
+ encode(message, writer = new BinaryWriter()) {
1662
+ if (message.metadata !== undefined) {
1663
+ const w = writer.uint32(10).fork();
1664
+ ResourceMetadata.encode(message.metadata, w);
1665
+ w.join();
1666
+ }
1667
+ if (message.spec !== undefined) {
1668
+ const w = writer.uint32(18).fork();
1669
+ DiskSnapshotSpec.encode(message.spec, w);
1670
+ w.join();
1671
+ }
1672
+ if (message[unknownFieldsSymbol]) {
1673
+ writer.raw(message[unknownFieldsSymbol]);
1674
+ }
1675
+ return writer;
1676
+ },
1677
+ decode(input, length) {
1678
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1679
+ const end = length === undefined ? reader.len : reader.pos + length;
1680
+ const message = createBaseUpdateDiskSnapshotRequest();
1681
+ let writer = undefined;
1682
+ while (reader.pos < end) {
1683
+ const tag = reader.uint32();
1684
+ switch (tag >>> 3) {
1685
+ case 1: {
1686
+ if (tag !== 10)
1687
+ break;
1688
+ message.metadata = ResourceMetadata.decode(reader, reader.uint32());
1689
+ continue;
1690
+ }
1691
+ case 2: {
1692
+ if (tag !== 18)
1693
+ break;
1694
+ message.spec = DiskSnapshotSpec.decode(reader, reader.uint32());
1695
+ continue;
1696
+ }
1697
+ default:
1698
+ break;
1699
+ }
1700
+ if ((tag & 7) === 4 || tag === 0) {
1701
+ break;
1702
+ }
1703
+ {
1704
+ if (!writer)
1705
+ writer = new BinaryWriter();
1706
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1707
+ writer.uint32(tag).raw(skipped);
1708
+ }
1709
+ }
1710
+ if (writer) {
1711
+ message[unknownFieldsSymbol] = writer.finish();
1712
+ }
1713
+ return message;
1714
+ },
1715
+ fromJSON(object) {
1716
+ return applyUpdateDiskSnapshotRequestCustom({
1717
+ $type: "nebius.compute.v1.UpdateDiskSnapshotRequest",
1718
+ metadata: isSet(object.metadata ?? object.metadata)
1719
+ ? ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
1720
+ : undefined,
1721
+ spec: isSet(object.spec ?? object.spec)
1722
+ ? DiskSnapshotSpec.fromJSON(object.spec ?? object.spec)
1723
+ : undefined,
1724
+ });
1725
+ },
1726
+ toJSON(message, use = "json") {
1727
+ const obj = {};
1728
+ const pick = (json, pb) => (use === "json" ? json : pb);
1729
+ if (message.metadata !== undefined) {
1730
+ obj[pick("metadata", "metadata")] = message.metadata
1731
+ ? ResourceMetadata.toJSON(message.metadata, use)
1732
+ : undefined;
1733
+ }
1734
+ if (message.spec !== undefined) {
1735
+ obj[pick("spec", "spec")] = message.spec
1736
+ ? DiskSnapshotSpec.toJSON(message.spec, use)
1737
+ : undefined;
1738
+ }
1739
+ return obj;
1740
+ },
1741
+ create(base) {
1742
+ return UpdateDiskSnapshotRequest.fromPartial(base ?? {});
1743
+ },
1744
+ fromPartial(object) {
1745
+ const message = createBaseUpdateDiskSnapshotRequest();
1746
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
1747
+ ? ResourceMetadata.fromPartial(object.metadata)
1748
+ : undefined;
1749
+ message.spec = (object.spec !== undefined && object.spec !== null)
1750
+ ? DiskSnapshotSpec.fromPartial(object.spec)
1751
+ : undefined;
1752
+ return message;
1753
+ },
1754
+ };
1755
+ protoRegistry.registerMessage(UpdateDiskSnapshotRequest);
1756
+ function UpdateDiskSnapshotRequestCustomInspect() {
1757
+ const parts = [];
1758
+ if (this.metadata !== undefined)
1759
+ parts.push("metadata" + "=" + inspect(this.metadata));
1760
+ if (this.spec !== undefined)
1761
+ parts.push("spec" + "=" + inspect(this.spec));
1762
+ return `${this.$type}(${parts.join(", ")})`;
1763
+ }
1764
+ function UpdateDiskSnapshotRequestCustomJson() {
1765
+ const obj = {
1766
+ type: this.$type,
1767
+ };
1768
+ if (this.metadata !== undefined)
1769
+ obj.metadata = inspectJson(this.metadata);
1770
+ if (this.spec !== undefined)
1771
+ obj.spec = inspectJson(this.spec);
1772
+ return obj;
1773
+ }
1774
+ function applyUpdateDiskSnapshotRequestCustom(message) {
1775
+ message[custom] = UpdateDiskSnapshotRequestCustomInspect;
1776
+ message[customJson] = UpdateDiskSnapshotRequestCustomJson;
1777
+ return message;
1778
+ }
1779
+ function createBaseUpdateDiskSnapshotRequest() {
1780
+ const message = {
1781
+ $type: "nebius.compute.v1.UpdateDiskSnapshotRequest",
1782
+ metadata: undefined,
1783
+ spec: undefined,
1784
+ };
1785
+ return applyUpdateDiskSnapshotRequestCustom(message);
1786
+ }
1787
+ export const DeleteDiskSnapshotRequest = {
1788
+ $type: "nebius.compute.v1.DeleteDiskSnapshotRequest",
1789
+ encode(message, writer = new BinaryWriter()) {
1790
+ if (message.id !== "") {
1791
+ writer.uint32(10).string(message.id);
1792
+ }
1793
+ if (message[unknownFieldsSymbol]) {
1794
+ writer.raw(message[unknownFieldsSymbol]);
1795
+ }
1796
+ return writer;
1797
+ },
1798
+ decode(input, length) {
1799
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1800
+ const end = length === undefined ? reader.len : reader.pos + length;
1801
+ const message = createBaseDeleteDiskSnapshotRequest();
1802
+ let writer = undefined;
1803
+ while (reader.pos < end) {
1804
+ const tag = reader.uint32();
1805
+ switch (tag >>> 3) {
1806
+ case 1: {
1807
+ if (tag !== 10)
1808
+ break;
1809
+ message.id = reader.string();
1810
+ continue;
1811
+ }
1812
+ default:
1813
+ break;
1814
+ }
1815
+ if ((tag & 7) === 4 || tag === 0) {
1816
+ break;
1817
+ }
1818
+ {
1819
+ if (!writer)
1820
+ writer = new BinaryWriter();
1821
+ const skipped = reader.skip(tag & 7, tag >>> 3);
1822
+ writer.uint32(tag).raw(skipped);
1823
+ }
1824
+ }
1825
+ if (writer) {
1826
+ message[unknownFieldsSymbol] = writer.finish();
1827
+ }
1828
+ return message;
1829
+ },
1830
+ fromJSON(object) {
1831
+ return applyDeleteDiskSnapshotRequestCustom({
1832
+ $type: "nebius.compute.v1.DeleteDiskSnapshotRequest",
1833
+ id: isSet(object.id ?? object.id)
1834
+ ? String(object.id ?? object.id)
1835
+ : "",
1836
+ });
1837
+ },
1838
+ toJSON(message, use = "json") {
1839
+ const obj = {};
1840
+ const pick = (json, pb) => (use === "json" ? json : pb);
1841
+ if (message.id !== "") {
1842
+ obj[pick("id", "id")] = message.id;
1843
+ }
1844
+ return obj;
1845
+ },
1846
+ create(base) {
1847
+ return DeleteDiskSnapshotRequest.fromPartial(base ?? {});
1848
+ },
1849
+ fromPartial(object) {
1850
+ const message = createBaseDeleteDiskSnapshotRequest();
1851
+ message.id = (object.id !== undefined && object.id !== null)
1852
+ ? object.id
1853
+ : "";
1854
+ return message;
1855
+ },
1856
+ };
1857
+ protoRegistry.registerMessage(DeleteDiskSnapshotRequest);
1858
+ function DeleteDiskSnapshotRequestCustomInspect() {
1859
+ const parts = [];
1860
+ if (this.id !== "")
1861
+ parts.push("id" + "=" + inspect(this.id));
1862
+ return `${this.$type}(${parts.join(", ")})`;
1863
+ }
1864
+ function DeleteDiskSnapshotRequestCustomJson() {
1865
+ const obj = {
1866
+ type: this.$type,
1867
+ };
1868
+ if (this.id !== "")
1869
+ obj.id = inspectJson(this.id);
1870
+ return obj;
1871
+ }
1872
+ function applyDeleteDiskSnapshotRequestCustom(message) {
1873
+ message[custom] = DeleteDiskSnapshotRequestCustomInspect;
1874
+ message[customJson] = DeleteDiskSnapshotRequestCustomJson;
1875
+ return message;
1876
+ }
1877
+ function createBaseDeleteDiskSnapshotRequest() {
1878
+ const message = {
1879
+ $type: "nebius.compute.v1.DeleteDiskSnapshotRequest",
1880
+ id: "",
1881
+ };
1882
+ return applyDeleteDiskSnapshotRequestCustom(message);
1883
+ }
1884
+ export const DiskSnapshotServiceServiceDescription = {
1885
+ get: {
1886
+ path: "/nebius.compute.v1.DiskSnapshotService/Get",
1887
+ requestStream: false,
1888
+ responseStream: false,
1889
+ requestSerialize: (value) => Buffer.from(GetDiskSnapshotRequest.encode(value).finish()),
1890
+ sendResetMask: false,
1891
+ requestDeserialize: (value) => GetDiskSnapshotRequest.decode(value),
1892
+ responseSerialize: (value) => Buffer.from(DiskSnapshot.encode(value).finish()),
1893
+ responseDeserialize: (value) => DiskSnapshot.decode(value),
1894
+ },
1895
+ getByName: {
1896
+ path: "/nebius.compute.v1.DiskSnapshotService/GetByName",
1897
+ requestStream: false,
1898
+ responseStream: false,
1899
+ requestSerialize: (value) => Buffer.from(GetByNameRequest.encode(value).finish()),
1900
+ sendResetMask: false,
1901
+ requestDeserialize: (value) => GetByNameRequest.decode(value),
1902
+ responseSerialize: (value) => Buffer.from(DiskSnapshot.encode(value).finish()),
1903
+ responseDeserialize: (value) => DiskSnapshot.decode(value),
1904
+ },
1905
+ list: {
1906
+ path: "/nebius.compute.v1.DiskSnapshotService/List",
1907
+ requestStream: false,
1908
+ responseStream: false,
1909
+ requestSerialize: (value) => Buffer.from(ListDiskSnapshotsRequest.encode(value).finish()),
1910
+ sendResetMask: false,
1911
+ requestDeserialize: (value) => ListDiskSnapshotsRequest.decode(value),
1912
+ responseSerialize: (value) => Buffer.from(ListDiskSnapshotsResponse.encode(value).finish()),
1913
+ responseDeserialize: (value) => ListDiskSnapshotsResponse.decode(value),
1914
+ },
1915
+ listByDisk: {
1916
+ path: "/nebius.compute.v1.DiskSnapshotService/ListByDisk",
1917
+ requestStream: false,
1918
+ responseStream: false,
1919
+ requestSerialize: (value) => Buffer.from(ListDiskSnapshotsByDiskRequest.encode(value).finish()),
1920
+ sendResetMask: false,
1921
+ requestDeserialize: (value) => ListDiskSnapshotsByDiskRequest.decode(value),
1922
+ responseSerialize: (value) => Buffer.from(ListDiskSnapshotsByDiskResponse.encode(value).finish()),
1923
+ responseDeserialize: (value) => ListDiskSnapshotsByDiskResponse.decode(value),
1924
+ },
1925
+ create: {
1926
+ path: "/nebius.compute.v1.DiskSnapshotService/Create",
1927
+ requestStream: false,
1928
+ responseStream: false,
1929
+ requestSerialize: (value) => Buffer.from(CreateDiskSnapshotRequest.encode(value).finish()),
1930
+ sendResetMask: false,
1931
+ requestDeserialize: (value) => CreateDiskSnapshotRequest.decode(value),
1932
+ responseSerialize: (value) => Buffer.from(Operation.encode(value).finish()),
1933
+ responseDeserialize: (value) => Operation.decode(value),
1934
+ },
1935
+ update: {
1936
+ path: "/nebius.compute.v1.DiskSnapshotService/Update",
1937
+ requestStream: false,
1938
+ responseStream: false,
1939
+ requestSerialize: (value) => Buffer.from(UpdateDiskSnapshotRequest.encode(value).finish()),
1940
+ sendResetMask: true,
1941
+ requestDeserialize: (value) => UpdateDiskSnapshotRequest.decode(value),
1942
+ responseSerialize: (value) => Buffer.from(Operation.encode(value).finish()),
1943
+ responseDeserialize: (value) => Operation.decode(value),
1944
+ },
1945
+ delete: {
1946
+ path: "/nebius.compute.v1.DiskSnapshotService/Delete",
1947
+ requestStream: false,
1948
+ responseStream: false,
1949
+ requestSerialize: (value) => Buffer.from(DeleteDiskSnapshotRequest.encode(value).finish()),
1950
+ sendResetMask: false,
1951
+ requestDeserialize: (value) => DeleteDiskSnapshotRequest.decode(value),
1952
+ responseSerialize: (value) => Buffer.from(Operation.encode(value).finish()),
1953
+ responseDeserialize: (value) => Operation.decode(value),
1954
+ },
1955
+ };
1956
+ export const DiskSnapshotServiceBaseClient = makeGenericClientConstructor(DiskSnapshotServiceServiceDescription, "nebius.compute.v1.DiskSnapshotService");
1957
+ export class DiskSnapshotService {
1958
+ sdk;
1959
+ $type = "nebius.compute.v1.DiskSnapshotService";
1960
+ addr;
1961
+ spec;
1962
+ apiServiceName = "compute";
1963
+ constructor(sdk) {
1964
+ this.sdk = sdk;
1965
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
1966
+ this.addr = addr;
1967
+ this.spec = DiskSnapshotServiceServiceDescription;
1968
+ }
1969
+ getOperationService() {
1970
+ return new OperationService(this.sdk, this.addr);
1971
+ }
1972
+ get(...args) {
1973
+ const spec = this.spec.get;
1974
+ const request = args[0];
1975
+ const metadata = (args.length > 1 ? args[1] : undefined);
1976
+ const options = (args.length > 2 ? args[2] : undefined);
1977
+ const deserialize = spec.responseDeserialize;
1978
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1979
+ }
1980
+ getByName(...args) {
1981
+ const spec = this.spec.getByName;
1982
+ const request = args[0];
1983
+ const metadata = (args.length > 1 ? args[1] : undefined);
1984
+ const options = (args.length > 2 ? args[2] : undefined);
1985
+ const deserialize = spec.responseDeserialize;
1986
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1987
+ }
1988
+ list(...args) {
1989
+ const spec = this.spec.list;
1990
+ const request = args[0];
1991
+ const metadata = (args.length > 1 ? args[1] : undefined);
1992
+ const options = (args.length > 2 ? args[2] : undefined);
1993
+ const deserialize = spec.responseDeserialize;
1994
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
1995
+ }
1996
+ listByDisk(...args) {
1997
+ const spec = this.spec.listByDisk;
1998
+ const request = args[0];
1999
+ const metadata = (args.length > 1 ? args[1] : undefined);
2000
+ const options = (args.length > 2 ? args[2] : undefined);
2001
+ const deserialize = spec.responseDeserialize;
2002
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2003
+ }
2004
+ create(...args) {
2005
+ const spec = this.spec.create;
2006
+ const request = args[0];
2007
+ const metadata = (args.length > 1 ? args[1] : undefined);
2008
+ const options = (args.length > 2 ? args[2] : undefined);
2009
+ const deserialize = (value) => {
2010
+ const resp = spec.responseDeserialize(value);
2011
+ return new OperationWrapper(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2012
+ };
2013
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2014
+ }
2015
+ update(...args) {
2016
+ const spec = this.spec.update;
2017
+ const request = args[0];
2018
+ const metadata = (args.length > 1 ? args[1] : undefined);
2019
+ const options = (args.length > 2 ? args[2] : undefined);
2020
+ const deserialize = (value) => {
2021
+ const resp = spec.responseDeserialize(value);
2022
+ return new OperationWrapper(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2023
+ };
2024
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2025
+ }
2026
+ delete(...args) {
2027
+ const spec = this.spec.delete;
2028
+ const request = args[0];
2029
+ const metadata = (args.length > 1 ? args[1] : undefined);
2030
+ const options = (args.length > 2 ? args[2] : undefined);
2031
+ const deserialize = (value) => {
2032
+ const resp = spec.responseDeserialize(value);
2033
+ return new OperationWrapper(resp, this.getOperationService(), this.sdk.logger.child("operation"));
2034
+ };
2035
+ return new SDKRequestClass(this.sdk, spec, this.addr, deserialize, request, metadata, options);
2036
+ }
2037
+ }
2038
+ export const DiskSnapshotStatus_State = createEnum("nebius.compute.v1.DiskSnapshotStatus.State", {
2039
+ UNSPECIFIED: 0,
2040
+ CREATING: 1,
2041
+ READY: 2,
2042
+ DELETING: 3,
2043
+ ERROR: 4,
2044
+ });
2045
+ protoRegistry.registerEnum(DiskSnapshotStatus_State);
2046
+ export const DiskSnapshotStatus_CPUArchitecture = createEnum("nebius.compute.v1.DiskSnapshotStatus.CPUArchitecture", {
2047
+ UNDEFINED: 0,
2048
+ AMD64: 1,
2049
+ ARM64: 2,
2050
+ });
2051
+ protoRegistry.registerEnum(DiskSnapshotStatus_CPUArchitecture);
2052
+ export const DiskSnapshot = {
2053
+ $type: "nebius.compute.v1.DiskSnapshot",
2054
+ encode(message, writer = new BinaryWriter()) {
2055
+ if (message.metadata !== undefined) {
2056
+ const w = writer.uint32(10).fork();
2057
+ ResourceMetadata.encode(message.metadata, w);
2058
+ w.join();
2059
+ }
2060
+ if (message.spec !== undefined) {
2061
+ const w = writer.uint32(18).fork();
2062
+ DiskSnapshotSpec.encode(message.spec, w);
2063
+ w.join();
2064
+ }
2065
+ if (message.status !== undefined) {
2066
+ const w = writer.uint32(26).fork();
2067
+ DiskSnapshotStatus.encode(message.status, w);
2068
+ w.join();
2069
+ }
2070
+ if (message[unknownFieldsSymbol]) {
2071
+ writer.raw(message[unknownFieldsSymbol]);
2072
+ }
2073
+ return writer;
2074
+ },
2075
+ decode(input, length) {
2076
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2077
+ const end = length === undefined ? reader.len : reader.pos + length;
2078
+ const message = createBaseDiskSnapshot();
2079
+ let writer = undefined;
2080
+ while (reader.pos < end) {
2081
+ const tag = reader.uint32();
2082
+ switch (tag >>> 3) {
2083
+ case 1: {
2084
+ if (tag !== 10)
2085
+ break;
2086
+ message.metadata = ResourceMetadata.decode(reader, reader.uint32());
2087
+ continue;
2088
+ }
2089
+ case 2: {
2090
+ if (tag !== 18)
2091
+ break;
2092
+ message.spec = DiskSnapshotSpec.decode(reader, reader.uint32());
2093
+ continue;
2094
+ }
2095
+ case 3: {
2096
+ if (tag !== 26)
2097
+ break;
2098
+ message.status = DiskSnapshotStatus.decode(reader, reader.uint32());
2099
+ continue;
2100
+ }
2101
+ default:
2102
+ break;
2103
+ }
2104
+ if ((tag & 7) === 4 || tag === 0) {
2105
+ break;
2106
+ }
2107
+ {
2108
+ if (!writer)
2109
+ writer = new BinaryWriter();
2110
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2111
+ writer.uint32(tag).raw(skipped);
2112
+ }
2113
+ }
2114
+ if (writer) {
2115
+ message[unknownFieldsSymbol] = writer.finish();
2116
+ }
2117
+ return message;
2118
+ },
2119
+ fromJSON(object) {
2120
+ return applyDiskSnapshotCustom({
2121
+ $type: "nebius.compute.v1.DiskSnapshot",
2122
+ metadata: isSet(object.metadata ?? object.metadata)
2123
+ ? ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
2124
+ : undefined,
2125
+ spec: isSet(object.spec ?? object.spec)
2126
+ ? DiskSnapshotSpec.fromJSON(object.spec ?? object.spec)
2127
+ : undefined,
2128
+ status: isSet(object.status ?? object.status)
2129
+ ? DiskSnapshotStatus.fromJSON(object.status ?? object.status)
2130
+ : undefined,
2131
+ });
2132
+ },
2133
+ toJSON(message, use = "json") {
2134
+ const obj = {};
2135
+ const pick = (json, pb) => (use === "json" ? json : pb);
2136
+ if (message.metadata !== undefined) {
2137
+ obj[pick("metadata", "metadata")] = message.metadata
2138
+ ? ResourceMetadata.toJSON(message.metadata, use)
2139
+ : undefined;
2140
+ }
2141
+ if (message.spec !== undefined) {
2142
+ obj[pick("spec", "spec")] = message.spec
2143
+ ? DiskSnapshotSpec.toJSON(message.spec, use)
2144
+ : undefined;
2145
+ }
2146
+ if (message.status !== undefined) {
2147
+ obj[pick("status", "status")] = message.status
2148
+ ? DiskSnapshotStatus.toJSON(message.status, use)
2149
+ : undefined;
2150
+ }
2151
+ return obj;
2152
+ },
2153
+ create(base) {
2154
+ return DiskSnapshot.fromPartial(base ?? {});
2155
+ },
2156
+ fromPartial(object) {
2157
+ const message = createBaseDiskSnapshot();
2158
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
2159
+ ? ResourceMetadata.fromPartial(object.metadata)
2160
+ : undefined;
2161
+ message.spec = (object.spec !== undefined && object.spec !== null)
2162
+ ? DiskSnapshotSpec.fromPartial(object.spec)
2163
+ : undefined;
2164
+ message.status = (object.status !== undefined && object.status !== null)
2165
+ ? DiskSnapshotStatus.fromPartial(object.status)
2166
+ : undefined;
2167
+ return message;
2168
+ },
2169
+ };
2170
+ protoRegistry.registerMessage(DiskSnapshot);
2171
+ function DiskSnapshotCustomInspect() {
2172
+ const parts = [];
2173
+ if (this.metadata !== undefined)
2174
+ parts.push("metadata" + "=" + inspect(this.metadata));
2175
+ if (this.spec !== undefined)
2176
+ parts.push("spec" + "=" + inspect(this.spec));
2177
+ if (this.status !== undefined)
2178
+ parts.push("status" + "=" + inspect(this.status));
2179
+ return `${this.$type}(${parts.join(", ")})`;
2180
+ }
2181
+ function DiskSnapshotCustomJson() {
2182
+ const obj = {
2183
+ type: this.$type,
2184
+ };
2185
+ if (this.metadata !== undefined)
2186
+ obj.metadata = inspectJson(this.metadata);
2187
+ if (this.spec !== undefined)
2188
+ obj.spec = inspectJson(this.spec);
2189
+ if (this.status !== undefined)
2190
+ obj.status = inspectJson(this.status);
2191
+ return obj;
2192
+ }
2193
+ function applyDiskSnapshotCustom(message) {
2194
+ message[custom] = DiskSnapshotCustomInspect;
2195
+ message[customJson] = DiskSnapshotCustomJson;
2196
+ return message;
2197
+ }
2198
+ function createBaseDiskSnapshot() {
2199
+ const message = {
2200
+ $type: "nebius.compute.v1.DiskSnapshot",
2201
+ metadata: undefined,
2202
+ spec: undefined,
2203
+ status: undefined,
2204
+ };
2205
+ return applyDiskSnapshotCustom(message);
2206
+ }
2207
+ export const DiskSnapshotSpec = {
2208
+ $type: "nebius.compute.v1.DiskSnapshotSpec",
2209
+ encode(message, writer = new BinaryWriter()) {
2210
+ if (message.sourceDiskId !== "") {
2211
+ writer.uint32(10).string(message.sourceDiskId);
2212
+ }
2213
+ if (message.description !== "") {
2214
+ writer.uint32(18).string(message.description);
2215
+ }
2216
+ if (message[unknownFieldsSymbol]) {
2217
+ writer.raw(message[unknownFieldsSymbol]);
2218
+ }
2219
+ return writer;
2220
+ },
2221
+ decode(input, length) {
2222
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2223
+ const end = length === undefined ? reader.len : reader.pos + length;
2224
+ const message = createBaseDiskSnapshotSpec();
2225
+ let writer = undefined;
2226
+ while (reader.pos < end) {
2227
+ const tag = reader.uint32();
2228
+ switch (tag >>> 3) {
2229
+ case 1: {
2230
+ if (tag !== 10)
2231
+ break;
2232
+ message.sourceDiskId = reader.string();
2233
+ continue;
2234
+ }
2235
+ case 2: {
2236
+ if (tag !== 18)
2237
+ break;
2238
+ message.description = reader.string();
2239
+ continue;
2240
+ }
2241
+ default:
2242
+ break;
2243
+ }
2244
+ if ((tag & 7) === 4 || tag === 0) {
2245
+ break;
2246
+ }
2247
+ {
2248
+ if (!writer)
2249
+ writer = new BinaryWriter();
2250
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2251
+ writer.uint32(tag).raw(skipped);
2252
+ }
2253
+ }
2254
+ if (writer) {
2255
+ message[unknownFieldsSymbol] = writer.finish();
2256
+ }
2257
+ return message;
2258
+ },
2259
+ fromJSON(object) {
2260
+ return applyDiskSnapshotSpecCustom({
2261
+ $type: "nebius.compute.v1.DiskSnapshotSpec",
2262
+ sourceDiskId: isSet(object.sourceDiskId ?? object.source_disk_id)
2263
+ ? String(object.sourceDiskId ?? object.source_disk_id)
2264
+ : "",
2265
+ description: isSet(object.description ?? object.description)
2266
+ ? String(object.description ?? object.description)
2267
+ : "",
2268
+ });
2269
+ },
2270
+ toJSON(message, use = "json") {
2271
+ const obj = {};
2272
+ const pick = (json, pb) => (use === "json" ? json : pb);
2273
+ if (message.sourceDiskId !== "") {
2274
+ obj[pick("sourceDiskId", "source_disk_id")] = message.sourceDiskId;
2275
+ }
2276
+ if (message.description !== "") {
2277
+ obj[pick("description", "description")] = message.description;
2278
+ }
2279
+ return obj;
2280
+ },
2281
+ create(base) {
2282
+ return DiskSnapshotSpec.fromPartial(base ?? {});
2283
+ },
2284
+ fromPartial(object) {
2285
+ const message = createBaseDiskSnapshotSpec();
2286
+ message.sourceDiskId = (object.sourceDiskId !== undefined && object.sourceDiskId !== null)
2287
+ ? object.sourceDiskId
2288
+ : "";
2289
+ message.description = (object.description !== undefined && object.description !== null)
2290
+ ? object.description
2291
+ : "";
2292
+ return message;
2293
+ },
2294
+ };
2295
+ protoRegistry.registerMessage(DiskSnapshotSpec);
2296
+ function DiskSnapshotSpecCustomInspect() {
2297
+ const parts = [];
2298
+ if (this.sourceDiskId !== "")
2299
+ parts.push("sourceDiskId" + "=" + inspect(this.sourceDiskId));
2300
+ if (this.description !== "")
2301
+ parts.push("description" + "=" + inspect(this.description));
2302
+ return `${this.$type}(${parts.join(", ")})`;
2303
+ }
2304
+ function DiskSnapshotSpecCustomJson() {
2305
+ const obj = {
2306
+ type: this.$type,
2307
+ };
2308
+ if (this.sourceDiskId !== "")
2309
+ obj.sourceDiskId = inspectJson(this.sourceDiskId);
2310
+ if (this.description !== "")
2311
+ obj.description = inspectJson(this.description);
2312
+ return obj;
2313
+ }
2314
+ function applyDiskSnapshotSpecCustom(message) {
2315
+ message[custom] = DiskSnapshotSpecCustomInspect;
2316
+ message[customJson] = DiskSnapshotSpecCustomJson;
2317
+ return message;
2318
+ }
2319
+ function createBaseDiskSnapshotSpec() {
2320
+ const message = {
2321
+ $type: "nebius.compute.v1.DiskSnapshotSpec",
2322
+ sourceDiskId: "",
2323
+ description: "",
2324
+ };
2325
+ return applyDiskSnapshotSpecCustom(message);
2326
+ }
2327
+ export const DiskSnapshotStatus = {
2328
+ $type: "nebius.compute.v1.DiskSnapshotStatus",
2329
+ encode(message, writer = new BinaryWriter()) {
2330
+ if ((message.state ?? DiskSnapshotStatus_State.UNSPECIFIED) !== DiskSnapshotStatus_State.UNSPECIFIED) {
2331
+ DiskSnapshotStatus_State.encodeField(writer, 1, message.state);
2332
+ }
2333
+ if (message.contentSizeBytes !== undefined && !message.contentSizeBytes.isZero?.()) {
2334
+ writer.uint32(16).int64(message.contentSizeBytes.toString());
2335
+ }
2336
+ if (message.storageSizeBytes !== undefined && !message.storageSizeBytes.isZero?.()) {
2337
+ writer.uint32(24).int64(message.storageSizeBytes.toString());
2338
+ }
2339
+ if (message.lockState !== undefined) {
2340
+ const w = writer.uint32(34).fork();
2341
+ DiskSnapshotStatus_LockState.encode(message.lockState, w);
2342
+ w.join();
2343
+ }
2344
+ if ((message.sourceCpuArchitecture ?? DiskSnapshotStatus_CPUArchitecture.UNDEFINED) !== DiskSnapshotStatus_CPUArchitecture.UNDEFINED) {
2345
+ DiskSnapshotStatus_CPUArchitecture.encodeField(writer, 5, message.sourceCpuArchitecture);
2346
+ }
2347
+ if (message[unknownFieldsSymbol]) {
2348
+ writer.raw(message[unknownFieldsSymbol]);
2349
+ }
2350
+ return writer;
2351
+ },
2352
+ decode(input, length) {
2353
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2354
+ const end = length === undefined ? reader.len : reader.pos + length;
2355
+ const message = createBaseDiskSnapshotStatus();
2356
+ let writer = undefined;
2357
+ while (reader.pos < end) {
2358
+ const tag = reader.uint32();
2359
+ switch (tag >>> 3) {
2360
+ case 1: {
2361
+ if (tag !== 8)
2362
+ break;
2363
+ message.state = DiskSnapshotStatus_State.fromNumber(reader.int32());
2364
+ continue;
2365
+ }
2366
+ case 2: {
2367
+ if (tag !== 16)
2368
+ break;
2369
+ message.contentSizeBytes = Long.fromValue(reader.int64());
2370
+ continue;
2371
+ }
2372
+ case 3: {
2373
+ if (tag !== 24)
2374
+ break;
2375
+ message.storageSizeBytes = Long.fromValue(reader.int64());
2376
+ continue;
2377
+ }
2378
+ case 4: {
2379
+ if (tag !== 34)
2380
+ break;
2381
+ message.lockState = DiskSnapshotStatus_LockState.decode(reader, reader.uint32());
2382
+ continue;
2383
+ }
2384
+ case 5: {
2385
+ if (tag !== 40)
2386
+ break;
2387
+ message.sourceCpuArchitecture = DiskSnapshotStatus_CPUArchitecture.fromNumber(reader.int32());
2388
+ continue;
2389
+ }
2390
+ default:
2391
+ break;
2392
+ }
2393
+ if ((tag & 7) === 4 || tag === 0) {
2394
+ break;
2395
+ }
2396
+ {
2397
+ if (!writer)
2398
+ writer = new BinaryWriter();
2399
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2400
+ writer.uint32(tag).raw(skipped);
2401
+ }
2402
+ }
2403
+ if (writer) {
2404
+ message[unknownFieldsSymbol] = writer.finish();
2405
+ }
2406
+ return message;
2407
+ },
2408
+ fromJSON(object) {
2409
+ return applyDiskSnapshotStatusCustom({
2410
+ $type: "nebius.compute.v1.DiskSnapshotStatus",
2411
+ state: isSet(object.state ?? object.state)
2412
+ ? DiskSnapshotStatus_State.fromJSON(object.state ?? object.state)
2413
+ : DiskSnapshotStatus_State.UNSPECIFIED,
2414
+ contentSizeBytes: isSet(object.contentSizeBytes ?? object.content_size_bytes)
2415
+ ? Long.fromValue(object.contentSizeBytes ?? object.content_size_bytes)
2416
+ : Long.ZERO,
2417
+ storageSizeBytes: isSet(object.storageSizeBytes ?? object.storage_size_bytes)
2418
+ ? Long.fromValue(object.storageSizeBytes ?? object.storage_size_bytes)
2419
+ : Long.ZERO,
2420
+ lockState: isSet(object.lockState ?? object.lock_state)
2421
+ ? DiskSnapshotStatus_LockState.fromJSON(object.lockState ?? object.lock_state)
2422
+ : undefined,
2423
+ sourceCpuArchitecture: isSet(object.sourceCpuArchitecture ?? object.source_cpu_architecture)
2424
+ ? DiskSnapshotStatus_CPUArchitecture.fromJSON(object.sourceCpuArchitecture ?? object.source_cpu_architecture)
2425
+ : DiskSnapshotStatus_CPUArchitecture.UNDEFINED,
2426
+ });
2427
+ },
2428
+ toJSON(message, use = "json") {
2429
+ const obj = {};
2430
+ const pick = (json, pb) => (use === "json" ? json : pb);
2431
+ if ((message.state ?? DiskSnapshotStatus_State.UNSPECIFIED) !== DiskSnapshotStatus_State.UNSPECIFIED) {
2432
+ obj[pick("state", "state")] = DiskSnapshotStatus_State.toJSON(message.state);
2433
+ }
2434
+ if (!message.contentSizeBytes?.isZero?.()) {
2435
+ obj[pick("contentSizeBytes", "content_size_bytes")] = (message.contentSizeBytes || Long.ZERO).toString();
2436
+ }
2437
+ if (!message.storageSizeBytes?.isZero?.()) {
2438
+ obj[pick("storageSizeBytes", "storage_size_bytes")] = (message.storageSizeBytes || Long.ZERO).toString();
2439
+ }
2440
+ if (message.lockState !== undefined) {
2441
+ obj[pick("lockState", "lock_state")] = message.lockState
2442
+ ? DiskSnapshotStatus_LockState.toJSON(message.lockState, use)
2443
+ : undefined;
2444
+ }
2445
+ if ((message.sourceCpuArchitecture ?? DiskSnapshotStatus_CPUArchitecture.UNDEFINED) !== DiskSnapshotStatus_CPUArchitecture.UNDEFINED) {
2446
+ obj[pick("sourceCpuArchitecture", "source_cpu_architecture")] = DiskSnapshotStatus_CPUArchitecture.toJSON(message.sourceCpuArchitecture);
2447
+ }
2448
+ return obj;
2449
+ },
2450
+ create(base) {
2451
+ return DiskSnapshotStatus.fromPartial(base ?? {});
2452
+ },
2453
+ fromPartial(object) {
2454
+ const message = createBaseDiskSnapshotStatus();
2455
+ message.state = (object.state !== undefined && object.state !== null)
2456
+ ? DiskSnapshotStatus_State.fromJSON(object.state.name)
2457
+ : DiskSnapshotStatus_State.UNSPECIFIED;
2458
+ message.contentSizeBytes = (object.contentSizeBytes !== undefined && object.contentSizeBytes !== null)
2459
+ ? Long.fromValue(object.contentSizeBytes)
2460
+ : Long.ZERO;
2461
+ message.storageSizeBytes = (object.storageSizeBytes !== undefined && object.storageSizeBytes !== null)
2462
+ ? Long.fromValue(object.storageSizeBytes)
2463
+ : Long.ZERO;
2464
+ message.lockState = (object.lockState !== undefined && object.lockState !== null)
2465
+ ? DiskSnapshotStatus_LockState.fromPartial(object.lockState)
2466
+ : undefined;
2467
+ message.sourceCpuArchitecture = (object.sourceCpuArchitecture !== undefined && object.sourceCpuArchitecture !== null)
2468
+ ? DiskSnapshotStatus_CPUArchitecture.fromJSON(object.sourceCpuArchitecture.name)
2469
+ : DiskSnapshotStatus_CPUArchitecture.UNDEFINED;
2470
+ return message;
2471
+ },
2472
+ };
2473
+ protoRegistry.registerMessage(DiskSnapshotStatus);
2474
+ function DiskSnapshotStatusCustomInspect() {
2475
+ const parts = [];
2476
+ if (this.state !== undefined)
2477
+ parts.push("state" + "=" + inspect(this.state));
2478
+ if (!this.contentSizeBytes?.isZero?.())
2479
+ parts.push("contentSizeBytes" + "=" + inspect(this.contentSizeBytes));
2480
+ if (!this.storageSizeBytes?.isZero?.())
2481
+ parts.push("storageSizeBytes" + "=" + inspect(this.storageSizeBytes));
2482
+ if (this.lockState !== undefined)
2483
+ parts.push("lockState" + "=" + inspect(this.lockState));
2484
+ if (this.sourceCpuArchitecture !== undefined)
2485
+ parts.push("sourceCpuArchitecture" + "=" + inspect(this.sourceCpuArchitecture));
2486
+ return `${this.$type}(${parts.join(", ")})`;
2487
+ }
2488
+ function DiskSnapshotStatusCustomJson() {
2489
+ const obj = {
2490
+ type: this.$type,
2491
+ };
2492
+ if (this.state !== undefined)
2493
+ obj.state = inspectJson(this.state);
2494
+ if (!this.contentSizeBytes?.isZero?.())
2495
+ obj.contentSizeBytes = inspectJson(this.contentSizeBytes);
2496
+ if (!this.storageSizeBytes?.isZero?.())
2497
+ obj.storageSizeBytes = inspectJson(this.storageSizeBytes);
2498
+ if (this.lockState !== undefined)
2499
+ obj.lockState = inspectJson(this.lockState);
2500
+ if (this.sourceCpuArchitecture !== undefined)
2501
+ obj.sourceCpuArchitecture = inspectJson(this.sourceCpuArchitecture);
2502
+ return obj;
2503
+ }
2504
+ function applyDiskSnapshotStatusCustom(message) {
2505
+ message[custom] = DiskSnapshotStatusCustomInspect;
2506
+ message[customJson] = DiskSnapshotStatusCustomJson;
2507
+ return message;
2508
+ }
2509
+ function createBaseDiskSnapshotStatus() {
2510
+ const message = {
2511
+ $type: "nebius.compute.v1.DiskSnapshotStatus",
2512
+ state: DiskSnapshotStatus_State.UNSPECIFIED,
2513
+ contentSizeBytes: Long.ZERO,
2514
+ storageSizeBytes: Long.ZERO,
2515
+ lockState: undefined,
2516
+ sourceCpuArchitecture: DiskSnapshotStatus_CPUArchitecture.UNDEFINED,
2517
+ };
2518
+ return applyDiskSnapshotStatusCustom(message);
2519
+ }
2520
+ export const DiskSnapshotStatus_LockState = {
2521
+ $type: "nebius.compute.v1.DiskSnapshotStatus.LockState",
2522
+ encode(message, writer = new BinaryWriter()) {
2523
+ for (const v of (message.disks ?? [])) {
2524
+ writer.uint32(10).string(v);
2525
+ }
2526
+ if (message[unknownFieldsSymbol]) {
2527
+ writer.raw(message[unknownFieldsSymbol]);
2528
+ }
2529
+ return writer;
2530
+ },
2531
+ decode(input, length) {
2532
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2533
+ const end = length === undefined ? reader.len : reader.pos + length;
2534
+ const message = createBaseDiskSnapshotStatus_LockState();
2535
+ let writer = undefined;
2536
+ while (reader.pos < end) {
2537
+ const tag = reader.uint32();
2538
+ switch (tag >>> 3) {
2539
+ case 1: {
2540
+ if (tag !== 10)
2541
+ break;
2542
+ message.disks.push(reader.string());
2543
+ continue;
2544
+ }
2545
+ default:
2546
+ break;
2547
+ }
2548
+ if ((tag & 7) === 4 || tag === 0) {
2549
+ break;
2550
+ }
2551
+ {
2552
+ if (!writer)
2553
+ writer = new BinaryWriter();
2554
+ const skipped = reader.skip(tag & 7, tag >>> 3);
2555
+ writer.uint32(tag).raw(skipped);
2556
+ }
2557
+ }
2558
+ if (writer) {
2559
+ message[unknownFieldsSymbol] = writer.finish();
2560
+ }
2561
+ return message;
2562
+ },
2563
+ fromJSON(object) {
2564
+ return applyDiskSnapshotStatus_LockStateCustom({
2565
+ $type: "nebius.compute.v1.DiskSnapshotStatus.LockState",
2566
+ disks: globalThis.Array.isArray(object?.disks ?? object?.disks)
2567
+ ? (object.disks ?? object.disks).map((e) => String(e))
2568
+ : [],
2569
+ });
2570
+ },
2571
+ toJSON(message, use = "json") {
2572
+ const obj = {};
2573
+ const pick = (json, pb) => (use === "json" ? json : pb);
2574
+ if (message.disks?.length) {
2575
+ obj[pick("disks", "disks")] = message.disks.map((e) => e);
2576
+ }
2577
+ return obj;
2578
+ },
2579
+ create(base) {
2580
+ return DiskSnapshotStatus_LockState.fromPartial(base ?? {});
2581
+ },
2582
+ fromPartial(object) {
2583
+ const message = createBaseDiskSnapshotStatus_LockState();
2584
+ message.disks = object.disks?.map((e) => e) || [];
2585
+ return message;
2586
+ },
2587
+ };
2588
+ protoRegistry.registerMessage(DiskSnapshotStatus_LockState);
2589
+ function DiskSnapshotStatus_LockStateCustomInspect() {
2590
+ const parts = [];
2591
+ if ((this.disks?.length ?? 0) !== 0)
2592
+ parts.push("disks" + "=" + inspect(this.disks));
2593
+ return `${this.$type}(${parts.join(", ")})`;
2594
+ }
2595
+ function DiskSnapshotStatus_LockStateCustomJson() {
2596
+ const obj = {
2597
+ type: this.$type,
2598
+ };
2599
+ if ((this.disks?.length ?? 0) !== 0)
2600
+ obj.disks = inspectJson(this.disks);
2601
+ return obj;
2602
+ }
2603
+ function applyDiskSnapshotStatus_LockStateCustom(message) {
2604
+ message[custom] = DiskSnapshotStatus_LockStateCustomInspect;
2605
+ message[customJson] = DiskSnapshotStatus_LockStateCustomJson;
2606
+ return message;
2607
+ }
2608
+ function createBaseDiskSnapshotStatus_LockState() {
2609
+ const message = {
2610
+ $type: "nebius.compute.v1.DiskSnapshotStatus.LockState",
2611
+ disks: [],
2612
+ };
2613
+ return applyDiskSnapshotStatus_LockStateCustom(message);
2614
+ }
908
2615
  export const DiskSpec_DiskType = createEnum("nebius.compute.v1.DiskSpec.DiskType", {
909
2616
  UNSPECIFIED: 0,
910
2617
  NETWORK_SSD: 1,
@@ -1949,6 +3656,9 @@ export const DiskStatus_LockState = {
1949
3656
  for (const v of (message.images ?? [])) {
1950
3657
  writer.uint32(10).string(v);
1951
3658
  }
3659
+ for (const v of (message.snapshots ?? [])) {
3660
+ writer.uint32(18).string(v);
3661
+ }
1952
3662
  if (message[unknownFieldsSymbol]) {
1953
3663
  writer.raw(message[unknownFieldsSymbol]);
1954
3664
  }
@@ -1968,6 +3678,12 @@ export const DiskStatus_LockState = {
1968
3678
  message.images.push(reader.string());
1969
3679
  continue;
1970
3680
  }
3681
+ case 2: {
3682
+ if (tag !== 18)
3683
+ break;
3684
+ message.snapshots.push(reader.string());
3685
+ continue;
3686
+ }
1971
3687
  default:
1972
3688
  break;
1973
3689
  }
@@ -1992,6 +3708,9 @@ export const DiskStatus_LockState = {
1992
3708
  images: globalThis.Array.isArray(object?.images ?? object?.images)
1993
3709
  ? (object.images ?? object.images).map((e) => String(e))
1994
3710
  : [],
3711
+ snapshots: globalThis.Array.isArray(object?.snapshots ?? object?.snapshots)
3712
+ ? (object.snapshots ?? object.snapshots).map((e) => String(e))
3713
+ : [],
1995
3714
  });
1996
3715
  },
1997
3716
  toJSON(message, use = "json") {
@@ -2000,6 +3719,9 @@ export const DiskStatus_LockState = {
2000
3719
  if (message.images?.length) {
2001
3720
  obj[pick("images", "images")] = message.images.map((e) => e);
2002
3721
  }
3722
+ if (message.snapshots?.length) {
3723
+ obj[pick("snapshots", "snapshots")] = message.snapshots.map((e) => e);
3724
+ }
2003
3725
  return obj;
2004
3726
  },
2005
3727
  create(base) {
@@ -2008,6 +3730,7 @@ export const DiskStatus_LockState = {
2008
3730
  fromPartial(object) {
2009
3731
  const message = createBaseDiskStatus_LockState();
2010
3732
  message.images = object.images?.map((e) => e) || [];
3733
+ message.snapshots = object.snapshots?.map((e) => e) || [];
2011
3734
  return message;
2012
3735
  },
2013
3736
  };
@@ -2016,6 +3739,8 @@ function DiskStatus_LockStateCustomInspect() {
2016
3739
  const parts = [];
2017
3740
  if ((this.images?.length ?? 0) !== 0)
2018
3741
  parts.push("images" + "=" + inspect(this.images));
3742
+ if ((this.snapshots?.length ?? 0) !== 0)
3743
+ parts.push("snapshots" + "=" + inspect(this.snapshots));
2019
3744
  return `${this.$type}(${parts.join(", ")})`;
2020
3745
  }
2021
3746
  function DiskStatus_LockStateCustomJson() {
@@ -2024,6 +3749,8 @@ function DiskStatus_LockStateCustomJson() {
2024
3749
  };
2025
3750
  if ((this.images?.length ?? 0) !== 0)
2026
3751
  obj.images = inspectJson(this.images);
3752
+ if ((this.snapshots?.length ?? 0) !== 0)
3753
+ obj.snapshots = inspectJson(this.snapshots);
2027
3754
  return obj;
2028
3755
  }
2029
3756
  function applyDiskStatus_LockStateCustom(message) {
@@ -2035,6 +3762,7 @@ function createBaseDiskStatus_LockState() {
2035
3762
  const message = {
2036
3763
  $type: "nebius.compute.v1.DiskStatus.LockState",
2037
3764
  images: [],
3765
+ snapshots: [],
2038
3766
  };
2039
3767
  return applyDiskStatus_LockStateCustom(message);
2040
3768
  }