@nebius/js-sdk 0.1.33 → 0.1.34

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.
@@ -2,8 +2,9 @@
2
2
  /* Generated by Nebius TS generator. DO NOT EDIT! */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PoolServiceBaseClient = exports.PoolServiceServiceDescription = exports.DeletePoolRequest = exports.UpdatePoolRequest = exports.CreatePoolRequest = exports.ListPoolsResponse = exports.ListPoolsBySourcePoolRequest = exports.ListPoolsRequest = exports.GetPoolByNameRequest = exports.GetPoolRequest = exports.NetworkStatus = exports.NetworkPool = exports.IPv4PublicNetworkPools = exports.IPv4PrivateNetworkPools = exports.NetworkSpec = exports.Network = exports.NetworkStatus_State = exports.NetworkService = exports.NetworkServiceBaseClient = exports.NetworkServiceServiceDescription = exports.DeleteNetworkRequest = exports.UpdateNetworkRequest = exports.CreateDefaultNetworkRequest = exports.CreateNetworkRequest = exports.ListNetworksResponse = exports.ListNetworksRequest = exports.GetNetworkByNameRequest = exports.GetNetworkRequest = exports.LoadBalancerAssignment = exports.NetworkInterfaceAssignment = exports.Assignment = exports.AllocationDetails = exports.AllocationStatus = exports.IPv4PublicAllocationSpec = exports.IPv4PrivateAllocationSpec = exports.AllocationSpec = exports.Allocation = exports.AllocationStatus_State = exports.AllocationService = exports.AllocationServiceBaseClient = exports.AllocationServiceServiceDescription = exports.DeleteAllocationRequest = exports.UpdateAllocationRequest = exports.CreateAllocationRequest = exports.ListAllocationsResponse = exports.ListAllocationsBySubnetRequest = exports.ListAllocationsByPoolRequest = exports.ListAllocationsRequest = exports.GetAllocationByNameRequest = exports.GetAllocationRequest = void 0;
5
- exports.ListSubnetsByNetworkRequest = exports.ListSubnetsRequest = exports.GetSubnetByNameRequest = exports.GetSubnetRequest = exports.DefaultEgressGatewayState = exports.AllocationNextHopState = exports.NextHopState = exports.RouteStatus = exports.AllocationNextHop = exports.NextHop = exports.DestinationMatch = exports.RouteSpec = exports.Route = exports.RouteStatus_State = exports.RouteTableAssignment = exports.RouteTableStatus = exports.RouteTableSpec = exports.RouteTable = exports.RouteTableStatus_State = exports.RouteTableService = exports.RouteTableServiceBaseClient = exports.RouteTableServiceServiceDescription = exports.DeleteRouteTableRequest = exports.UpdateRouteTableRequest = exports.CreateRouteTableRequest = exports.ListRouteTablesResponse = exports.ListRouteTablesByNetworkRequest = exports.ListRouteTablesRequest = exports.GetRouteTableByNameRequest = exports.GetRouteTableRequest = exports.RouteService = exports.RouteServiceBaseClient = exports.RouteServiceServiceDescription = exports.DeleteRouteRequest = exports.UpdateRouteRequest = exports.CreateRouteRequest = exports.ListRoutesResponse = exports.ListRoutesRequest = exports.GetRouteByNameRequest = exports.GetRouteRequest = exports.PoolAssignment = exports.PoolStatus = exports.PoolCidr = exports.PoolSpec = exports.Pool = exports.PoolStatus_State = exports.IpVisibility = exports.IpVersion = exports.AddressBlockState = exports.PoolService = void 0;
6
- exports.TargetStatus = exports.TargetGroupStatus = exports.ComputeInstance = exports.Target = exports.TargetGroupSpec = exports.TargetGroup = exports.TargetStatus_TargetState = exports.TargetGroupService = exports.TargetGroupServiceBaseClient = exports.TargetGroupServiceServiceDescription = exports.UpdateTargetGroupRequest = exports.GetTargetGroupRequest = exports.SubnetAssociatedRouteTable = exports.SubnetStatus = exports.SubnetCidr = exports.SubnetPool = exports.IPv4PublicSubnetPools = exports.IPv4PrivateSubnetPools = exports.SubnetSpec = exports.Subnet = exports.SubnetStatus_State = exports.SubnetService = exports.SubnetServiceBaseClient = exports.SubnetServiceServiceDescription = exports.DeleteSubnetRequest = exports.UpdateSubnetRequest = exports.CreateSubnetRequest = exports.ListSubnetsResponse = void 0;
5
+ exports.ListSecurityGroupsByNetworkRequest = exports.ListSecurityGroupsRequest = exports.GetSecurityGroupByNameRequest = exports.GetSecurityGroupRequest = exports.DefaultEgressGatewayState = exports.AllocationNextHopState = exports.NextHopState = exports.RouteStatus = exports.AllocationNextHop = exports.NextHop = exports.DestinationMatch = exports.RouteSpec = exports.Route = exports.RouteStatus_State = exports.RouteTableAssignment = exports.RouteTableStatus = exports.RouteTableSpec = exports.RouteTable = exports.RouteTableStatus_State = exports.RouteTableService = exports.RouteTableServiceBaseClient = exports.RouteTableServiceServiceDescription = exports.DeleteRouteTableRequest = exports.UpdateRouteTableRequest = exports.CreateRouteTableRequest = exports.ListRouteTablesResponse = exports.ListRouteTablesByNetworkRequest = exports.ListRouteTablesRequest = exports.GetRouteTableByNameRequest = exports.GetRouteTableRequest = exports.RouteService = exports.RouteServiceBaseClient = exports.RouteServiceServiceDescription = exports.DeleteRouteRequest = exports.UpdateRouteRequest = exports.CreateRouteRequest = exports.ListRoutesResponse = exports.ListRoutesRequest = exports.GetRouteByNameRequest = exports.GetRouteRequest = exports.PoolAssignment = exports.PoolStatus = exports.PoolCidr = exports.PoolSpec = exports.Pool = exports.PoolStatus_State = exports.IpVisibility = exports.IpVersion = exports.AddressBlockState = exports.PoolService = void 0;
6
+ exports.SubnetCidr = exports.SubnetPool = exports.IPv4PublicSubnetPools = exports.IPv4PrivateSubnetPools = exports.SubnetSpec = exports.Subnet = exports.SubnetStatus_State = exports.SubnetService = exports.SubnetServiceBaseClient = exports.SubnetServiceServiceDescription = exports.DeleteSubnetRequest = exports.UpdateSubnetRequest = exports.CreateSubnetRequest = exports.ListSubnetsResponse = exports.ListSubnetsByNetworkRequest = exports.ListSubnetsRequest = exports.GetSubnetByNameRequest = exports.GetSubnetRequest = exports.RuleMatchStatus = exports.SecurityRuleStatus = exports.RuleEgress = exports.RuleIngress = exports.SecurityRuleSpec = exports.SecurityRule = exports.SecurityRuleStatus_State = exports.RuleType = exports.RuleAccessAction = exports.RuleProtocol = exports.RuleDirection = exports.SecurityRuleService = exports.SecurityRuleServiceBaseClient = exports.SecurityRuleServiceServiceDescription = exports.DeleteSecurityRuleRequest = exports.UpdateSecurityRuleRequest = exports.CreateSecurityRuleRequest = exports.ListSecurityRulesResponse = exports.ListSecurityRulesRequest = exports.GetSecurityRuleByNameRequest = exports.GetSecurityRuleRequest = exports.SecurityGroupStatus = exports.SecurityGroupSpec = exports.SecurityGroup = exports.SecurityGroupStatus_State = exports.SecurityGroupService = exports.SecurityGroupServiceBaseClient = exports.SecurityGroupServiceServiceDescription = exports.DeleteSecurityGroupRequest = exports.UpdateSecurityGroupRequest = exports.CreateSecurityGroupRequest = exports.ListSecurityGroupsResponse = void 0;
7
+ exports.TargetStatus = exports.TargetGroupStatus = exports.ComputeInstance = exports.Target = exports.TargetGroupSpec = exports.TargetGroup = exports.TargetStatus_TargetState = exports.TargetGroupService = exports.TargetGroupServiceBaseClient = exports.TargetGroupServiceServiceDescription = exports.UpdateTargetGroupRequest = exports.GetTargetGroupRequest = exports.SubnetAssociatedRouteTable = exports.SubnetStatus = void 0;
7
8
  const index_1 = require("../../../../runtime/protos/index");
8
9
  const util_1 = require("util");
9
10
  const protobuf_1 = require("../../../protobuf");
@@ -10210,6 +10211,3577 @@ function createBaseDefaultEgressGatewayState() {
10210
10211
  };
10211
10212
  return applyDefaultEgressGatewayStateCustom(message);
10212
10213
  }
10214
+ exports.GetSecurityGroupRequest = {
10215
+ $type: "nebius.vpc.v1.GetSecurityGroupRequest",
10216
+ encode(message, writer = new index_1.BinaryWriter()) {
10217
+ if (message.id !== "") {
10218
+ writer.uint32(10).string(message.id);
10219
+ }
10220
+ if (message[index_1.unknownFieldsSymbol]) {
10221
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10222
+ }
10223
+ return writer;
10224
+ },
10225
+ decode(input, length) {
10226
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10227
+ const end = length === undefined ? reader.len : reader.pos + length;
10228
+ const message = createBaseGetSecurityGroupRequest();
10229
+ let writer = undefined;
10230
+ while (reader.pos < end) {
10231
+ const tag = reader.uint32();
10232
+ switch (tag >>> 3) {
10233
+ case 1: {
10234
+ if (tag !== 10)
10235
+ break;
10236
+ message.id = reader.string();
10237
+ continue;
10238
+ }
10239
+ default:
10240
+ break;
10241
+ }
10242
+ if ((tag & 7) === 4 || tag === 0) {
10243
+ break;
10244
+ }
10245
+ {
10246
+ if (!writer)
10247
+ writer = new index_1.BinaryWriter();
10248
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10249
+ writer.uint32(tag).raw(skipped);
10250
+ }
10251
+ }
10252
+ if (writer) {
10253
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10254
+ }
10255
+ return message;
10256
+ },
10257
+ fromJSON(object) {
10258
+ return applyGetSecurityGroupRequestCustom({
10259
+ $type: "nebius.vpc.v1.GetSecurityGroupRequest",
10260
+ id: (0, index_1.isSet)(object.id ?? object.id)
10261
+ ? String(object.id ?? object.id)
10262
+ : "",
10263
+ });
10264
+ },
10265
+ toJSON(message, use = "json") {
10266
+ const obj = {};
10267
+ const pick = (json, pb) => (use === "json" ? json : pb);
10268
+ if (message.id !== "") {
10269
+ obj[pick("id", "id")] = message.id;
10270
+ }
10271
+ return obj;
10272
+ },
10273
+ create(base) {
10274
+ return exports.GetSecurityGroupRequest.fromPartial(base ?? {});
10275
+ },
10276
+ fromPartial(object) {
10277
+ const message = createBaseGetSecurityGroupRequest();
10278
+ message.id = (object.id !== undefined && object.id !== null)
10279
+ ? object.id
10280
+ : "";
10281
+ return message;
10282
+ },
10283
+ };
10284
+ protobuf_1.protoRegistry.registerMessage(exports.GetSecurityGroupRequest);
10285
+ function GetSecurityGroupRequestCustomInspect() {
10286
+ const parts = [];
10287
+ if (this.id !== "")
10288
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
10289
+ return `${this.$type}(${parts.join(", ")})`;
10290
+ }
10291
+ function GetSecurityGroupRequestCustomJson() {
10292
+ const obj = {
10293
+ type: this.$type,
10294
+ };
10295
+ if (this.id !== "")
10296
+ obj.id = (0, logging_1.inspectJson)(this.id);
10297
+ return obj;
10298
+ }
10299
+ function applyGetSecurityGroupRequestCustom(message) {
10300
+ message[logging_1.custom] = GetSecurityGroupRequestCustomInspect;
10301
+ message[logging_1.customJson] = GetSecurityGroupRequestCustomJson;
10302
+ return message;
10303
+ }
10304
+ function createBaseGetSecurityGroupRequest() {
10305
+ const message = {
10306
+ $type: "nebius.vpc.v1.GetSecurityGroupRequest",
10307
+ id: "",
10308
+ };
10309
+ return applyGetSecurityGroupRequestCustom(message);
10310
+ }
10311
+ exports.GetSecurityGroupByNameRequest = {
10312
+ $type: "nebius.vpc.v1.GetSecurityGroupByNameRequest",
10313
+ encode(message, writer = new index_1.BinaryWriter()) {
10314
+ if (message.parentId !== "") {
10315
+ writer.uint32(10).string(message.parentId);
10316
+ }
10317
+ if (message.name !== "") {
10318
+ writer.uint32(18).string(message.name);
10319
+ }
10320
+ if (message[index_1.unknownFieldsSymbol]) {
10321
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10322
+ }
10323
+ return writer;
10324
+ },
10325
+ decode(input, length) {
10326
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10327
+ const end = length === undefined ? reader.len : reader.pos + length;
10328
+ const message = createBaseGetSecurityGroupByNameRequest();
10329
+ let writer = undefined;
10330
+ while (reader.pos < end) {
10331
+ const tag = reader.uint32();
10332
+ switch (tag >>> 3) {
10333
+ case 1: {
10334
+ if (tag !== 10)
10335
+ break;
10336
+ message.parentId = reader.string();
10337
+ continue;
10338
+ }
10339
+ case 2: {
10340
+ if (tag !== 18)
10341
+ break;
10342
+ message.name = reader.string();
10343
+ continue;
10344
+ }
10345
+ default:
10346
+ break;
10347
+ }
10348
+ if ((tag & 7) === 4 || tag === 0) {
10349
+ break;
10350
+ }
10351
+ {
10352
+ if (!writer)
10353
+ writer = new index_1.BinaryWriter();
10354
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10355
+ writer.uint32(tag).raw(skipped);
10356
+ }
10357
+ }
10358
+ if (writer) {
10359
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10360
+ }
10361
+ return message;
10362
+ },
10363
+ fromJSON(object) {
10364
+ return applyGetSecurityGroupByNameRequestCustom({
10365
+ $type: "nebius.vpc.v1.GetSecurityGroupByNameRequest",
10366
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
10367
+ ? String(object.parentId ?? object.parent_id)
10368
+ : "",
10369
+ name: (0, index_1.isSet)(object.name ?? object.name)
10370
+ ? String(object.name ?? object.name)
10371
+ : "",
10372
+ });
10373
+ },
10374
+ toJSON(message, use = "json") {
10375
+ const obj = {};
10376
+ const pick = (json, pb) => (use === "json" ? json : pb);
10377
+ if (message.parentId !== "") {
10378
+ obj[pick("parentId", "parent_id")] = message.parentId;
10379
+ }
10380
+ if (message.name !== "") {
10381
+ obj[pick("name", "name")] = message.name;
10382
+ }
10383
+ return obj;
10384
+ },
10385
+ create(base) {
10386
+ return exports.GetSecurityGroupByNameRequest.fromPartial(base ?? {});
10387
+ },
10388
+ fromPartial(object) {
10389
+ const message = createBaseGetSecurityGroupByNameRequest();
10390
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
10391
+ ? object.parentId
10392
+ : "";
10393
+ message.name = (object.name !== undefined && object.name !== null)
10394
+ ? object.name
10395
+ : "";
10396
+ return message;
10397
+ },
10398
+ };
10399
+ protobuf_1.protoRegistry.registerMessage(exports.GetSecurityGroupByNameRequest);
10400
+ function GetSecurityGroupByNameRequestCustomInspect() {
10401
+ const parts = [];
10402
+ if (this.parentId !== "")
10403
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
10404
+ if (this.name !== "")
10405
+ parts.push("name" + "=" + (0, util_1.inspect)(this.name));
10406
+ return `${this.$type}(${parts.join(", ")})`;
10407
+ }
10408
+ function GetSecurityGroupByNameRequestCustomJson() {
10409
+ const obj = {
10410
+ type: this.$type,
10411
+ };
10412
+ if (this.parentId !== "")
10413
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
10414
+ if (this.name !== "")
10415
+ obj.name = (0, logging_1.inspectJson)(this.name);
10416
+ return obj;
10417
+ }
10418
+ function applyGetSecurityGroupByNameRequestCustom(message) {
10419
+ message[logging_1.custom] = GetSecurityGroupByNameRequestCustomInspect;
10420
+ message[logging_1.customJson] = GetSecurityGroupByNameRequestCustomJson;
10421
+ return message;
10422
+ }
10423
+ function createBaseGetSecurityGroupByNameRequest() {
10424
+ const message = {
10425
+ $type: "nebius.vpc.v1.GetSecurityGroupByNameRequest",
10426
+ parentId: "",
10427
+ name: "",
10428
+ };
10429
+ return applyGetSecurityGroupByNameRequestCustom(message);
10430
+ }
10431
+ exports.ListSecurityGroupsRequest = {
10432
+ $type: "nebius.vpc.v1.ListSecurityGroupsRequest",
10433
+ encode(message, writer = new index_1.BinaryWriter()) {
10434
+ if (message.parentId !== "") {
10435
+ writer.uint32(10).string(message.parentId);
10436
+ }
10437
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
10438
+ writer.uint32(16).int64(message.pageSize.toString());
10439
+ }
10440
+ if (message.pageToken !== "") {
10441
+ writer.uint32(26).string(message.pageToken);
10442
+ }
10443
+ if (message[index_1.unknownFieldsSymbol]) {
10444
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10445
+ }
10446
+ return writer;
10447
+ },
10448
+ decode(input, length) {
10449
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10450
+ const end = length === undefined ? reader.len : reader.pos + length;
10451
+ const message = createBaseListSecurityGroupsRequest();
10452
+ let writer = undefined;
10453
+ while (reader.pos < end) {
10454
+ const tag = reader.uint32();
10455
+ switch (tag >>> 3) {
10456
+ case 1: {
10457
+ if (tag !== 10)
10458
+ break;
10459
+ message.parentId = reader.string();
10460
+ continue;
10461
+ }
10462
+ case 2: {
10463
+ if (tag !== 16)
10464
+ break;
10465
+ message.pageSize = index_1.Long.fromValue(reader.int64());
10466
+ continue;
10467
+ }
10468
+ case 3: {
10469
+ if (tag !== 26)
10470
+ break;
10471
+ message.pageToken = reader.string();
10472
+ continue;
10473
+ }
10474
+ default:
10475
+ break;
10476
+ }
10477
+ if ((tag & 7) === 4 || tag === 0) {
10478
+ break;
10479
+ }
10480
+ {
10481
+ if (!writer)
10482
+ writer = new index_1.BinaryWriter();
10483
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10484
+ writer.uint32(tag).raw(skipped);
10485
+ }
10486
+ }
10487
+ if (writer) {
10488
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10489
+ }
10490
+ return message;
10491
+ },
10492
+ fromJSON(object) {
10493
+ return applyListSecurityGroupsRequestCustom({
10494
+ $type: "nebius.vpc.v1.ListSecurityGroupsRequest",
10495
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
10496
+ ? String(object.parentId ?? object.parent_id)
10497
+ : "",
10498
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
10499
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
10500
+ : index_1.Long.ZERO,
10501
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
10502
+ ? String(object.pageToken ?? object.page_token)
10503
+ : "",
10504
+ });
10505
+ },
10506
+ toJSON(message, use = "json") {
10507
+ const obj = {};
10508
+ const pick = (json, pb) => (use === "json" ? json : pb);
10509
+ if (message.parentId !== "") {
10510
+ obj[pick("parentId", "parent_id")] = message.parentId;
10511
+ }
10512
+ if (!message.pageSize?.isZero?.()) {
10513
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
10514
+ }
10515
+ if (message.pageToken !== "") {
10516
+ obj[pick("pageToken", "page_token")] = message.pageToken;
10517
+ }
10518
+ return obj;
10519
+ },
10520
+ create(base) {
10521
+ return exports.ListSecurityGroupsRequest.fromPartial(base ?? {});
10522
+ },
10523
+ fromPartial(object) {
10524
+ const message = createBaseListSecurityGroupsRequest();
10525
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
10526
+ ? object.parentId
10527
+ : "";
10528
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
10529
+ ? index_1.Long.fromValue(object.pageSize)
10530
+ : index_1.Long.ZERO;
10531
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
10532
+ ? object.pageToken
10533
+ : "";
10534
+ return message;
10535
+ },
10536
+ };
10537
+ protobuf_1.protoRegistry.registerMessage(exports.ListSecurityGroupsRequest);
10538
+ function ListSecurityGroupsRequestCustomInspect() {
10539
+ const parts = [];
10540
+ if (this.parentId !== "")
10541
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
10542
+ if (!this.pageSize?.isZero?.())
10543
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
10544
+ if (this.pageToken !== "")
10545
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
10546
+ return `${this.$type}(${parts.join(", ")})`;
10547
+ }
10548
+ function ListSecurityGroupsRequestCustomJson() {
10549
+ const obj = {
10550
+ type: this.$type,
10551
+ };
10552
+ if (this.parentId !== "")
10553
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
10554
+ if (!this.pageSize?.isZero?.())
10555
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
10556
+ if (this.pageToken !== "")
10557
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
10558
+ return obj;
10559
+ }
10560
+ function applyListSecurityGroupsRequestCustom(message) {
10561
+ message[logging_1.custom] = ListSecurityGroupsRequestCustomInspect;
10562
+ message[logging_1.customJson] = ListSecurityGroupsRequestCustomJson;
10563
+ return message;
10564
+ }
10565
+ function createBaseListSecurityGroupsRequest() {
10566
+ const message = {
10567
+ $type: "nebius.vpc.v1.ListSecurityGroupsRequest",
10568
+ parentId: "",
10569
+ pageSize: index_1.Long.ZERO,
10570
+ pageToken: "",
10571
+ };
10572
+ return applyListSecurityGroupsRequestCustom(message);
10573
+ }
10574
+ exports.ListSecurityGroupsByNetworkRequest = {
10575
+ $type: "nebius.vpc.v1.ListSecurityGroupsByNetworkRequest",
10576
+ encode(message, writer = new index_1.BinaryWriter()) {
10577
+ if (message.networkId !== "") {
10578
+ writer.uint32(10).string(message.networkId);
10579
+ }
10580
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
10581
+ writer.uint32(16).int64(message.pageSize.toString());
10582
+ }
10583
+ if (message.pageToken !== "") {
10584
+ writer.uint32(26).string(message.pageToken);
10585
+ }
10586
+ if (message[index_1.unknownFieldsSymbol]) {
10587
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10588
+ }
10589
+ return writer;
10590
+ },
10591
+ decode(input, length) {
10592
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10593
+ const end = length === undefined ? reader.len : reader.pos + length;
10594
+ const message = createBaseListSecurityGroupsByNetworkRequest();
10595
+ let writer = undefined;
10596
+ while (reader.pos < end) {
10597
+ const tag = reader.uint32();
10598
+ switch (tag >>> 3) {
10599
+ case 1: {
10600
+ if (tag !== 10)
10601
+ break;
10602
+ message.networkId = reader.string();
10603
+ continue;
10604
+ }
10605
+ case 2: {
10606
+ if (tag !== 16)
10607
+ break;
10608
+ message.pageSize = index_1.Long.fromValue(reader.int64());
10609
+ continue;
10610
+ }
10611
+ case 3: {
10612
+ if (tag !== 26)
10613
+ break;
10614
+ message.pageToken = reader.string();
10615
+ continue;
10616
+ }
10617
+ default:
10618
+ break;
10619
+ }
10620
+ if ((tag & 7) === 4 || tag === 0) {
10621
+ break;
10622
+ }
10623
+ {
10624
+ if (!writer)
10625
+ writer = new index_1.BinaryWriter();
10626
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10627
+ writer.uint32(tag).raw(skipped);
10628
+ }
10629
+ }
10630
+ if (writer) {
10631
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10632
+ }
10633
+ return message;
10634
+ },
10635
+ fromJSON(object) {
10636
+ return applyListSecurityGroupsByNetworkRequestCustom({
10637
+ $type: "nebius.vpc.v1.ListSecurityGroupsByNetworkRequest",
10638
+ networkId: (0, index_1.isSet)(object.networkId ?? object.network_id)
10639
+ ? String(object.networkId ?? object.network_id)
10640
+ : "",
10641
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
10642
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
10643
+ : index_1.Long.ZERO,
10644
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
10645
+ ? String(object.pageToken ?? object.page_token)
10646
+ : "",
10647
+ });
10648
+ },
10649
+ toJSON(message, use = "json") {
10650
+ const obj = {};
10651
+ const pick = (json, pb) => (use === "json" ? json : pb);
10652
+ if (message.networkId !== "") {
10653
+ obj[pick("networkId", "network_id")] = message.networkId;
10654
+ }
10655
+ if (!message.pageSize?.isZero?.()) {
10656
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
10657
+ }
10658
+ if (message.pageToken !== "") {
10659
+ obj[pick("pageToken", "page_token")] = message.pageToken;
10660
+ }
10661
+ return obj;
10662
+ },
10663
+ create(base) {
10664
+ return exports.ListSecurityGroupsByNetworkRequest.fromPartial(base ?? {});
10665
+ },
10666
+ fromPartial(object) {
10667
+ const message = createBaseListSecurityGroupsByNetworkRequest();
10668
+ message.networkId = (object.networkId !== undefined && object.networkId !== null)
10669
+ ? object.networkId
10670
+ : "";
10671
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
10672
+ ? index_1.Long.fromValue(object.pageSize)
10673
+ : index_1.Long.ZERO;
10674
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
10675
+ ? object.pageToken
10676
+ : "";
10677
+ return message;
10678
+ },
10679
+ };
10680
+ protobuf_1.protoRegistry.registerMessage(exports.ListSecurityGroupsByNetworkRequest);
10681
+ function ListSecurityGroupsByNetworkRequestCustomInspect() {
10682
+ const parts = [];
10683
+ if (this.networkId !== "")
10684
+ parts.push("networkId" + "=" + (0, util_1.inspect)(this.networkId));
10685
+ if (!this.pageSize?.isZero?.())
10686
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
10687
+ if (this.pageToken !== "")
10688
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
10689
+ return `${this.$type}(${parts.join(", ")})`;
10690
+ }
10691
+ function ListSecurityGroupsByNetworkRequestCustomJson() {
10692
+ const obj = {
10693
+ type: this.$type,
10694
+ };
10695
+ if (this.networkId !== "")
10696
+ obj.networkId = (0, logging_1.inspectJson)(this.networkId);
10697
+ if (!this.pageSize?.isZero?.())
10698
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
10699
+ if (this.pageToken !== "")
10700
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
10701
+ return obj;
10702
+ }
10703
+ function applyListSecurityGroupsByNetworkRequestCustom(message) {
10704
+ message[logging_1.custom] = ListSecurityGroupsByNetworkRequestCustomInspect;
10705
+ message[logging_1.customJson] = ListSecurityGroupsByNetworkRequestCustomJson;
10706
+ return message;
10707
+ }
10708
+ function createBaseListSecurityGroupsByNetworkRequest() {
10709
+ const message = {
10710
+ $type: "nebius.vpc.v1.ListSecurityGroupsByNetworkRequest",
10711
+ networkId: "",
10712
+ pageSize: index_1.Long.ZERO,
10713
+ pageToken: "",
10714
+ };
10715
+ return applyListSecurityGroupsByNetworkRequestCustom(message);
10716
+ }
10717
+ exports.ListSecurityGroupsResponse = {
10718
+ $type: "nebius.vpc.v1.ListSecurityGroupsResponse",
10719
+ encode(message, writer = new index_1.BinaryWriter()) {
10720
+ for (const v of (message.items ?? [])) {
10721
+ const w = writer.uint32(10).fork();
10722
+ exports.SecurityGroup.encode(v, w);
10723
+ w.join();
10724
+ }
10725
+ if (message.nextPageToken !== "") {
10726
+ writer.uint32(18).string(message.nextPageToken);
10727
+ }
10728
+ if (message[index_1.unknownFieldsSymbol]) {
10729
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10730
+ }
10731
+ return writer;
10732
+ },
10733
+ decode(input, length) {
10734
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10735
+ const end = length === undefined ? reader.len : reader.pos + length;
10736
+ const message = createBaseListSecurityGroupsResponse();
10737
+ let writer = undefined;
10738
+ while (reader.pos < end) {
10739
+ const tag = reader.uint32();
10740
+ switch (tag >>> 3) {
10741
+ case 1: {
10742
+ if (tag !== 10)
10743
+ break;
10744
+ message.items.push(exports.SecurityGroup.decode(reader, reader.uint32()));
10745
+ continue;
10746
+ }
10747
+ case 2: {
10748
+ if (tag !== 18)
10749
+ break;
10750
+ message.nextPageToken = reader.string();
10751
+ continue;
10752
+ }
10753
+ default:
10754
+ break;
10755
+ }
10756
+ if ((tag & 7) === 4 || tag === 0) {
10757
+ break;
10758
+ }
10759
+ {
10760
+ if (!writer)
10761
+ writer = new index_1.BinaryWriter();
10762
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10763
+ writer.uint32(tag).raw(skipped);
10764
+ }
10765
+ }
10766
+ if (writer) {
10767
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10768
+ }
10769
+ return message;
10770
+ },
10771
+ fromJSON(object) {
10772
+ return applyListSecurityGroupsResponseCustom({
10773
+ $type: "nebius.vpc.v1.ListSecurityGroupsResponse",
10774
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
10775
+ ? (object.items ?? object.items).map((e) => exports.SecurityGroup.fromJSON(e))
10776
+ : [],
10777
+ nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
10778
+ ? String(object.nextPageToken ?? object.next_page_token)
10779
+ : "",
10780
+ });
10781
+ },
10782
+ toJSON(message, use = "json") {
10783
+ const obj = {};
10784
+ const pick = (json, pb) => (use === "json" ? json : pb);
10785
+ if (message.items?.length) {
10786
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.SecurityGroup.toJSON(e, use) : undefined);
10787
+ }
10788
+ if (message.nextPageToken !== "") {
10789
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
10790
+ }
10791
+ return obj;
10792
+ },
10793
+ create(base) {
10794
+ return exports.ListSecurityGroupsResponse.fromPartial(base ?? {});
10795
+ },
10796
+ fromPartial(object) {
10797
+ const message = createBaseListSecurityGroupsResponse();
10798
+ message.items = object.items?.map((e) => exports.SecurityGroup.fromPartial(e)) || [];
10799
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
10800
+ ? object.nextPageToken
10801
+ : "";
10802
+ return message;
10803
+ },
10804
+ };
10805
+ protobuf_1.protoRegistry.registerMessage(exports.ListSecurityGroupsResponse);
10806
+ function ListSecurityGroupsResponseCustomInspect() {
10807
+ const parts = [];
10808
+ if ((this.items?.length ?? 0) !== 0)
10809
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
10810
+ if (this.nextPageToken !== "")
10811
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
10812
+ return `${this.$type}(${parts.join(", ")})`;
10813
+ }
10814
+ function ListSecurityGroupsResponseCustomJson() {
10815
+ const obj = {
10816
+ type: this.$type,
10817
+ };
10818
+ if ((this.items?.length ?? 0) !== 0)
10819
+ obj.items = (0, logging_1.inspectJson)(this.items);
10820
+ if (this.nextPageToken !== "")
10821
+ obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
10822
+ return obj;
10823
+ }
10824
+ function applyListSecurityGroupsResponseCustom(message) {
10825
+ message[logging_1.custom] = ListSecurityGroupsResponseCustomInspect;
10826
+ message[logging_1.customJson] = ListSecurityGroupsResponseCustomJson;
10827
+ return message;
10828
+ }
10829
+ function createBaseListSecurityGroupsResponse() {
10830
+ const message = {
10831
+ $type: "nebius.vpc.v1.ListSecurityGroupsResponse",
10832
+ items: [],
10833
+ nextPageToken: "",
10834
+ };
10835
+ return applyListSecurityGroupsResponseCustom(message);
10836
+ }
10837
+ exports.CreateSecurityGroupRequest = {
10838
+ $type: "nebius.vpc.v1.CreateSecurityGroupRequest",
10839
+ encode(message, writer = new index_1.BinaryWriter()) {
10840
+ if (message.metadata !== undefined) {
10841
+ const w = writer.uint32(10).fork();
10842
+ v1_1.ResourceMetadata.encode(message.metadata, w);
10843
+ w.join();
10844
+ }
10845
+ if (message.spec !== undefined) {
10846
+ const w = writer.uint32(18).fork();
10847
+ exports.SecurityGroupSpec.encode(message.spec, w);
10848
+ w.join();
10849
+ }
10850
+ if (message[index_1.unknownFieldsSymbol]) {
10851
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10852
+ }
10853
+ return writer;
10854
+ },
10855
+ decode(input, length) {
10856
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10857
+ const end = length === undefined ? reader.len : reader.pos + length;
10858
+ const message = createBaseCreateSecurityGroupRequest();
10859
+ let writer = undefined;
10860
+ while (reader.pos < end) {
10861
+ const tag = reader.uint32();
10862
+ switch (tag >>> 3) {
10863
+ case 1: {
10864
+ if (tag !== 10)
10865
+ break;
10866
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
10867
+ continue;
10868
+ }
10869
+ case 2: {
10870
+ if (tag !== 18)
10871
+ break;
10872
+ message.spec = exports.SecurityGroupSpec.decode(reader, reader.uint32());
10873
+ continue;
10874
+ }
10875
+ default:
10876
+ break;
10877
+ }
10878
+ if ((tag & 7) === 4 || tag === 0) {
10879
+ break;
10880
+ }
10881
+ {
10882
+ if (!writer)
10883
+ writer = new index_1.BinaryWriter();
10884
+ const skipped = reader.skip(tag & 7, tag >>> 3);
10885
+ writer.uint32(tag).raw(skipped);
10886
+ }
10887
+ }
10888
+ if (writer) {
10889
+ message[index_1.unknownFieldsSymbol] = writer.finish();
10890
+ }
10891
+ return message;
10892
+ },
10893
+ fromJSON(object) {
10894
+ return applyCreateSecurityGroupRequestCustom({
10895
+ $type: "nebius.vpc.v1.CreateSecurityGroupRequest",
10896
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
10897
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
10898
+ : undefined,
10899
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
10900
+ ? exports.SecurityGroupSpec.fromJSON(object.spec ?? object.spec)
10901
+ : undefined,
10902
+ });
10903
+ },
10904
+ toJSON(message, use = "json") {
10905
+ const obj = {};
10906
+ const pick = (json, pb) => (use === "json" ? json : pb);
10907
+ if (message.metadata !== undefined) {
10908
+ obj[pick("metadata", "metadata")] = message.metadata
10909
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
10910
+ : undefined;
10911
+ }
10912
+ if (message.spec !== undefined) {
10913
+ obj[pick("spec", "spec")] = message.spec
10914
+ ? exports.SecurityGroupSpec.toJSON(message.spec, use)
10915
+ : undefined;
10916
+ }
10917
+ return obj;
10918
+ },
10919
+ create(base) {
10920
+ return exports.CreateSecurityGroupRequest.fromPartial(base ?? {});
10921
+ },
10922
+ fromPartial(object) {
10923
+ const message = createBaseCreateSecurityGroupRequest();
10924
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
10925
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
10926
+ : undefined;
10927
+ message.spec = (object.spec !== undefined && object.spec !== null)
10928
+ ? exports.SecurityGroupSpec.fromPartial(object.spec)
10929
+ : undefined;
10930
+ return message;
10931
+ },
10932
+ };
10933
+ protobuf_1.protoRegistry.registerMessage(exports.CreateSecurityGroupRequest);
10934
+ function CreateSecurityGroupRequestCustomInspect() {
10935
+ const parts = [];
10936
+ if (this.metadata !== undefined)
10937
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
10938
+ if (this.spec !== undefined)
10939
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
10940
+ return `${this.$type}(${parts.join(", ")})`;
10941
+ }
10942
+ function CreateSecurityGroupRequestCustomJson() {
10943
+ const obj = {
10944
+ type: this.$type,
10945
+ };
10946
+ if (this.metadata !== undefined)
10947
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
10948
+ if (this.spec !== undefined)
10949
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
10950
+ return obj;
10951
+ }
10952
+ function applyCreateSecurityGroupRequestCustom(message) {
10953
+ message[logging_1.custom] = CreateSecurityGroupRequestCustomInspect;
10954
+ message[logging_1.customJson] = CreateSecurityGroupRequestCustomJson;
10955
+ return message;
10956
+ }
10957
+ function createBaseCreateSecurityGroupRequest() {
10958
+ const message = {
10959
+ $type: "nebius.vpc.v1.CreateSecurityGroupRequest",
10960
+ metadata: undefined,
10961
+ spec: undefined,
10962
+ };
10963
+ return applyCreateSecurityGroupRequestCustom(message);
10964
+ }
10965
+ exports.UpdateSecurityGroupRequest = {
10966
+ $type: "nebius.vpc.v1.UpdateSecurityGroupRequest",
10967
+ encode(message, writer = new index_1.BinaryWriter()) {
10968
+ if (message.metadata !== undefined) {
10969
+ const w = writer.uint32(10).fork();
10970
+ v1_1.ResourceMetadata.encode(message.metadata, w);
10971
+ w.join();
10972
+ }
10973
+ if (message.spec !== undefined) {
10974
+ const w = writer.uint32(18).fork();
10975
+ exports.SecurityGroupSpec.encode(message.spec, w);
10976
+ w.join();
10977
+ }
10978
+ if (message[index_1.unknownFieldsSymbol]) {
10979
+ writer.raw(message[index_1.unknownFieldsSymbol]);
10980
+ }
10981
+ return writer;
10982
+ },
10983
+ decode(input, length) {
10984
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
10985
+ const end = length === undefined ? reader.len : reader.pos + length;
10986
+ const message = createBaseUpdateSecurityGroupRequest();
10987
+ let writer = undefined;
10988
+ while (reader.pos < end) {
10989
+ const tag = reader.uint32();
10990
+ switch (tag >>> 3) {
10991
+ case 1: {
10992
+ if (tag !== 10)
10993
+ break;
10994
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
10995
+ continue;
10996
+ }
10997
+ case 2: {
10998
+ if (tag !== 18)
10999
+ break;
11000
+ message.spec = exports.SecurityGroupSpec.decode(reader, reader.uint32());
11001
+ continue;
11002
+ }
11003
+ default:
11004
+ break;
11005
+ }
11006
+ if ((tag & 7) === 4 || tag === 0) {
11007
+ break;
11008
+ }
11009
+ {
11010
+ if (!writer)
11011
+ writer = new index_1.BinaryWriter();
11012
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11013
+ writer.uint32(tag).raw(skipped);
11014
+ }
11015
+ }
11016
+ if (writer) {
11017
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11018
+ }
11019
+ return message;
11020
+ },
11021
+ fromJSON(object) {
11022
+ return applyUpdateSecurityGroupRequestCustom({
11023
+ $type: "nebius.vpc.v1.UpdateSecurityGroupRequest",
11024
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
11025
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
11026
+ : undefined,
11027
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
11028
+ ? exports.SecurityGroupSpec.fromJSON(object.spec ?? object.spec)
11029
+ : undefined,
11030
+ });
11031
+ },
11032
+ toJSON(message, use = "json") {
11033
+ const obj = {};
11034
+ const pick = (json, pb) => (use === "json" ? json : pb);
11035
+ if (message.metadata !== undefined) {
11036
+ obj[pick("metadata", "metadata")] = message.metadata
11037
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
11038
+ : undefined;
11039
+ }
11040
+ if (message.spec !== undefined) {
11041
+ obj[pick("spec", "spec")] = message.spec
11042
+ ? exports.SecurityGroupSpec.toJSON(message.spec, use)
11043
+ : undefined;
11044
+ }
11045
+ return obj;
11046
+ },
11047
+ create(base) {
11048
+ return exports.UpdateSecurityGroupRequest.fromPartial(base ?? {});
11049
+ },
11050
+ fromPartial(object) {
11051
+ const message = createBaseUpdateSecurityGroupRequest();
11052
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
11053
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
11054
+ : undefined;
11055
+ message.spec = (object.spec !== undefined && object.spec !== null)
11056
+ ? exports.SecurityGroupSpec.fromPartial(object.spec)
11057
+ : undefined;
11058
+ return message;
11059
+ },
11060
+ };
11061
+ protobuf_1.protoRegistry.registerMessage(exports.UpdateSecurityGroupRequest);
11062
+ function UpdateSecurityGroupRequestCustomInspect() {
11063
+ const parts = [];
11064
+ if (this.metadata !== undefined)
11065
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
11066
+ if (this.spec !== undefined)
11067
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
11068
+ return `${this.$type}(${parts.join(", ")})`;
11069
+ }
11070
+ function UpdateSecurityGroupRequestCustomJson() {
11071
+ const obj = {
11072
+ type: this.$type,
11073
+ };
11074
+ if (this.metadata !== undefined)
11075
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
11076
+ if (this.spec !== undefined)
11077
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
11078
+ return obj;
11079
+ }
11080
+ function applyUpdateSecurityGroupRequestCustom(message) {
11081
+ message[logging_1.custom] = UpdateSecurityGroupRequestCustomInspect;
11082
+ message[logging_1.customJson] = UpdateSecurityGroupRequestCustomJson;
11083
+ return message;
11084
+ }
11085
+ function createBaseUpdateSecurityGroupRequest() {
11086
+ const message = {
11087
+ $type: "nebius.vpc.v1.UpdateSecurityGroupRequest",
11088
+ metadata: undefined,
11089
+ spec: undefined,
11090
+ };
11091
+ return applyUpdateSecurityGroupRequestCustom(message);
11092
+ }
11093
+ exports.DeleteSecurityGroupRequest = {
11094
+ $type: "nebius.vpc.v1.DeleteSecurityGroupRequest",
11095
+ encode(message, writer = new index_1.BinaryWriter()) {
11096
+ if (message.id !== "") {
11097
+ writer.uint32(10).string(message.id);
11098
+ }
11099
+ if (message[index_1.unknownFieldsSymbol]) {
11100
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11101
+ }
11102
+ return writer;
11103
+ },
11104
+ decode(input, length) {
11105
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11106
+ const end = length === undefined ? reader.len : reader.pos + length;
11107
+ const message = createBaseDeleteSecurityGroupRequest();
11108
+ let writer = undefined;
11109
+ while (reader.pos < end) {
11110
+ const tag = reader.uint32();
11111
+ switch (tag >>> 3) {
11112
+ case 1: {
11113
+ if (tag !== 10)
11114
+ break;
11115
+ message.id = reader.string();
11116
+ continue;
11117
+ }
11118
+ default:
11119
+ break;
11120
+ }
11121
+ if ((tag & 7) === 4 || tag === 0) {
11122
+ break;
11123
+ }
11124
+ {
11125
+ if (!writer)
11126
+ writer = new index_1.BinaryWriter();
11127
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11128
+ writer.uint32(tag).raw(skipped);
11129
+ }
11130
+ }
11131
+ if (writer) {
11132
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11133
+ }
11134
+ return message;
11135
+ },
11136
+ fromJSON(object) {
11137
+ return applyDeleteSecurityGroupRequestCustom({
11138
+ $type: "nebius.vpc.v1.DeleteSecurityGroupRequest",
11139
+ id: (0, index_1.isSet)(object.id ?? object.id)
11140
+ ? String(object.id ?? object.id)
11141
+ : "",
11142
+ });
11143
+ },
11144
+ toJSON(message, use = "json") {
11145
+ const obj = {};
11146
+ const pick = (json, pb) => (use === "json" ? json : pb);
11147
+ if (message.id !== "") {
11148
+ obj[pick("id", "id")] = message.id;
11149
+ }
11150
+ return obj;
11151
+ },
11152
+ create(base) {
11153
+ return exports.DeleteSecurityGroupRequest.fromPartial(base ?? {});
11154
+ },
11155
+ fromPartial(object) {
11156
+ const message = createBaseDeleteSecurityGroupRequest();
11157
+ message.id = (object.id !== undefined && object.id !== null)
11158
+ ? object.id
11159
+ : "";
11160
+ return message;
11161
+ },
11162
+ };
11163
+ protobuf_1.protoRegistry.registerMessage(exports.DeleteSecurityGroupRequest);
11164
+ function DeleteSecurityGroupRequestCustomInspect() {
11165
+ const parts = [];
11166
+ if (this.id !== "")
11167
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
11168
+ return `${this.$type}(${parts.join(", ")})`;
11169
+ }
11170
+ function DeleteSecurityGroupRequestCustomJson() {
11171
+ const obj = {
11172
+ type: this.$type,
11173
+ };
11174
+ if (this.id !== "")
11175
+ obj.id = (0, logging_1.inspectJson)(this.id);
11176
+ return obj;
11177
+ }
11178
+ function applyDeleteSecurityGroupRequestCustom(message) {
11179
+ message[logging_1.custom] = DeleteSecurityGroupRequestCustomInspect;
11180
+ message[logging_1.customJson] = DeleteSecurityGroupRequestCustomJson;
11181
+ return message;
11182
+ }
11183
+ function createBaseDeleteSecurityGroupRequest() {
11184
+ const message = {
11185
+ $type: "nebius.vpc.v1.DeleteSecurityGroupRequest",
11186
+ id: "",
11187
+ };
11188
+ return applyDeleteSecurityGroupRequestCustom(message);
11189
+ }
11190
+ exports.SecurityGroupServiceServiceDescription = {
11191
+ get: {
11192
+ path: "/nebius.vpc.v1.SecurityGroupService/Get",
11193
+ requestStream: false,
11194
+ responseStream: false,
11195
+ requestSerialize: (value) => Buffer.from(exports.GetSecurityGroupRequest.encode(value).finish()),
11196
+ sendResetMask: false,
11197
+ requestDeserialize: (value) => exports.GetSecurityGroupRequest.decode(value),
11198
+ responseSerialize: (value) => Buffer.from(exports.SecurityGroup.encode(value).finish()),
11199
+ responseDeserialize: (value) => exports.SecurityGroup.decode(value),
11200
+ },
11201
+ getByName: {
11202
+ path: "/nebius.vpc.v1.SecurityGroupService/GetByName",
11203
+ requestStream: false,
11204
+ responseStream: false,
11205
+ requestSerialize: (value) => Buffer.from(exports.GetSecurityGroupByNameRequest.encode(value).finish()),
11206
+ sendResetMask: false,
11207
+ requestDeserialize: (value) => exports.GetSecurityGroupByNameRequest.decode(value),
11208
+ responseSerialize: (value) => Buffer.from(exports.SecurityGroup.encode(value).finish()),
11209
+ responseDeserialize: (value) => exports.SecurityGroup.decode(value),
11210
+ },
11211
+ list: {
11212
+ path: "/nebius.vpc.v1.SecurityGroupService/List",
11213
+ requestStream: false,
11214
+ responseStream: false,
11215
+ requestSerialize: (value) => Buffer.from(exports.ListSecurityGroupsRequest.encode(value).finish()),
11216
+ sendResetMask: false,
11217
+ requestDeserialize: (value) => exports.ListSecurityGroupsRequest.decode(value),
11218
+ responseSerialize: (value) => Buffer.from(exports.ListSecurityGroupsResponse.encode(value).finish()),
11219
+ responseDeserialize: (value) => exports.ListSecurityGroupsResponse.decode(value),
11220
+ },
11221
+ listByNetwork: {
11222
+ path: "/nebius.vpc.v1.SecurityGroupService/ListByNetwork",
11223
+ requestStream: false,
11224
+ responseStream: false,
11225
+ requestSerialize: (value) => Buffer.from(exports.ListSecurityGroupsByNetworkRequest.encode(value).finish()),
11226
+ sendResetMask: false,
11227
+ requestDeserialize: (value) => exports.ListSecurityGroupsByNetworkRequest.decode(value),
11228
+ responseSerialize: (value) => Buffer.from(exports.ListSecurityGroupsResponse.encode(value).finish()),
11229
+ responseDeserialize: (value) => exports.ListSecurityGroupsResponse.decode(value),
11230
+ },
11231
+ create: {
11232
+ path: "/nebius.vpc.v1.SecurityGroupService/Create",
11233
+ requestStream: false,
11234
+ responseStream: false,
11235
+ requestSerialize: (value) => Buffer.from(exports.CreateSecurityGroupRequest.encode(value).finish()),
11236
+ sendResetMask: false,
11237
+ requestDeserialize: (value) => exports.CreateSecurityGroupRequest.decode(value),
11238
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
11239
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
11240
+ },
11241
+ update: {
11242
+ path: "/nebius.vpc.v1.SecurityGroupService/Update",
11243
+ requestStream: false,
11244
+ responseStream: false,
11245
+ requestSerialize: (value) => Buffer.from(exports.UpdateSecurityGroupRequest.encode(value).finish()),
11246
+ sendResetMask: true,
11247
+ requestDeserialize: (value) => exports.UpdateSecurityGroupRequest.decode(value),
11248
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
11249
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
11250
+ },
11251
+ delete: {
11252
+ path: "/nebius.vpc.v1.SecurityGroupService/Delete",
11253
+ requestStream: false,
11254
+ responseStream: false,
11255
+ requestSerialize: (value) => Buffer.from(exports.DeleteSecurityGroupRequest.encode(value).finish()),
11256
+ sendResetMask: false,
11257
+ requestDeserialize: (value) => exports.DeleteSecurityGroupRequest.decode(value),
11258
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
11259
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
11260
+ },
11261
+ };
11262
+ exports.SecurityGroupServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.SecurityGroupServiceServiceDescription, "nebius.vpc.v1.SecurityGroupService");
11263
+ class SecurityGroupService {
11264
+ sdk;
11265
+ $type = "nebius.vpc.v1.SecurityGroupService";
11266
+ addr;
11267
+ spec;
11268
+ apiServiceName = "vpc";
11269
+ constructor(sdk) {
11270
+ this.sdk = sdk;
11271
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
11272
+ this.addr = addr;
11273
+ this.spec = exports.SecurityGroupServiceServiceDescription;
11274
+ }
11275
+ getOperationService() {
11276
+ return new v1_1.OperationService(this.sdk, this.addr);
11277
+ }
11278
+ get(...args) {
11279
+ const spec = this.spec.get;
11280
+ const request = args[0];
11281
+ const metadata = (args.length > 1 ? args[1] : undefined);
11282
+ const options = (args.length > 2 ? args[2] : undefined);
11283
+ const deserialize = spec.responseDeserialize;
11284
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11285
+ }
11286
+ getByName(...args) {
11287
+ const spec = this.spec.getByName;
11288
+ const request = args[0];
11289
+ const metadata = (args.length > 1 ? args[1] : undefined);
11290
+ const options = (args.length > 2 ? args[2] : undefined);
11291
+ const deserialize = spec.responseDeserialize;
11292
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11293
+ }
11294
+ list(...args) {
11295
+ const spec = this.spec.list;
11296
+ const request = args[0];
11297
+ const metadata = (args.length > 1 ? args[1] : undefined);
11298
+ const options = (args.length > 2 ? args[2] : undefined);
11299
+ const deserialize = spec.responseDeserialize;
11300
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11301
+ }
11302
+ listByNetwork(...args) {
11303
+ const spec = this.spec.listByNetwork;
11304
+ const request = args[0];
11305
+ const metadata = (args.length > 1 ? args[1] : undefined);
11306
+ const options = (args.length > 2 ? args[2] : undefined);
11307
+ const deserialize = spec.responseDeserialize;
11308
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11309
+ }
11310
+ create(...args) {
11311
+ const spec = this.spec.create;
11312
+ const request = args[0];
11313
+ const metadata = (args.length > 1 ? args[1] : undefined);
11314
+ const options = (args.length > 2 ? args[2] : undefined);
11315
+ const deserialize = (value) => {
11316
+ const resp = spec.responseDeserialize(value);
11317
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
11318
+ };
11319
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11320
+ }
11321
+ update(...args) {
11322
+ const spec = this.spec.update;
11323
+ const request = args[0];
11324
+ const metadata = (args.length > 1 ? args[1] : undefined);
11325
+ const options = (args.length > 2 ? args[2] : undefined);
11326
+ const deserialize = (value) => {
11327
+ const resp = spec.responseDeserialize(value);
11328
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
11329
+ };
11330
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11331
+ }
11332
+ delete(...args) {
11333
+ const spec = this.spec.delete;
11334
+ const request = args[0];
11335
+ const metadata = (args.length > 1 ? args[1] : undefined);
11336
+ const options = (args.length > 2 ? args[2] : undefined);
11337
+ const deserialize = (value) => {
11338
+ const resp = spec.responseDeserialize(value);
11339
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
11340
+ };
11341
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
11342
+ }
11343
+ }
11344
+ exports.SecurityGroupService = SecurityGroupService;
11345
+ const SecurityGroupStatus_State_VALUE_COMMENTS = {
11346
+ STATE_UNSPECIFIED: " Default state, unspecified.\n",
11347
+ READY: " Security group is ready for use.\n",
11348
+ };
11349
+ exports.SecurityGroupStatus_State = (0, index_1.createEnum)("nebius.vpc.v1.SecurityGroupStatus.State", {
11350
+ /**
11351
+ * Default state, unspecified.
11352
+ *
11353
+ */
11354
+ STATE_UNSPECIFIED: 0,
11355
+ /**
11356
+ * Security group is ready for use.
11357
+ *
11358
+ */
11359
+ READY: 2,
11360
+ }, SecurityGroupStatus_State_VALUE_COMMENTS);
11361
+ protobuf_1.protoRegistry.registerEnum(exports.SecurityGroupStatus_State);
11362
+ exports.SecurityGroup = {
11363
+ $type: "nebius.vpc.v1.SecurityGroup",
11364
+ encode(message, writer = new index_1.BinaryWriter()) {
11365
+ if (message.metadata !== undefined) {
11366
+ const w = writer.uint32(10).fork();
11367
+ v1_1.ResourceMetadata.encode(message.metadata, w);
11368
+ w.join();
11369
+ }
11370
+ if (message.spec !== undefined) {
11371
+ const w = writer.uint32(18).fork();
11372
+ exports.SecurityGroupSpec.encode(message.spec, w);
11373
+ w.join();
11374
+ }
11375
+ if (message.status !== undefined) {
11376
+ const w = writer.uint32(26).fork();
11377
+ exports.SecurityGroupStatus.encode(message.status, w);
11378
+ w.join();
11379
+ }
11380
+ if (message[index_1.unknownFieldsSymbol]) {
11381
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11382
+ }
11383
+ return writer;
11384
+ },
11385
+ decode(input, length) {
11386
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11387
+ const end = length === undefined ? reader.len : reader.pos + length;
11388
+ const message = createBaseSecurityGroup();
11389
+ let writer = undefined;
11390
+ while (reader.pos < end) {
11391
+ const tag = reader.uint32();
11392
+ switch (tag >>> 3) {
11393
+ case 1: {
11394
+ if (tag !== 10)
11395
+ break;
11396
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
11397
+ continue;
11398
+ }
11399
+ case 2: {
11400
+ if (tag !== 18)
11401
+ break;
11402
+ message.spec = exports.SecurityGroupSpec.decode(reader, reader.uint32());
11403
+ continue;
11404
+ }
11405
+ case 3: {
11406
+ if (tag !== 26)
11407
+ break;
11408
+ message.status = exports.SecurityGroupStatus.decode(reader, reader.uint32());
11409
+ continue;
11410
+ }
11411
+ default:
11412
+ break;
11413
+ }
11414
+ if ((tag & 7) === 4 || tag === 0) {
11415
+ break;
11416
+ }
11417
+ {
11418
+ if (!writer)
11419
+ writer = new index_1.BinaryWriter();
11420
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11421
+ writer.uint32(tag).raw(skipped);
11422
+ }
11423
+ }
11424
+ if (writer) {
11425
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11426
+ }
11427
+ return message;
11428
+ },
11429
+ fromJSON(object) {
11430
+ return applySecurityGroupCustom({
11431
+ $type: "nebius.vpc.v1.SecurityGroup",
11432
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
11433
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
11434
+ : undefined,
11435
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
11436
+ ? exports.SecurityGroupSpec.fromJSON(object.spec ?? object.spec)
11437
+ : undefined,
11438
+ status: (0, index_1.isSet)(object.status ?? object.status)
11439
+ ? exports.SecurityGroupStatus.fromJSON(object.status ?? object.status)
11440
+ : undefined,
11441
+ });
11442
+ },
11443
+ toJSON(message, use = "json") {
11444
+ const obj = {};
11445
+ const pick = (json, pb) => (use === "json" ? json : pb);
11446
+ if (message.metadata !== undefined) {
11447
+ obj[pick("metadata", "metadata")] = message.metadata
11448
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
11449
+ : undefined;
11450
+ }
11451
+ if (message.spec !== undefined) {
11452
+ obj[pick("spec", "spec")] = message.spec
11453
+ ? exports.SecurityGroupSpec.toJSON(message.spec, use)
11454
+ : undefined;
11455
+ }
11456
+ if (message.status !== undefined) {
11457
+ obj[pick("status", "status")] = message.status
11458
+ ? exports.SecurityGroupStatus.toJSON(message.status, use)
11459
+ : undefined;
11460
+ }
11461
+ return obj;
11462
+ },
11463
+ create(base) {
11464
+ return exports.SecurityGroup.fromPartial(base ?? {});
11465
+ },
11466
+ fromPartial(object) {
11467
+ const message = createBaseSecurityGroup();
11468
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
11469
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
11470
+ : undefined;
11471
+ message.spec = (object.spec !== undefined && object.spec !== null)
11472
+ ? exports.SecurityGroupSpec.fromPartial(object.spec)
11473
+ : undefined;
11474
+ message.status = (object.status !== undefined && object.status !== null)
11475
+ ? exports.SecurityGroupStatus.fromPartial(object.status)
11476
+ : undefined;
11477
+ return message;
11478
+ },
11479
+ };
11480
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityGroup);
11481
+ function SecurityGroupCustomInspect() {
11482
+ const parts = [];
11483
+ if (this.metadata !== undefined)
11484
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
11485
+ if (this.spec !== undefined)
11486
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
11487
+ if (this.status !== undefined)
11488
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
11489
+ return `${this.$type}(${parts.join(", ")})`;
11490
+ }
11491
+ function SecurityGroupCustomJson() {
11492
+ const obj = {
11493
+ type: this.$type,
11494
+ };
11495
+ if (this.metadata !== undefined)
11496
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
11497
+ if (this.spec !== undefined)
11498
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
11499
+ if (this.status !== undefined)
11500
+ obj.status = (0, logging_1.inspectJson)(this.status);
11501
+ return obj;
11502
+ }
11503
+ function applySecurityGroupCustom(message) {
11504
+ message[logging_1.custom] = SecurityGroupCustomInspect;
11505
+ message[logging_1.customJson] = SecurityGroupCustomJson;
11506
+ return message;
11507
+ }
11508
+ function createBaseSecurityGroup() {
11509
+ const message = {
11510
+ $type: "nebius.vpc.v1.SecurityGroup",
11511
+ metadata: undefined,
11512
+ spec: undefined,
11513
+ status: undefined,
11514
+ };
11515
+ return applySecurityGroupCustom(message);
11516
+ }
11517
+ exports.SecurityGroupSpec = {
11518
+ $type: "nebius.vpc.v1.SecurityGroupSpec",
11519
+ encode(message, writer = new index_1.BinaryWriter()) {
11520
+ if (message.networkId !== "") {
11521
+ writer.uint32(10).string(message.networkId);
11522
+ }
11523
+ if (message[index_1.unknownFieldsSymbol]) {
11524
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11525
+ }
11526
+ return writer;
11527
+ },
11528
+ decode(input, length) {
11529
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11530
+ const end = length === undefined ? reader.len : reader.pos + length;
11531
+ const message = createBaseSecurityGroupSpec();
11532
+ let writer = undefined;
11533
+ while (reader.pos < end) {
11534
+ const tag = reader.uint32();
11535
+ switch (tag >>> 3) {
11536
+ case 1: {
11537
+ if (tag !== 10)
11538
+ break;
11539
+ message.networkId = reader.string();
11540
+ continue;
11541
+ }
11542
+ default:
11543
+ break;
11544
+ }
11545
+ if ((tag & 7) === 4 || tag === 0) {
11546
+ break;
11547
+ }
11548
+ {
11549
+ if (!writer)
11550
+ writer = new index_1.BinaryWriter();
11551
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11552
+ writer.uint32(tag).raw(skipped);
11553
+ }
11554
+ }
11555
+ if (writer) {
11556
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11557
+ }
11558
+ return message;
11559
+ },
11560
+ fromJSON(object) {
11561
+ return applySecurityGroupSpecCustom({
11562
+ $type: "nebius.vpc.v1.SecurityGroupSpec",
11563
+ networkId: (0, index_1.isSet)(object.networkId ?? object.network_id)
11564
+ ? String(object.networkId ?? object.network_id)
11565
+ : "",
11566
+ });
11567
+ },
11568
+ toJSON(message, use = "json") {
11569
+ const obj = {};
11570
+ const pick = (json, pb) => (use === "json" ? json : pb);
11571
+ if (message.networkId !== "") {
11572
+ obj[pick("networkId", "network_id")] = message.networkId;
11573
+ }
11574
+ return obj;
11575
+ },
11576
+ create(base) {
11577
+ return exports.SecurityGroupSpec.fromPartial(base ?? {});
11578
+ },
11579
+ fromPartial(object) {
11580
+ const message = createBaseSecurityGroupSpec();
11581
+ message.networkId = (object.networkId !== undefined && object.networkId !== null)
11582
+ ? object.networkId
11583
+ : "";
11584
+ return message;
11585
+ },
11586
+ };
11587
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityGroupSpec);
11588
+ function SecurityGroupSpecCustomInspect() {
11589
+ const parts = [];
11590
+ if (this.networkId !== "")
11591
+ parts.push("networkId" + "=" + (0, util_1.inspect)(this.networkId));
11592
+ return `${this.$type}(${parts.join(", ")})`;
11593
+ }
11594
+ function SecurityGroupSpecCustomJson() {
11595
+ const obj = {
11596
+ type: this.$type,
11597
+ };
11598
+ if (this.networkId !== "")
11599
+ obj.networkId = (0, logging_1.inspectJson)(this.networkId);
11600
+ return obj;
11601
+ }
11602
+ function applySecurityGroupSpecCustom(message) {
11603
+ message[logging_1.custom] = SecurityGroupSpecCustomInspect;
11604
+ message[logging_1.customJson] = SecurityGroupSpecCustomJson;
11605
+ return message;
11606
+ }
11607
+ function createBaseSecurityGroupSpec() {
11608
+ const message = {
11609
+ $type: "nebius.vpc.v1.SecurityGroupSpec",
11610
+ networkId: "",
11611
+ };
11612
+ return applySecurityGroupSpecCustom(message);
11613
+ }
11614
+ exports.SecurityGroupStatus = {
11615
+ $type: "nebius.vpc.v1.SecurityGroupStatus",
11616
+ encode(message, writer = new index_1.BinaryWriter()) {
11617
+ if ((message.state ?? exports.SecurityGroupStatus_State.STATE_UNSPECIFIED) !== exports.SecurityGroupStatus_State.STATE_UNSPECIFIED) {
11618
+ exports.SecurityGroupStatus_State.encodeField(writer, 1, message.state);
11619
+ }
11620
+ if (message.default === true) {
11621
+ writer.uint32(16).bool(message.default);
11622
+ }
11623
+ if (message[index_1.unknownFieldsSymbol]) {
11624
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11625
+ }
11626
+ return writer;
11627
+ },
11628
+ decode(input, length) {
11629
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11630
+ const end = length === undefined ? reader.len : reader.pos + length;
11631
+ const message = createBaseSecurityGroupStatus();
11632
+ let writer = undefined;
11633
+ while (reader.pos < end) {
11634
+ const tag = reader.uint32();
11635
+ switch (tag >>> 3) {
11636
+ case 1: {
11637
+ if (tag !== 8)
11638
+ break;
11639
+ message.state = exports.SecurityGroupStatus_State.fromNumber(reader.int32());
11640
+ continue;
11641
+ }
11642
+ case 2: {
11643
+ if (tag !== 16)
11644
+ break;
11645
+ message.default = reader.bool();
11646
+ continue;
11647
+ }
11648
+ default:
11649
+ break;
11650
+ }
11651
+ if ((tag & 7) === 4 || tag === 0) {
11652
+ break;
11653
+ }
11654
+ {
11655
+ if (!writer)
11656
+ writer = new index_1.BinaryWriter();
11657
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11658
+ writer.uint32(tag).raw(skipped);
11659
+ }
11660
+ }
11661
+ if (writer) {
11662
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11663
+ }
11664
+ return message;
11665
+ },
11666
+ fromJSON(object) {
11667
+ return applySecurityGroupStatusCustom({
11668
+ $type: "nebius.vpc.v1.SecurityGroupStatus",
11669
+ state: (0, index_1.isSet)(object.state ?? object.state)
11670
+ ? exports.SecurityGroupStatus_State.fromJSON(object.state ?? object.state)
11671
+ : exports.SecurityGroupStatus_State.STATE_UNSPECIFIED,
11672
+ default: (0, index_1.isSet)(object.default ?? object.default)
11673
+ ? Boolean(object.default ?? object.default)
11674
+ : false,
11675
+ });
11676
+ },
11677
+ toJSON(message, use = "json") {
11678
+ const obj = {};
11679
+ const pick = (json, pb) => (use === "json" ? json : pb);
11680
+ if ((message.state ?? exports.SecurityGroupStatus_State.STATE_UNSPECIFIED) !== exports.SecurityGroupStatus_State.STATE_UNSPECIFIED) {
11681
+ obj[pick("state", "state")] = exports.SecurityGroupStatus_State.toJSON(message.state);
11682
+ }
11683
+ if (message.default === true) {
11684
+ obj[pick("default", "default")] = message.default;
11685
+ }
11686
+ return obj;
11687
+ },
11688
+ create(base) {
11689
+ return exports.SecurityGroupStatus.fromPartial(base ?? {});
11690
+ },
11691
+ fromPartial(object) {
11692
+ const message = createBaseSecurityGroupStatus();
11693
+ message.state = (object.state !== undefined && object.state !== null)
11694
+ ? exports.SecurityGroupStatus_State.fromJSON(object.state.name)
11695
+ : exports.SecurityGroupStatus_State.STATE_UNSPECIFIED;
11696
+ message.default = (object.default !== undefined && object.default !== null)
11697
+ ? object.default
11698
+ : false;
11699
+ return message;
11700
+ },
11701
+ };
11702
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityGroupStatus);
11703
+ function SecurityGroupStatusCustomInspect() {
11704
+ const parts = [];
11705
+ if (this.state !== undefined)
11706
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
11707
+ if (this.default === true)
11708
+ parts.push("default" + "=" + (0, util_1.inspect)(this.default));
11709
+ return `${this.$type}(${parts.join(", ")})`;
11710
+ }
11711
+ function SecurityGroupStatusCustomJson() {
11712
+ const obj = {
11713
+ type: this.$type,
11714
+ };
11715
+ if (this.state !== undefined)
11716
+ obj.state = (0, logging_1.inspectJson)(this.state);
11717
+ if (this.default === true)
11718
+ obj.default = (0, logging_1.inspectJson)(this.default);
11719
+ return obj;
11720
+ }
11721
+ function applySecurityGroupStatusCustom(message) {
11722
+ message[logging_1.custom] = SecurityGroupStatusCustomInspect;
11723
+ message[logging_1.customJson] = SecurityGroupStatusCustomJson;
11724
+ return message;
11725
+ }
11726
+ function createBaseSecurityGroupStatus() {
11727
+ const message = {
11728
+ $type: "nebius.vpc.v1.SecurityGroupStatus",
11729
+ state: exports.SecurityGroupStatus_State.STATE_UNSPECIFIED,
11730
+ default: false,
11731
+ };
11732
+ return applySecurityGroupStatusCustom(message);
11733
+ }
11734
+ exports.GetSecurityRuleRequest = {
11735
+ $type: "nebius.vpc.v1.GetSecurityRuleRequest",
11736
+ encode(message, writer = new index_1.BinaryWriter()) {
11737
+ if (message.id !== "") {
11738
+ writer.uint32(10).string(message.id);
11739
+ }
11740
+ if (message[index_1.unknownFieldsSymbol]) {
11741
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11742
+ }
11743
+ return writer;
11744
+ },
11745
+ decode(input, length) {
11746
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11747
+ const end = length === undefined ? reader.len : reader.pos + length;
11748
+ const message = createBaseGetSecurityRuleRequest();
11749
+ let writer = undefined;
11750
+ while (reader.pos < end) {
11751
+ const tag = reader.uint32();
11752
+ switch (tag >>> 3) {
11753
+ case 1: {
11754
+ if (tag !== 10)
11755
+ break;
11756
+ message.id = reader.string();
11757
+ continue;
11758
+ }
11759
+ default:
11760
+ break;
11761
+ }
11762
+ if ((tag & 7) === 4 || tag === 0) {
11763
+ break;
11764
+ }
11765
+ {
11766
+ if (!writer)
11767
+ writer = new index_1.BinaryWriter();
11768
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11769
+ writer.uint32(tag).raw(skipped);
11770
+ }
11771
+ }
11772
+ if (writer) {
11773
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11774
+ }
11775
+ return message;
11776
+ },
11777
+ fromJSON(object) {
11778
+ return applyGetSecurityRuleRequestCustom({
11779
+ $type: "nebius.vpc.v1.GetSecurityRuleRequest",
11780
+ id: (0, index_1.isSet)(object.id ?? object.id)
11781
+ ? String(object.id ?? object.id)
11782
+ : "",
11783
+ });
11784
+ },
11785
+ toJSON(message, use = "json") {
11786
+ const obj = {};
11787
+ const pick = (json, pb) => (use === "json" ? json : pb);
11788
+ if (message.id !== "") {
11789
+ obj[pick("id", "id")] = message.id;
11790
+ }
11791
+ return obj;
11792
+ },
11793
+ create(base) {
11794
+ return exports.GetSecurityRuleRequest.fromPartial(base ?? {});
11795
+ },
11796
+ fromPartial(object) {
11797
+ const message = createBaseGetSecurityRuleRequest();
11798
+ message.id = (object.id !== undefined && object.id !== null)
11799
+ ? object.id
11800
+ : "";
11801
+ return message;
11802
+ },
11803
+ };
11804
+ protobuf_1.protoRegistry.registerMessage(exports.GetSecurityRuleRequest);
11805
+ function GetSecurityRuleRequestCustomInspect() {
11806
+ const parts = [];
11807
+ if (this.id !== "")
11808
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
11809
+ return `${this.$type}(${parts.join(", ")})`;
11810
+ }
11811
+ function GetSecurityRuleRequestCustomJson() {
11812
+ const obj = {
11813
+ type: this.$type,
11814
+ };
11815
+ if (this.id !== "")
11816
+ obj.id = (0, logging_1.inspectJson)(this.id);
11817
+ return obj;
11818
+ }
11819
+ function applyGetSecurityRuleRequestCustom(message) {
11820
+ message[logging_1.custom] = GetSecurityRuleRequestCustomInspect;
11821
+ message[logging_1.customJson] = GetSecurityRuleRequestCustomJson;
11822
+ return message;
11823
+ }
11824
+ function createBaseGetSecurityRuleRequest() {
11825
+ const message = {
11826
+ $type: "nebius.vpc.v1.GetSecurityRuleRequest",
11827
+ id: "",
11828
+ };
11829
+ return applyGetSecurityRuleRequestCustom(message);
11830
+ }
11831
+ exports.GetSecurityRuleByNameRequest = {
11832
+ $type: "nebius.vpc.v1.GetSecurityRuleByNameRequest",
11833
+ encode(message, writer = new index_1.BinaryWriter()) {
11834
+ if (message.parentId !== "") {
11835
+ writer.uint32(10).string(message.parentId);
11836
+ }
11837
+ if (message.name !== "") {
11838
+ writer.uint32(18).string(message.name);
11839
+ }
11840
+ if (message[index_1.unknownFieldsSymbol]) {
11841
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11842
+ }
11843
+ return writer;
11844
+ },
11845
+ decode(input, length) {
11846
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11847
+ const end = length === undefined ? reader.len : reader.pos + length;
11848
+ const message = createBaseGetSecurityRuleByNameRequest();
11849
+ let writer = undefined;
11850
+ while (reader.pos < end) {
11851
+ const tag = reader.uint32();
11852
+ switch (tag >>> 3) {
11853
+ case 1: {
11854
+ if (tag !== 10)
11855
+ break;
11856
+ message.parentId = reader.string();
11857
+ continue;
11858
+ }
11859
+ case 2: {
11860
+ if (tag !== 18)
11861
+ break;
11862
+ message.name = reader.string();
11863
+ continue;
11864
+ }
11865
+ default:
11866
+ break;
11867
+ }
11868
+ if ((tag & 7) === 4 || tag === 0) {
11869
+ break;
11870
+ }
11871
+ {
11872
+ if (!writer)
11873
+ writer = new index_1.BinaryWriter();
11874
+ const skipped = reader.skip(tag & 7, tag >>> 3);
11875
+ writer.uint32(tag).raw(skipped);
11876
+ }
11877
+ }
11878
+ if (writer) {
11879
+ message[index_1.unknownFieldsSymbol] = writer.finish();
11880
+ }
11881
+ return message;
11882
+ },
11883
+ fromJSON(object) {
11884
+ return applyGetSecurityRuleByNameRequestCustom({
11885
+ $type: "nebius.vpc.v1.GetSecurityRuleByNameRequest",
11886
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
11887
+ ? String(object.parentId ?? object.parent_id)
11888
+ : "",
11889
+ name: (0, index_1.isSet)(object.name ?? object.name)
11890
+ ? String(object.name ?? object.name)
11891
+ : "",
11892
+ });
11893
+ },
11894
+ toJSON(message, use = "json") {
11895
+ const obj = {};
11896
+ const pick = (json, pb) => (use === "json" ? json : pb);
11897
+ if (message.parentId !== "") {
11898
+ obj[pick("parentId", "parent_id")] = message.parentId;
11899
+ }
11900
+ if (message.name !== "") {
11901
+ obj[pick("name", "name")] = message.name;
11902
+ }
11903
+ return obj;
11904
+ },
11905
+ create(base) {
11906
+ return exports.GetSecurityRuleByNameRequest.fromPartial(base ?? {});
11907
+ },
11908
+ fromPartial(object) {
11909
+ const message = createBaseGetSecurityRuleByNameRequest();
11910
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
11911
+ ? object.parentId
11912
+ : "";
11913
+ message.name = (object.name !== undefined && object.name !== null)
11914
+ ? object.name
11915
+ : "";
11916
+ return message;
11917
+ },
11918
+ };
11919
+ protobuf_1.protoRegistry.registerMessage(exports.GetSecurityRuleByNameRequest);
11920
+ function GetSecurityRuleByNameRequestCustomInspect() {
11921
+ const parts = [];
11922
+ if (this.parentId !== "")
11923
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
11924
+ if (this.name !== "")
11925
+ parts.push("name" + "=" + (0, util_1.inspect)(this.name));
11926
+ return `${this.$type}(${parts.join(", ")})`;
11927
+ }
11928
+ function GetSecurityRuleByNameRequestCustomJson() {
11929
+ const obj = {
11930
+ type: this.$type,
11931
+ };
11932
+ if (this.parentId !== "")
11933
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
11934
+ if (this.name !== "")
11935
+ obj.name = (0, logging_1.inspectJson)(this.name);
11936
+ return obj;
11937
+ }
11938
+ function applyGetSecurityRuleByNameRequestCustom(message) {
11939
+ message[logging_1.custom] = GetSecurityRuleByNameRequestCustomInspect;
11940
+ message[logging_1.customJson] = GetSecurityRuleByNameRequestCustomJson;
11941
+ return message;
11942
+ }
11943
+ function createBaseGetSecurityRuleByNameRequest() {
11944
+ const message = {
11945
+ $type: "nebius.vpc.v1.GetSecurityRuleByNameRequest",
11946
+ parentId: "",
11947
+ name: "",
11948
+ };
11949
+ return applyGetSecurityRuleByNameRequestCustom(message);
11950
+ }
11951
+ exports.ListSecurityRulesRequest = {
11952
+ $type: "nebius.vpc.v1.ListSecurityRulesRequest",
11953
+ encode(message, writer = new index_1.BinaryWriter()) {
11954
+ if (message.parentId !== "") {
11955
+ writer.uint32(10).string(message.parentId);
11956
+ }
11957
+ if (message.pageSize !== undefined && !message.pageSize.isZero?.()) {
11958
+ writer.uint32(16).int64(message.pageSize.toString());
11959
+ }
11960
+ if (message.pageToken !== "") {
11961
+ writer.uint32(26).string(message.pageToken);
11962
+ }
11963
+ if (message[index_1.unknownFieldsSymbol]) {
11964
+ writer.raw(message[index_1.unknownFieldsSymbol]);
11965
+ }
11966
+ return writer;
11967
+ },
11968
+ decode(input, length) {
11969
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
11970
+ const end = length === undefined ? reader.len : reader.pos + length;
11971
+ const message = createBaseListSecurityRulesRequest();
11972
+ let writer = undefined;
11973
+ while (reader.pos < end) {
11974
+ const tag = reader.uint32();
11975
+ switch (tag >>> 3) {
11976
+ case 1: {
11977
+ if (tag !== 10)
11978
+ break;
11979
+ message.parentId = reader.string();
11980
+ continue;
11981
+ }
11982
+ case 2: {
11983
+ if (tag !== 16)
11984
+ break;
11985
+ message.pageSize = index_1.Long.fromValue(reader.int64());
11986
+ continue;
11987
+ }
11988
+ case 3: {
11989
+ if (tag !== 26)
11990
+ break;
11991
+ message.pageToken = reader.string();
11992
+ continue;
11993
+ }
11994
+ default:
11995
+ break;
11996
+ }
11997
+ if ((tag & 7) === 4 || tag === 0) {
11998
+ break;
11999
+ }
12000
+ {
12001
+ if (!writer)
12002
+ writer = new index_1.BinaryWriter();
12003
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12004
+ writer.uint32(tag).raw(skipped);
12005
+ }
12006
+ }
12007
+ if (writer) {
12008
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12009
+ }
12010
+ return message;
12011
+ },
12012
+ fromJSON(object) {
12013
+ return applyListSecurityRulesRequestCustom({
12014
+ $type: "nebius.vpc.v1.ListSecurityRulesRequest",
12015
+ parentId: (0, index_1.isSet)(object.parentId ?? object.parent_id)
12016
+ ? String(object.parentId ?? object.parent_id)
12017
+ : "",
12018
+ pageSize: (0, index_1.isSet)(object.pageSize ?? object.page_size)
12019
+ ? index_1.Long.fromValue(object.pageSize ?? object.page_size)
12020
+ : index_1.Long.ZERO,
12021
+ pageToken: (0, index_1.isSet)(object.pageToken ?? object.page_token)
12022
+ ? String(object.pageToken ?? object.page_token)
12023
+ : "",
12024
+ });
12025
+ },
12026
+ toJSON(message, use = "json") {
12027
+ const obj = {};
12028
+ const pick = (json, pb) => (use === "json" ? json : pb);
12029
+ if (message.parentId !== "") {
12030
+ obj[pick("parentId", "parent_id")] = message.parentId;
12031
+ }
12032
+ if (!message.pageSize?.isZero?.()) {
12033
+ obj[pick("pageSize", "page_size")] = (message.pageSize || index_1.Long.ZERO).toString();
12034
+ }
12035
+ if (message.pageToken !== "") {
12036
+ obj[pick("pageToken", "page_token")] = message.pageToken;
12037
+ }
12038
+ return obj;
12039
+ },
12040
+ create(base) {
12041
+ return exports.ListSecurityRulesRequest.fromPartial(base ?? {});
12042
+ },
12043
+ fromPartial(object) {
12044
+ const message = createBaseListSecurityRulesRequest();
12045
+ message.parentId = (object.parentId !== undefined && object.parentId !== null)
12046
+ ? object.parentId
12047
+ : "";
12048
+ message.pageSize = (object.pageSize !== undefined && object.pageSize !== null)
12049
+ ? index_1.Long.fromValue(object.pageSize)
12050
+ : index_1.Long.ZERO;
12051
+ message.pageToken = (object.pageToken !== undefined && object.pageToken !== null)
12052
+ ? object.pageToken
12053
+ : "";
12054
+ return message;
12055
+ },
12056
+ };
12057
+ protobuf_1.protoRegistry.registerMessage(exports.ListSecurityRulesRequest);
12058
+ function ListSecurityRulesRequestCustomInspect() {
12059
+ const parts = [];
12060
+ if (this.parentId !== "")
12061
+ parts.push("parentId" + "=" + (0, util_1.inspect)(this.parentId));
12062
+ if (!this.pageSize?.isZero?.())
12063
+ parts.push("pageSize" + "=" + (0, util_1.inspect)(this.pageSize));
12064
+ if (this.pageToken !== "")
12065
+ parts.push("pageToken" + "=" + (0, util_1.inspect)(this.pageToken));
12066
+ return `${this.$type}(${parts.join(", ")})`;
12067
+ }
12068
+ function ListSecurityRulesRequestCustomJson() {
12069
+ const obj = {
12070
+ type: this.$type,
12071
+ };
12072
+ if (this.parentId !== "")
12073
+ obj.parentId = (0, logging_1.inspectJson)(this.parentId);
12074
+ if (!this.pageSize?.isZero?.())
12075
+ obj.pageSize = (0, logging_1.inspectJson)(this.pageSize);
12076
+ if (this.pageToken !== "")
12077
+ obj.pageToken = (0, logging_1.inspectJson)(this.pageToken);
12078
+ return obj;
12079
+ }
12080
+ function applyListSecurityRulesRequestCustom(message) {
12081
+ message[logging_1.custom] = ListSecurityRulesRequestCustomInspect;
12082
+ message[logging_1.customJson] = ListSecurityRulesRequestCustomJson;
12083
+ return message;
12084
+ }
12085
+ function createBaseListSecurityRulesRequest() {
12086
+ const message = {
12087
+ $type: "nebius.vpc.v1.ListSecurityRulesRequest",
12088
+ parentId: "",
12089
+ pageSize: index_1.Long.ZERO,
12090
+ pageToken: "",
12091
+ };
12092
+ return applyListSecurityRulesRequestCustom(message);
12093
+ }
12094
+ exports.ListSecurityRulesResponse = {
12095
+ $type: "nebius.vpc.v1.ListSecurityRulesResponse",
12096
+ encode(message, writer = new index_1.BinaryWriter()) {
12097
+ for (const v of (message.items ?? [])) {
12098
+ const w = writer.uint32(10).fork();
12099
+ exports.SecurityRule.encode(v, w);
12100
+ w.join();
12101
+ }
12102
+ if (message.nextPageToken !== "") {
12103
+ writer.uint32(18).string(message.nextPageToken);
12104
+ }
12105
+ if (message[index_1.unknownFieldsSymbol]) {
12106
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12107
+ }
12108
+ return writer;
12109
+ },
12110
+ decode(input, length) {
12111
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12112
+ const end = length === undefined ? reader.len : reader.pos + length;
12113
+ const message = createBaseListSecurityRulesResponse();
12114
+ let writer = undefined;
12115
+ while (reader.pos < end) {
12116
+ const tag = reader.uint32();
12117
+ switch (tag >>> 3) {
12118
+ case 1: {
12119
+ if (tag !== 10)
12120
+ break;
12121
+ message.items.push(exports.SecurityRule.decode(reader, reader.uint32()));
12122
+ continue;
12123
+ }
12124
+ case 2: {
12125
+ if (tag !== 18)
12126
+ break;
12127
+ message.nextPageToken = reader.string();
12128
+ continue;
12129
+ }
12130
+ default:
12131
+ break;
12132
+ }
12133
+ if ((tag & 7) === 4 || tag === 0) {
12134
+ break;
12135
+ }
12136
+ {
12137
+ if (!writer)
12138
+ writer = new index_1.BinaryWriter();
12139
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12140
+ writer.uint32(tag).raw(skipped);
12141
+ }
12142
+ }
12143
+ if (writer) {
12144
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12145
+ }
12146
+ return message;
12147
+ },
12148
+ fromJSON(object) {
12149
+ return applyListSecurityRulesResponseCustom({
12150
+ $type: "nebius.vpc.v1.ListSecurityRulesResponse",
12151
+ items: globalThis.Array.isArray(object?.items ?? object?.items)
12152
+ ? (object.items ?? object.items).map((e) => exports.SecurityRule.fromJSON(e))
12153
+ : [],
12154
+ nextPageToken: (0, index_1.isSet)(object.nextPageToken ?? object.next_page_token)
12155
+ ? String(object.nextPageToken ?? object.next_page_token)
12156
+ : "",
12157
+ });
12158
+ },
12159
+ toJSON(message, use = "json") {
12160
+ const obj = {};
12161
+ const pick = (json, pb) => (use === "json" ? json : pb);
12162
+ if (message.items?.length) {
12163
+ obj[pick("items", "items")] = message.items.map((e) => e ? exports.SecurityRule.toJSON(e, use) : undefined);
12164
+ }
12165
+ if (message.nextPageToken !== "") {
12166
+ obj[pick("nextPageToken", "next_page_token")] = message.nextPageToken;
12167
+ }
12168
+ return obj;
12169
+ },
12170
+ create(base) {
12171
+ return exports.ListSecurityRulesResponse.fromPartial(base ?? {});
12172
+ },
12173
+ fromPartial(object) {
12174
+ const message = createBaseListSecurityRulesResponse();
12175
+ message.items = object.items?.map((e) => exports.SecurityRule.fromPartial(e)) || [];
12176
+ message.nextPageToken = (object.nextPageToken !== undefined && object.nextPageToken !== null)
12177
+ ? object.nextPageToken
12178
+ : "";
12179
+ return message;
12180
+ },
12181
+ };
12182
+ protobuf_1.protoRegistry.registerMessage(exports.ListSecurityRulesResponse);
12183
+ function ListSecurityRulesResponseCustomInspect() {
12184
+ const parts = [];
12185
+ if ((this.items?.length ?? 0) !== 0)
12186
+ parts.push("items" + "=" + (0, util_1.inspect)(this.items));
12187
+ if (this.nextPageToken !== "")
12188
+ parts.push("nextPageToken" + "=" + (0, util_1.inspect)(this.nextPageToken));
12189
+ return `${this.$type}(${parts.join(", ")})`;
12190
+ }
12191
+ function ListSecurityRulesResponseCustomJson() {
12192
+ const obj = {
12193
+ type: this.$type,
12194
+ };
12195
+ if ((this.items?.length ?? 0) !== 0)
12196
+ obj.items = (0, logging_1.inspectJson)(this.items);
12197
+ if (this.nextPageToken !== "")
12198
+ obj.nextPageToken = (0, logging_1.inspectJson)(this.nextPageToken);
12199
+ return obj;
12200
+ }
12201
+ function applyListSecurityRulesResponseCustom(message) {
12202
+ message[logging_1.custom] = ListSecurityRulesResponseCustomInspect;
12203
+ message[logging_1.customJson] = ListSecurityRulesResponseCustomJson;
12204
+ return message;
12205
+ }
12206
+ function createBaseListSecurityRulesResponse() {
12207
+ const message = {
12208
+ $type: "nebius.vpc.v1.ListSecurityRulesResponse",
12209
+ items: [],
12210
+ nextPageToken: "",
12211
+ };
12212
+ return applyListSecurityRulesResponseCustom(message);
12213
+ }
12214
+ exports.CreateSecurityRuleRequest = {
12215
+ $type: "nebius.vpc.v1.CreateSecurityRuleRequest",
12216
+ encode(message, writer = new index_1.BinaryWriter()) {
12217
+ if (message.metadata !== undefined) {
12218
+ const w = writer.uint32(10).fork();
12219
+ v1_1.ResourceMetadata.encode(message.metadata, w);
12220
+ w.join();
12221
+ }
12222
+ if (message.spec !== undefined) {
12223
+ const w = writer.uint32(18).fork();
12224
+ exports.SecurityRuleSpec.encode(message.spec, w);
12225
+ w.join();
12226
+ }
12227
+ if (message[index_1.unknownFieldsSymbol]) {
12228
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12229
+ }
12230
+ return writer;
12231
+ },
12232
+ decode(input, length) {
12233
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12234
+ const end = length === undefined ? reader.len : reader.pos + length;
12235
+ const message = createBaseCreateSecurityRuleRequest();
12236
+ let writer = undefined;
12237
+ while (reader.pos < end) {
12238
+ const tag = reader.uint32();
12239
+ switch (tag >>> 3) {
12240
+ case 1: {
12241
+ if (tag !== 10)
12242
+ break;
12243
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
12244
+ continue;
12245
+ }
12246
+ case 2: {
12247
+ if (tag !== 18)
12248
+ break;
12249
+ message.spec = exports.SecurityRuleSpec.decode(reader, reader.uint32());
12250
+ continue;
12251
+ }
12252
+ default:
12253
+ break;
12254
+ }
12255
+ if ((tag & 7) === 4 || tag === 0) {
12256
+ break;
12257
+ }
12258
+ {
12259
+ if (!writer)
12260
+ writer = new index_1.BinaryWriter();
12261
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12262
+ writer.uint32(tag).raw(skipped);
12263
+ }
12264
+ }
12265
+ if (writer) {
12266
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12267
+ }
12268
+ return message;
12269
+ },
12270
+ fromJSON(object) {
12271
+ return applyCreateSecurityRuleRequestCustom({
12272
+ $type: "nebius.vpc.v1.CreateSecurityRuleRequest",
12273
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
12274
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
12275
+ : undefined,
12276
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
12277
+ ? exports.SecurityRuleSpec.fromJSON(object.spec ?? object.spec)
12278
+ : undefined,
12279
+ });
12280
+ },
12281
+ toJSON(message, use = "json") {
12282
+ const obj = {};
12283
+ const pick = (json, pb) => (use === "json" ? json : pb);
12284
+ if (message.metadata !== undefined) {
12285
+ obj[pick("metadata", "metadata")] = message.metadata
12286
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
12287
+ : undefined;
12288
+ }
12289
+ if (message.spec !== undefined) {
12290
+ obj[pick("spec", "spec")] = message.spec
12291
+ ? exports.SecurityRuleSpec.toJSON(message.spec, use)
12292
+ : undefined;
12293
+ }
12294
+ return obj;
12295
+ },
12296
+ create(base) {
12297
+ return exports.CreateSecurityRuleRequest.fromPartial(base ?? {});
12298
+ },
12299
+ fromPartial(object) {
12300
+ const message = createBaseCreateSecurityRuleRequest();
12301
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
12302
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
12303
+ : undefined;
12304
+ message.spec = (object.spec !== undefined && object.spec !== null)
12305
+ ? exports.SecurityRuleSpec.fromPartial(object.spec)
12306
+ : undefined;
12307
+ return message;
12308
+ },
12309
+ };
12310
+ protobuf_1.protoRegistry.registerMessage(exports.CreateSecurityRuleRequest);
12311
+ function CreateSecurityRuleRequestCustomInspect() {
12312
+ const parts = [];
12313
+ if (this.metadata !== undefined)
12314
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
12315
+ if (this.spec !== undefined)
12316
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
12317
+ return `${this.$type}(${parts.join(", ")})`;
12318
+ }
12319
+ function CreateSecurityRuleRequestCustomJson() {
12320
+ const obj = {
12321
+ type: this.$type,
12322
+ };
12323
+ if (this.metadata !== undefined)
12324
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
12325
+ if (this.spec !== undefined)
12326
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
12327
+ return obj;
12328
+ }
12329
+ function applyCreateSecurityRuleRequestCustom(message) {
12330
+ message[logging_1.custom] = CreateSecurityRuleRequestCustomInspect;
12331
+ message[logging_1.customJson] = CreateSecurityRuleRequestCustomJson;
12332
+ return message;
12333
+ }
12334
+ function createBaseCreateSecurityRuleRequest() {
12335
+ const message = {
12336
+ $type: "nebius.vpc.v1.CreateSecurityRuleRequest",
12337
+ metadata: undefined,
12338
+ spec: undefined,
12339
+ };
12340
+ return applyCreateSecurityRuleRequestCustom(message);
12341
+ }
12342
+ exports.UpdateSecurityRuleRequest = {
12343
+ $type: "nebius.vpc.v1.UpdateSecurityRuleRequest",
12344
+ encode(message, writer = new index_1.BinaryWriter()) {
12345
+ if (message.metadata !== undefined) {
12346
+ const w = writer.uint32(10).fork();
12347
+ v1_1.ResourceMetadata.encode(message.metadata, w);
12348
+ w.join();
12349
+ }
12350
+ if (message.spec !== undefined) {
12351
+ const w = writer.uint32(18).fork();
12352
+ exports.SecurityRuleSpec.encode(message.spec, w);
12353
+ w.join();
12354
+ }
12355
+ if (message[index_1.unknownFieldsSymbol]) {
12356
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12357
+ }
12358
+ return writer;
12359
+ },
12360
+ decode(input, length) {
12361
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12362
+ const end = length === undefined ? reader.len : reader.pos + length;
12363
+ const message = createBaseUpdateSecurityRuleRequest();
12364
+ let writer = undefined;
12365
+ while (reader.pos < end) {
12366
+ const tag = reader.uint32();
12367
+ switch (tag >>> 3) {
12368
+ case 1: {
12369
+ if (tag !== 10)
12370
+ break;
12371
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
12372
+ continue;
12373
+ }
12374
+ case 2: {
12375
+ if (tag !== 18)
12376
+ break;
12377
+ message.spec = exports.SecurityRuleSpec.decode(reader, reader.uint32());
12378
+ continue;
12379
+ }
12380
+ default:
12381
+ break;
12382
+ }
12383
+ if ((tag & 7) === 4 || tag === 0) {
12384
+ break;
12385
+ }
12386
+ {
12387
+ if (!writer)
12388
+ writer = new index_1.BinaryWriter();
12389
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12390
+ writer.uint32(tag).raw(skipped);
12391
+ }
12392
+ }
12393
+ if (writer) {
12394
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12395
+ }
12396
+ return message;
12397
+ },
12398
+ fromJSON(object) {
12399
+ return applyUpdateSecurityRuleRequestCustom({
12400
+ $type: "nebius.vpc.v1.UpdateSecurityRuleRequest",
12401
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
12402
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
12403
+ : undefined,
12404
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
12405
+ ? exports.SecurityRuleSpec.fromJSON(object.spec ?? object.spec)
12406
+ : undefined,
12407
+ });
12408
+ },
12409
+ toJSON(message, use = "json") {
12410
+ const obj = {};
12411
+ const pick = (json, pb) => (use === "json" ? json : pb);
12412
+ if (message.metadata !== undefined) {
12413
+ obj[pick("metadata", "metadata")] = message.metadata
12414
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
12415
+ : undefined;
12416
+ }
12417
+ if (message.spec !== undefined) {
12418
+ obj[pick("spec", "spec")] = message.spec
12419
+ ? exports.SecurityRuleSpec.toJSON(message.spec, use)
12420
+ : undefined;
12421
+ }
12422
+ return obj;
12423
+ },
12424
+ create(base) {
12425
+ return exports.UpdateSecurityRuleRequest.fromPartial(base ?? {});
12426
+ },
12427
+ fromPartial(object) {
12428
+ const message = createBaseUpdateSecurityRuleRequest();
12429
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
12430
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
12431
+ : undefined;
12432
+ message.spec = (object.spec !== undefined && object.spec !== null)
12433
+ ? exports.SecurityRuleSpec.fromPartial(object.spec)
12434
+ : undefined;
12435
+ return message;
12436
+ },
12437
+ };
12438
+ protobuf_1.protoRegistry.registerMessage(exports.UpdateSecurityRuleRequest);
12439
+ function UpdateSecurityRuleRequestCustomInspect() {
12440
+ const parts = [];
12441
+ if (this.metadata !== undefined)
12442
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
12443
+ if (this.spec !== undefined)
12444
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
12445
+ return `${this.$type}(${parts.join(", ")})`;
12446
+ }
12447
+ function UpdateSecurityRuleRequestCustomJson() {
12448
+ const obj = {
12449
+ type: this.$type,
12450
+ };
12451
+ if (this.metadata !== undefined)
12452
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
12453
+ if (this.spec !== undefined)
12454
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
12455
+ return obj;
12456
+ }
12457
+ function applyUpdateSecurityRuleRequestCustom(message) {
12458
+ message[logging_1.custom] = UpdateSecurityRuleRequestCustomInspect;
12459
+ message[logging_1.customJson] = UpdateSecurityRuleRequestCustomJson;
12460
+ return message;
12461
+ }
12462
+ function createBaseUpdateSecurityRuleRequest() {
12463
+ const message = {
12464
+ $type: "nebius.vpc.v1.UpdateSecurityRuleRequest",
12465
+ metadata: undefined,
12466
+ spec: undefined,
12467
+ };
12468
+ return applyUpdateSecurityRuleRequestCustom(message);
12469
+ }
12470
+ exports.DeleteSecurityRuleRequest = {
12471
+ $type: "nebius.vpc.v1.DeleteSecurityRuleRequest",
12472
+ encode(message, writer = new index_1.BinaryWriter()) {
12473
+ if (message.id !== "") {
12474
+ writer.uint32(10).string(message.id);
12475
+ }
12476
+ if (message[index_1.unknownFieldsSymbol]) {
12477
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12478
+ }
12479
+ return writer;
12480
+ },
12481
+ decode(input, length) {
12482
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12483
+ const end = length === undefined ? reader.len : reader.pos + length;
12484
+ const message = createBaseDeleteSecurityRuleRequest();
12485
+ let writer = undefined;
12486
+ while (reader.pos < end) {
12487
+ const tag = reader.uint32();
12488
+ switch (tag >>> 3) {
12489
+ case 1: {
12490
+ if (tag !== 10)
12491
+ break;
12492
+ message.id = reader.string();
12493
+ continue;
12494
+ }
12495
+ default:
12496
+ break;
12497
+ }
12498
+ if ((tag & 7) === 4 || tag === 0) {
12499
+ break;
12500
+ }
12501
+ {
12502
+ if (!writer)
12503
+ writer = new index_1.BinaryWriter();
12504
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12505
+ writer.uint32(tag).raw(skipped);
12506
+ }
12507
+ }
12508
+ if (writer) {
12509
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12510
+ }
12511
+ return message;
12512
+ },
12513
+ fromJSON(object) {
12514
+ return applyDeleteSecurityRuleRequestCustom({
12515
+ $type: "nebius.vpc.v1.DeleteSecurityRuleRequest",
12516
+ id: (0, index_1.isSet)(object.id ?? object.id)
12517
+ ? String(object.id ?? object.id)
12518
+ : "",
12519
+ });
12520
+ },
12521
+ toJSON(message, use = "json") {
12522
+ const obj = {};
12523
+ const pick = (json, pb) => (use === "json" ? json : pb);
12524
+ if (message.id !== "") {
12525
+ obj[pick("id", "id")] = message.id;
12526
+ }
12527
+ return obj;
12528
+ },
12529
+ create(base) {
12530
+ return exports.DeleteSecurityRuleRequest.fromPartial(base ?? {});
12531
+ },
12532
+ fromPartial(object) {
12533
+ const message = createBaseDeleteSecurityRuleRequest();
12534
+ message.id = (object.id !== undefined && object.id !== null)
12535
+ ? object.id
12536
+ : "";
12537
+ return message;
12538
+ },
12539
+ };
12540
+ protobuf_1.protoRegistry.registerMessage(exports.DeleteSecurityRuleRequest);
12541
+ function DeleteSecurityRuleRequestCustomInspect() {
12542
+ const parts = [];
12543
+ if (this.id !== "")
12544
+ parts.push("id" + "=" + (0, util_1.inspect)(this.id));
12545
+ return `${this.$type}(${parts.join(", ")})`;
12546
+ }
12547
+ function DeleteSecurityRuleRequestCustomJson() {
12548
+ const obj = {
12549
+ type: this.$type,
12550
+ };
12551
+ if (this.id !== "")
12552
+ obj.id = (0, logging_1.inspectJson)(this.id);
12553
+ return obj;
12554
+ }
12555
+ function applyDeleteSecurityRuleRequestCustom(message) {
12556
+ message[logging_1.custom] = DeleteSecurityRuleRequestCustomInspect;
12557
+ message[logging_1.customJson] = DeleteSecurityRuleRequestCustomJson;
12558
+ return message;
12559
+ }
12560
+ function createBaseDeleteSecurityRuleRequest() {
12561
+ const message = {
12562
+ $type: "nebius.vpc.v1.DeleteSecurityRuleRequest",
12563
+ id: "",
12564
+ };
12565
+ return applyDeleteSecurityRuleRequestCustom(message);
12566
+ }
12567
+ exports.SecurityRuleServiceServiceDescription = {
12568
+ get: {
12569
+ path: "/nebius.vpc.v1.SecurityRuleService/Get",
12570
+ requestStream: false,
12571
+ responseStream: false,
12572
+ requestSerialize: (value) => Buffer.from(exports.GetSecurityRuleRequest.encode(value).finish()),
12573
+ sendResetMask: false,
12574
+ requestDeserialize: (value) => exports.GetSecurityRuleRequest.decode(value),
12575
+ responseSerialize: (value) => Buffer.from(exports.SecurityRule.encode(value).finish()),
12576
+ responseDeserialize: (value) => exports.SecurityRule.decode(value),
12577
+ },
12578
+ getByName: {
12579
+ path: "/nebius.vpc.v1.SecurityRuleService/GetByName",
12580
+ requestStream: false,
12581
+ responseStream: false,
12582
+ requestSerialize: (value) => Buffer.from(exports.GetSecurityRuleByNameRequest.encode(value).finish()),
12583
+ sendResetMask: false,
12584
+ requestDeserialize: (value) => exports.GetSecurityRuleByNameRequest.decode(value),
12585
+ responseSerialize: (value) => Buffer.from(exports.SecurityRule.encode(value).finish()),
12586
+ responseDeserialize: (value) => exports.SecurityRule.decode(value),
12587
+ },
12588
+ list: {
12589
+ path: "/nebius.vpc.v1.SecurityRuleService/List",
12590
+ requestStream: false,
12591
+ responseStream: false,
12592
+ requestSerialize: (value) => Buffer.from(exports.ListSecurityRulesRequest.encode(value).finish()),
12593
+ sendResetMask: false,
12594
+ requestDeserialize: (value) => exports.ListSecurityRulesRequest.decode(value),
12595
+ responseSerialize: (value) => Buffer.from(exports.ListSecurityRulesResponse.encode(value).finish()),
12596
+ responseDeserialize: (value) => exports.ListSecurityRulesResponse.decode(value),
12597
+ },
12598
+ create: {
12599
+ path: "/nebius.vpc.v1.SecurityRuleService/Create",
12600
+ requestStream: false,
12601
+ responseStream: false,
12602
+ requestSerialize: (value) => Buffer.from(exports.CreateSecurityRuleRequest.encode(value).finish()),
12603
+ sendResetMask: false,
12604
+ requestDeserialize: (value) => exports.CreateSecurityRuleRequest.decode(value),
12605
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
12606
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
12607
+ },
12608
+ update: {
12609
+ path: "/nebius.vpc.v1.SecurityRuleService/Update",
12610
+ requestStream: false,
12611
+ responseStream: false,
12612
+ requestSerialize: (value) => Buffer.from(exports.UpdateSecurityRuleRequest.encode(value).finish()),
12613
+ sendResetMask: true,
12614
+ requestDeserialize: (value) => exports.UpdateSecurityRuleRequest.decode(value),
12615
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
12616
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
12617
+ },
12618
+ delete: {
12619
+ path: "/nebius.vpc.v1.SecurityRuleService/Delete",
12620
+ requestStream: false,
12621
+ responseStream: false,
12622
+ requestSerialize: (value) => Buffer.from(exports.DeleteSecurityRuleRequest.encode(value).finish()),
12623
+ sendResetMask: false,
12624
+ requestDeserialize: (value) => exports.DeleteSecurityRuleRequest.decode(value),
12625
+ responseSerialize: (value) => Buffer.from(v1_1.Operation.encode(value).finish()),
12626
+ responseDeserialize: (value) => v1_1.Operation.decode(value),
12627
+ },
12628
+ };
12629
+ exports.SecurityRuleServiceBaseClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.SecurityRuleServiceServiceDescription, "nebius.vpc.v1.SecurityRuleService");
12630
+ class SecurityRuleService {
12631
+ sdk;
12632
+ $type = "nebius.vpc.v1.SecurityRuleService";
12633
+ addr;
12634
+ spec;
12635
+ apiServiceName = "vpc";
12636
+ constructor(sdk) {
12637
+ this.sdk = sdk;
12638
+ const addr = sdk.getAddressFromServiceName(this.$type, this.apiServiceName);
12639
+ this.addr = addr;
12640
+ this.spec = exports.SecurityRuleServiceServiceDescription;
12641
+ }
12642
+ getOperationService() {
12643
+ return new v1_1.OperationService(this.sdk, this.addr);
12644
+ }
12645
+ get(...args) {
12646
+ const spec = this.spec.get;
12647
+ const request = args[0];
12648
+ const metadata = (args.length > 1 ? args[1] : undefined);
12649
+ const options = (args.length > 2 ? args[2] : undefined);
12650
+ const deserialize = spec.responseDeserialize;
12651
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12652
+ }
12653
+ getByName(...args) {
12654
+ const spec = this.spec.getByName;
12655
+ const request = args[0];
12656
+ const metadata = (args.length > 1 ? args[1] : undefined);
12657
+ const options = (args.length > 2 ? args[2] : undefined);
12658
+ const deserialize = spec.responseDeserialize;
12659
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12660
+ }
12661
+ list(...args) {
12662
+ const spec = this.spec.list;
12663
+ const request = args[0];
12664
+ const metadata = (args.length > 1 ? args[1] : undefined);
12665
+ const options = (args.length > 2 ? args[2] : undefined);
12666
+ const deserialize = spec.responseDeserialize;
12667
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12668
+ }
12669
+ create(...args) {
12670
+ const spec = this.spec.create;
12671
+ const request = args[0];
12672
+ const metadata = (args.length > 1 ? args[1] : undefined);
12673
+ const options = (args.length > 2 ? args[2] : undefined);
12674
+ const deserialize = (value) => {
12675
+ const resp = spec.responseDeserialize(value);
12676
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
12677
+ };
12678
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12679
+ }
12680
+ update(...args) {
12681
+ const spec = this.spec.update;
12682
+ const request = args[0];
12683
+ const metadata = (args.length > 1 ? args[1] : undefined);
12684
+ const options = (args.length > 2 ? args[2] : undefined);
12685
+ const deserialize = (value) => {
12686
+ const resp = spec.responseDeserialize(value);
12687
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
12688
+ };
12689
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12690
+ }
12691
+ delete(...args) {
12692
+ const spec = this.spec.delete;
12693
+ const request = args[0];
12694
+ const metadata = (args.length > 1 ? args[1] : undefined);
12695
+ const options = (args.length > 2 ? args[2] : undefined);
12696
+ const deserialize = (value) => {
12697
+ const resp = spec.responseDeserialize(value);
12698
+ return new operation_1.Operation(resp, this.getOperationService(), this.sdk.logger.child("operation"));
12699
+ };
12700
+ return new request_1.Request(this.sdk, spec, this.addr, deserialize, request, metadata, options);
12701
+ }
12702
+ }
12703
+ exports.SecurityRuleService = SecurityRuleService;
12704
+ exports.RuleDirection = (0, index_1.createEnum)("nebius.vpc.v1.RuleDirection", {
12705
+ DIRECTION_UNSPECIFIED: 0,
12706
+ INGRESS: 1,
12707
+ EGRESS: 2,
12708
+ });
12709
+ protobuf_1.protoRegistry.registerEnum(exports.RuleDirection);
12710
+ exports.RuleProtocol = (0, index_1.createEnum)("nebius.vpc.v1.RuleProtocol", {
12711
+ PROTOCOL_UNSPECIFIED: 0,
12712
+ ANY: 1,
12713
+ TCP: 2,
12714
+ UDP: 3,
12715
+ ICMP: 4,
12716
+ });
12717
+ protobuf_1.protoRegistry.registerEnum(exports.RuleProtocol);
12718
+ exports.RuleAccessAction = (0, index_1.createEnum)("nebius.vpc.v1.RuleAccessAction", {
12719
+ ACCESS_UNSPECIFIED: 0,
12720
+ ALLOW: 1,
12721
+ DENY: 2,
12722
+ });
12723
+ protobuf_1.protoRegistry.registerEnum(exports.RuleAccessAction);
12724
+ exports.RuleType = (0, index_1.createEnum)("nebius.vpc.v1.RuleType", {
12725
+ RULE_TYPE_UNSPECIFIED: 0,
12726
+ STATEFUL: 1,
12727
+ STATELESS: 2,
12728
+ });
12729
+ protobuf_1.protoRegistry.registerEnum(exports.RuleType);
12730
+ exports.SecurityRuleStatus_State = (0, index_1.createEnum)("nebius.vpc.v1.SecurityRuleStatus.State", {
12731
+ STATE_UNSPECIFIED: 0,
12732
+ CREATING: 1,
12733
+ READY: 2,
12734
+ DELETING: 3,
12735
+ });
12736
+ protobuf_1.protoRegistry.registerEnum(exports.SecurityRuleStatus_State);
12737
+ exports.SecurityRule = {
12738
+ $type: "nebius.vpc.v1.SecurityRule",
12739
+ encode(message, writer = new index_1.BinaryWriter()) {
12740
+ if (message.metadata !== undefined) {
12741
+ const w = writer.uint32(10).fork();
12742
+ v1_1.ResourceMetadata.encode(message.metadata, w);
12743
+ w.join();
12744
+ }
12745
+ if (message.spec !== undefined) {
12746
+ const w = writer.uint32(18).fork();
12747
+ exports.SecurityRuleSpec.encode(message.spec, w);
12748
+ w.join();
12749
+ }
12750
+ if (message.status !== undefined) {
12751
+ const w = writer.uint32(26).fork();
12752
+ exports.SecurityRuleStatus.encode(message.status, w);
12753
+ w.join();
12754
+ }
12755
+ if (message[index_1.unknownFieldsSymbol]) {
12756
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12757
+ }
12758
+ return writer;
12759
+ },
12760
+ decode(input, length) {
12761
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12762
+ const end = length === undefined ? reader.len : reader.pos + length;
12763
+ const message = createBaseSecurityRule();
12764
+ let writer = undefined;
12765
+ while (reader.pos < end) {
12766
+ const tag = reader.uint32();
12767
+ switch (tag >>> 3) {
12768
+ case 1: {
12769
+ if (tag !== 10)
12770
+ break;
12771
+ message.metadata = v1_1.ResourceMetadata.decode(reader, reader.uint32());
12772
+ continue;
12773
+ }
12774
+ case 2: {
12775
+ if (tag !== 18)
12776
+ break;
12777
+ message.spec = exports.SecurityRuleSpec.decode(reader, reader.uint32());
12778
+ continue;
12779
+ }
12780
+ case 3: {
12781
+ if (tag !== 26)
12782
+ break;
12783
+ message.status = exports.SecurityRuleStatus.decode(reader, reader.uint32());
12784
+ continue;
12785
+ }
12786
+ default:
12787
+ break;
12788
+ }
12789
+ if ((tag & 7) === 4 || tag === 0) {
12790
+ break;
12791
+ }
12792
+ {
12793
+ if (!writer)
12794
+ writer = new index_1.BinaryWriter();
12795
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12796
+ writer.uint32(tag).raw(skipped);
12797
+ }
12798
+ }
12799
+ if (writer) {
12800
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12801
+ }
12802
+ return message;
12803
+ },
12804
+ fromJSON(object) {
12805
+ return applySecurityRuleCustom({
12806
+ $type: "nebius.vpc.v1.SecurityRule",
12807
+ metadata: (0, index_1.isSet)(object.metadata ?? object.metadata)
12808
+ ? v1_1.ResourceMetadata.fromJSON(object.metadata ?? object.metadata)
12809
+ : undefined,
12810
+ spec: (0, index_1.isSet)(object.spec ?? object.spec)
12811
+ ? exports.SecurityRuleSpec.fromJSON(object.spec ?? object.spec)
12812
+ : undefined,
12813
+ status: (0, index_1.isSet)(object.status ?? object.status)
12814
+ ? exports.SecurityRuleStatus.fromJSON(object.status ?? object.status)
12815
+ : undefined,
12816
+ });
12817
+ },
12818
+ toJSON(message, use = "json") {
12819
+ const obj = {};
12820
+ const pick = (json, pb) => (use === "json" ? json : pb);
12821
+ if (message.metadata !== undefined) {
12822
+ obj[pick("metadata", "metadata")] = message.metadata
12823
+ ? v1_1.ResourceMetadata.toJSON(message.metadata, use)
12824
+ : undefined;
12825
+ }
12826
+ if (message.spec !== undefined) {
12827
+ obj[pick("spec", "spec")] = message.spec
12828
+ ? exports.SecurityRuleSpec.toJSON(message.spec, use)
12829
+ : undefined;
12830
+ }
12831
+ if (message.status !== undefined) {
12832
+ obj[pick("status", "status")] = message.status
12833
+ ? exports.SecurityRuleStatus.toJSON(message.status, use)
12834
+ : undefined;
12835
+ }
12836
+ return obj;
12837
+ },
12838
+ create(base) {
12839
+ return exports.SecurityRule.fromPartial(base ?? {});
12840
+ },
12841
+ fromPartial(object) {
12842
+ const message = createBaseSecurityRule();
12843
+ message.metadata = (object.metadata !== undefined && object.metadata !== null)
12844
+ ? v1_1.ResourceMetadata.fromPartial(object.metadata)
12845
+ : undefined;
12846
+ message.spec = (object.spec !== undefined && object.spec !== null)
12847
+ ? exports.SecurityRuleSpec.fromPartial(object.spec)
12848
+ : undefined;
12849
+ message.status = (object.status !== undefined && object.status !== null)
12850
+ ? exports.SecurityRuleStatus.fromPartial(object.status)
12851
+ : undefined;
12852
+ return message;
12853
+ },
12854
+ };
12855
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityRule);
12856
+ function SecurityRuleCustomInspect() {
12857
+ const parts = [];
12858
+ if (this.metadata !== undefined)
12859
+ parts.push("metadata" + "=" + (0, util_1.inspect)(this.metadata));
12860
+ if (this.spec !== undefined)
12861
+ parts.push("spec" + "=" + (0, util_1.inspect)(this.spec));
12862
+ if (this.status !== undefined)
12863
+ parts.push("status" + "=" + (0, util_1.inspect)(this.status));
12864
+ return `${this.$type}(${parts.join(", ")})`;
12865
+ }
12866
+ function SecurityRuleCustomJson() {
12867
+ const obj = {
12868
+ type: this.$type,
12869
+ };
12870
+ if (this.metadata !== undefined)
12871
+ obj.metadata = (0, logging_1.inspectJson)(this.metadata);
12872
+ if (this.spec !== undefined)
12873
+ obj.spec = (0, logging_1.inspectJson)(this.spec);
12874
+ if (this.status !== undefined)
12875
+ obj.status = (0, logging_1.inspectJson)(this.status);
12876
+ return obj;
12877
+ }
12878
+ function applySecurityRuleCustom(message) {
12879
+ message[logging_1.custom] = SecurityRuleCustomInspect;
12880
+ message[logging_1.customJson] = SecurityRuleCustomJson;
12881
+ return message;
12882
+ }
12883
+ function createBaseSecurityRule() {
12884
+ const message = {
12885
+ $type: "nebius.vpc.v1.SecurityRule",
12886
+ metadata: undefined,
12887
+ spec: undefined,
12888
+ status: undefined,
12889
+ };
12890
+ return applySecurityRuleCustom(message);
12891
+ }
12892
+ exports.SecurityRuleSpec = {
12893
+ $type: "nebius.vpc.v1.SecurityRuleSpec",
12894
+ encode(message, writer = new index_1.BinaryWriter()) {
12895
+ if ((message.access ?? exports.RuleAccessAction.ACCESS_UNSPECIFIED) !== exports.RuleAccessAction.ACCESS_UNSPECIFIED) {
12896
+ exports.RuleAccessAction.encodeField(writer, 1, message.access);
12897
+ }
12898
+ if ((message.priority ?? 0) !== 0) {
12899
+ writer.uint32(16).int32(message.priority);
12900
+ }
12901
+ if ((message.protocol ?? exports.RuleProtocol.PROTOCOL_UNSPECIFIED) !== exports.RuleProtocol.PROTOCOL_UNSPECIFIED) {
12902
+ exports.RuleProtocol.encodeField(writer, 3, message.protocol);
12903
+ }
12904
+ if ((message.type ?? exports.RuleType.RULE_TYPE_UNSPECIFIED) !== exports.RuleType.RULE_TYPE_UNSPECIFIED) {
12905
+ exports.RuleType.encodeField(writer, 6, message.type);
12906
+ }
12907
+ if (message.match?.$case === undefined) { /* noop */ }
12908
+ else if (message.match?.$case === "ingress") {
12909
+ const w = writer.uint32(34).fork();
12910
+ exports.RuleIngress.encode(message.match.ingress, w);
12911
+ w.join();
12912
+ }
12913
+ else if (message.match?.$case === "egress") {
12914
+ const w = writer.uint32(42).fork();
12915
+ exports.RuleEgress.encode(message.match.egress, w);
12916
+ w.join();
12917
+ }
12918
+ if (message[index_1.unknownFieldsSymbol]) {
12919
+ writer.raw(message[index_1.unknownFieldsSymbol]);
12920
+ }
12921
+ return writer;
12922
+ },
12923
+ decode(input, length) {
12924
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
12925
+ const end = length === undefined ? reader.len : reader.pos + length;
12926
+ const message = createBaseSecurityRuleSpec();
12927
+ let writer = undefined;
12928
+ while (reader.pos < end) {
12929
+ const tag = reader.uint32();
12930
+ switch (tag >>> 3) {
12931
+ case 1: {
12932
+ if (tag !== 8)
12933
+ break;
12934
+ message.access = exports.RuleAccessAction.fromNumber(reader.int32());
12935
+ continue;
12936
+ }
12937
+ case 2: {
12938
+ if (tag !== 16)
12939
+ break;
12940
+ message.priority = reader.int32();
12941
+ continue;
12942
+ }
12943
+ case 3: {
12944
+ if (tag !== 24)
12945
+ break;
12946
+ message.protocol = exports.RuleProtocol.fromNumber(reader.int32());
12947
+ continue;
12948
+ }
12949
+ case 6: {
12950
+ if (tag !== 48)
12951
+ break;
12952
+ message.type = exports.RuleType.fromNumber(reader.int32());
12953
+ continue;
12954
+ }
12955
+ case 4: {
12956
+ if (tag !== 34)
12957
+ break;
12958
+ message.match = {
12959
+ $case: "ingress",
12960
+ ingress: exports.RuleIngress.decode(reader, reader.uint32())
12961
+ };
12962
+ continue;
12963
+ }
12964
+ case 5: {
12965
+ if (tag !== 42)
12966
+ break;
12967
+ message.match = {
12968
+ $case: "egress",
12969
+ egress: exports.RuleEgress.decode(reader, reader.uint32())
12970
+ };
12971
+ continue;
12972
+ }
12973
+ default:
12974
+ break;
12975
+ }
12976
+ if ((tag & 7) === 4 || tag === 0) {
12977
+ break;
12978
+ }
12979
+ {
12980
+ if (!writer)
12981
+ writer = new index_1.BinaryWriter();
12982
+ const skipped = reader.skip(tag & 7, tag >>> 3);
12983
+ writer.uint32(tag).raw(skipped);
12984
+ }
12985
+ }
12986
+ if (writer) {
12987
+ message[index_1.unknownFieldsSymbol] = writer.finish();
12988
+ }
12989
+ return message;
12990
+ },
12991
+ fromJSON(object) {
12992
+ return applySecurityRuleSpecCustom({
12993
+ $type: "nebius.vpc.v1.SecurityRuleSpec",
12994
+ access: (0, index_1.isSet)(object.access ?? object.access)
12995
+ ? exports.RuleAccessAction.fromJSON(object.access ?? object.access)
12996
+ : exports.RuleAccessAction.ACCESS_UNSPECIFIED,
12997
+ priority: (0, index_1.isSet)(object.priority ?? object.priority)
12998
+ ? Number(object.priority ?? object.priority)
12999
+ : 0,
13000
+ protocol: (0, index_1.isSet)(object.protocol ?? object.protocol)
13001
+ ? exports.RuleProtocol.fromJSON(object.protocol ?? object.protocol)
13002
+ : exports.RuleProtocol.PROTOCOL_UNSPECIFIED,
13003
+ type: (0, index_1.isSet)(object.type ?? object.type)
13004
+ ? exports.RuleType.fromJSON(object.type ?? object.type)
13005
+ : exports.RuleType.RULE_TYPE_UNSPECIFIED,
13006
+ match: (() => {
13007
+ if ((0, index_1.isSet)(object.ingress) || (0, index_1.isSet)(object.ingress)) {
13008
+ return {
13009
+ $case: "ingress",
13010
+ ingress: exports.RuleIngress.fromJSON(object.ingress ?? object.ingress)
13011
+ };
13012
+ }
13013
+ if ((0, index_1.isSet)(object.egress) || (0, index_1.isSet)(object.egress)) {
13014
+ return {
13015
+ $case: "egress",
13016
+ egress: exports.RuleEgress.fromJSON(object.egress ?? object.egress)
13017
+ };
13018
+ }
13019
+ return undefined;
13020
+ })(),
13021
+ });
13022
+ },
13023
+ toJSON(message, use = "json") {
13024
+ const obj = {};
13025
+ const pick = (json, pb) => (use === "json" ? json : pb);
13026
+ if ((message.access ?? exports.RuleAccessAction.ACCESS_UNSPECIFIED) !== exports.RuleAccessAction.ACCESS_UNSPECIFIED) {
13027
+ obj[pick("access", "access")] = exports.RuleAccessAction.toJSON(message.access);
13028
+ }
13029
+ if ((message.priority ?? 0) !== 0) {
13030
+ obj[pick("priority", "priority")] = message.priority;
13031
+ }
13032
+ if ((message.protocol ?? exports.RuleProtocol.PROTOCOL_UNSPECIFIED) !== exports.RuleProtocol.PROTOCOL_UNSPECIFIED) {
13033
+ obj[pick("protocol", "protocol")] = exports.RuleProtocol.toJSON(message.protocol);
13034
+ }
13035
+ if ((message.type ?? exports.RuleType.RULE_TYPE_UNSPECIFIED) !== exports.RuleType.RULE_TYPE_UNSPECIFIED) {
13036
+ obj[pick("type", "type")] = exports.RuleType.toJSON(message.type);
13037
+ }
13038
+ switch (message.match?.$case) {
13039
+ case "ingress": {
13040
+ obj[pick("ingress", "ingress")] = exports.RuleIngress.toJSON(message.match.ingress, use);
13041
+ break;
13042
+ }
13043
+ case "egress": {
13044
+ obj[pick("egress", "egress")] = exports.RuleEgress.toJSON(message.match.egress, use);
13045
+ break;
13046
+ }
13047
+ default: break;
13048
+ }
13049
+ return obj;
13050
+ },
13051
+ create(base) {
13052
+ return exports.SecurityRuleSpec.fromPartial(base ?? {});
13053
+ },
13054
+ fromPartial(object) {
13055
+ const message = createBaseSecurityRuleSpec();
13056
+ message.access = (object.access !== undefined && object.access !== null)
13057
+ ? exports.RuleAccessAction.fromJSON(object.access.name)
13058
+ : exports.RuleAccessAction.ACCESS_UNSPECIFIED;
13059
+ message.priority = (object.priority !== undefined && object.priority !== null)
13060
+ ? object.priority
13061
+ : 0;
13062
+ message.protocol = (object.protocol !== undefined && object.protocol !== null)
13063
+ ? exports.RuleProtocol.fromJSON(object.protocol.name)
13064
+ : exports.RuleProtocol.PROTOCOL_UNSPECIFIED;
13065
+ message.type = (object.type !== undefined && object.type !== null)
13066
+ ? exports.RuleType.fromJSON(object.type.name)
13067
+ : exports.RuleType.RULE_TYPE_UNSPECIFIED;
13068
+ switch (object.match?.$case) {
13069
+ case "ingress": {
13070
+ if (object.match.ingress !== undefined && object.match.ingress !== null) {
13071
+ message.match = {
13072
+ $case: "ingress",
13073
+ ingress: exports.RuleIngress.fromPartial(object.match.ingress),
13074
+ };
13075
+ }
13076
+ break;
13077
+ }
13078
+ case "egress": {
13079
+ if (object.match.egress !== undefined && object.match.egress !== null) {
13080
+ message.match = {
13081
+ $case: "egress",
13082
+ egress: exports.RuleEgress.fromPartial(object.match.egress),
13083
+ };
13084
+ }
13085
+ break;
13086
+ }
13087
+ default: break;
13088
+ }
13089
+ return message;
13090
+ },
13091
+ };
13092
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityRuleSpec);
13093
+ function SecurityRuleSpecCustomInspect() {
13094
+ const parts = [];
13095
+ if (this.access !== undefined)
13096
+ parts.push("access" + "=" + (0, util_1.inspect)(this.access));
13097
+ if ((this.priority ?? 0) !== 0)
13098
+ parts.push("priority" + "=" + (0, util_1.inspect)(this.priority));
13099
+ if (this.protocol !== undefined)
13100
+ parts.push("protocol" + "=" + (0, util_1.inspect)(this.protocol));
13101
+ if (this.type !== undefined)
13102
+ parts.push("type" + "=" + (0, util_1.inspect)(this.type));
13103
+ return `${this.$type}(${parts.join(", ")})`;
13104
+ }
13105
+ function SecurityRuleSpecCustomJson() {
13106
+ const obj = {
13107
+ type: this.$type,
13108
+ };
13109
+ if (this.access !== undefined)
13110
+ obj.access = (0, logging_1.inspectJson)(this.access);
13111
+ if ((this.priority ?? 0) !== 0)
13112
+ obj.priority = (0, logging_1.inspectJson)(this.priority);
13113
+ if (this.protocol !== undefined)
13114
+ obj.protocol = (0, logging_1.inspectJson)(this.protocol);
13115
+ if (this.type !== undefined)
13116
+ obj.type = (0, logging_1.inspectJson)(this.type);
13117
+ return obj;
13118
+ }
13119
+ function applySecurityRuleSpecCustom(message) {
13120
+ message[logging_1.custom] = SecurityRuleSpecCustomInspect;
13121
+ message[logging_1.customJson] = SecurityRuleSpecCustomJson;
13122
+ return message;
13123
+ }
13124
+ function createBaseSecurityRuleSpec() {
13125
+ const message = {
13126
+ $type: "nebius.vpc.v1.SecurityRuleSpec",
13127
+ access: exports.RuleAccessAction.ACCESS_UNSPECIFIED,
13128
+ priority: 0,
13129
+ protocol: exports.RuleProtocol.PROTOCOL_UNSPECIFIED,
13130
+ type: exports.RuleType.RULE_TYPE_UNSPECIFIED,
13131
+ match: undefined,
13132
+ };
13133
+ return applySecurityRuleSpecCustom(message);
13134
+ }
13135
+ exports.RuleIngress = {
13136
+ $type: "nebius.vpc.v1.RuleIngress",
13137
+ encode(message, writer = new index_1.BinaryWriter()) {
13138
+ if (message.sourceSecurityGroupId !== "") {
13139
+ writer.uint32(10).string(message.sourceSecurityGroupId);
13140
+ }
13141
+ for (const v of (message.sourceCidrs ?? [])) {
13142
+ writer.uint32(18).string(v);
13143
+ }
13144
+ if (message.destinationPorts?.length) {
13145
+ const w = writer.uint32(26).fork();
13146
+ for (const v of message.destinationPorts)
13147
+ w.int32(v);
13148
+ w.join();
13149
+ }
13150
+ if (message[index_1.unknownFieldsSymbol]) {
13151
+ writer.raw(message[index_1.unknownFieldsSymbol]);
13152
+ }
13153
+ return writer;
13154
+ },
13155
+ decode(input, length) {
13156
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
13157
+ const end = length === undefined ? reader.len : reader.pos + length;
13158
+ const message = createBaseRuleIngress();
13159
+ let writer = undefined;
13160
+ while (reader.pos < end) {
13161
+ const tag = reader.uint32();
13162
+ switch (tag >>> 3) {
13163
+ case 1: {
13164
+ if (tag !== 10)
13165
+ break;
13166
+ message.sourceSecurityGroupId = reader.string();
13167
+ continue;
13168
+ }
13169
+ case 2: {
13170
+ if (tag !== 18)
13171
+ break;
13172
+ message.sourceCidrs.push(reader.string());
13173
+ continue;
13174
+ }
13175
+ case 3: {
13176
+ // packed or unpacked repeated scalar
13177
+ if ((tag & 7) === 2) {
13178
+ const end2 = reader.uint32() + reader.pos;
13179
+ while (reader.pos < end2) {
13180
+ message.destinationPorts.push(reader.int32());
13181
+ }
13182
+ continue;
13183
+ }
13184
+ else if ((tag & 7) === 0 || (tag & 7) === 5 || (tag & 7) === 1) { // allow valid scalar wire types
13185
+ message.destinationPorts.push(reader.int32());
13186
+ continue;
13187
+ }
13188
+ break; // wrong wire type
13189
+ }
13190
+ default:
13191
+ break;
13192
+ }
13193
+ if ((tag & 7) === 4 || tag === 0) {
13194
+ break;
13195
+ }
13196
+ {
13197
+ if (!writer)
13198
+ writer = new index_1.BinaryWriter();
13199
+ const skipped = reader.skip(tag & 7, tag >>> 3);
13200
+ writer.uint32(tag).raw(skipped);
13201
+ }
13202
+ }
13203
+ if (writer) {
13204
+ message[index_1.unknownFieldsSymbol] = writer.finish();
13205
+ }
13206
+ return message;
13207
+ },
13208
+ fromJSON(object) {
13209
+ return applyRuleIngressCustom({
13210
+ $type: "nebius.vpc.v1.RuleIngress",
13211
+ sourceSecurityGroupId: (0, index_1.isSet)(object.sourceSecurityGroupId ?? object.source_security_group_id)
13212
+ ? String(object.sourceSecurityGroupId ?? object.source_security_group_id)
13213
+ : "",
13214
+ sourceCidrs: globalThis.Array.isArray(object?.sourceCidrs ?? object?.source_cidrs)
13215
+ ? (object.sourceCidrs ?? object.source_cidrs).map((e) => String(e))
13216
+ : [],
13217
+ destinationPorts: globalThis.Array.isArray(object?.destinationPorts ?? object?.destination_ports)
13218
+ ? (object.destinationPorts ?? object.destination_ports).map((e) => Number(e))
13219
+ : [],
13220
+ });
13221
+ },
13222
+ toJSON(message, use = "json") {
13223
+ const obj = {};
13224
+ const pick = (json, pb) => (use === "json" ? json : pb);
13225
+ if (message.sourceSecurityGroupId !== "") {
13226
+ obj[pick("sourceSecurityGroupId", "source_security_group_id")] = message.sourceSecurityGroupId;
13227
+ }
13228
+ if (message.sourceCidrs?.length) {
13229
+ obj[pick("sourceCidrs", "source_cidrs")] = message.sourceCidrs.map((e) => e);
13230
+ }
13231
+ if (message.destinationPorts?.length) {
13232
+ obj[pick("destinationPorts", "destination_ports")] = message.destinationPorts.map((e) => e);
13233
+ }
13234
+ return obj;
13235
+ },
13236
+ create(base) {
13237
+ return exports.RuleIngress.fromPartial(base ?? {});
13238
+ },
13239
+ fromPartial(object) {
13240
+ const message = createBaseRuleIngress();
13241
+ message.sourceSecurityGroupId = (object.sourceSecurityGroupId !== undefined && object.sourceSecurityGroupId !== null)
13242
+ ? object.sourceSecurityGroupId
13243
+ : "";
13244
+ message.sourceCidrs = object.sourceCidrs?.map((e) => e) || [];
13245
+ message.destinationPorts = object.destinationPorts?.map((e) => e) || [];
13246
+ return message;
13247
+ },
13248
+ };
13249
+ protobuf_1.protoRegistry.registerMessage(exports.RuleIngress);
13250
+ function RuleIngressCustomInspect() {
13251
+ const parts = [];
13252
+ if (this.sourceSecurityGroupId !== "")
13253
+ parts.push("sourceSecurityGroupId" + "=" + (0, util_1.inspect)(this.sourceSecurityGroupId));
13254
+ if ((this.sourceCidrs?.length ?? 0) !== 0)
13255
+ parts.push("sourceCidrs" + "=" + (0, util_1.inspect)(this.sourceCidrs));
13256
+ if ((this.destinationPorts?.length ?? 0) !== 0)
13257
+ parts.push("destinationPorts" + "=" + (0, util_1.inspect)(this.destinationPorts));
13258
+ return `${this.$type}(${parts.join(", ")})`;
13259
+ }
13260
+ function RuleIngressCustomJson() {
13261
+ const obj = {
13262
+ type: this.$type,
13263
+ };
13264
+ if (this.sourceSecurityGroupId !== "")
13265
+ obj.sourceSecurityGroupId = (0, logging_1.inspectJson)(this.sourceSecurityGroupId);
13266
+ if ((this.sourceCidrs?.length ?? 0) !== 0)
13267
+ obj.sourceCidrs = (0, logging_1.inspectJson)(this.sourceCidrs);
13268
+ if ((this.destinationPorts?.length ?? 0) !== 0)
13269
+ obj.destinationPorts = (0, logging_1.inspectJson)(this.destinationPorts);
13270
+ return obj;
13271
+ }
13272
+ function applyRuleIngressCustom(message) {
13273
+ message[logging_1.custom] = RuleIngressCustomInspect;
13274
+ message[logging_1.customJson] = RuleIngressCustomJson;
13275
+ return message;
13276
+ }
13277
+ function createBaseRuleIngress() {
13278
+ const message = {
13279
+ $type: "nebius.vpc.v1.RuleIngress",
13280
+ sourceSecurityGroupId: "",
13281
+ sourceCidrs: [],
13282
+ destinationPorts: [],
13283
+ };
13284
+ return applyRuleIngressCustom(message);
13285
+ }
13286
+ exports.RuleEgress = {
13287
+ $type: "nebius.vpc.v1.RuleEgress",
13288
+ encode(message, writer = new index_1.BinaryWriter()) {
13289
+ if (message.destinationSecurityGroupId !== "") {
13290
+ writer.uint32(10).string(message.destinationSecurityGroupId);
13291
+ }
13292
+ for (const v of (message.destinationCidrs ?? [])) {
13293
+ writer.uint32(18).string(v);
13294
+ }
13295
+ if (message.destinationPorts?.length) {
13296
+ const w = writer.uint32(26).fork();
13297
+ for (const v of message.destinationPorts)
13298
+ w.int32(v);
13299
+ w.join();
13300
+ }
13301
+ if (message[index_1.unknownFieldsSymbol]) {
13302
+ writer.raw(message[index_1.unknownFieldsSymbol]);
13303
+ }
13304
+ return writer;
13305
+ },
13306
+ decode(input, length) {
13307
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
13308
+ const end = length === undefined ? reader.len : reader.pos + length;
13309
+ const message = createBaseRuleEgress();
13310
+ let writer = undefined;
13311
+ while (reader.pos < end) {
13312
+ const tag = reader.uint32();
13313
+ switch (tag >>> 3) {
13314
+ case 1: {
13315
+ if (tag !== 10)
13316
+ break;
13317
+ message.destinationSecurityGroupId = reader.string();
13318
+ continue;
13319
+ }
13320
+ case 2: {
13321
+ if (tag !== 18)
13322
+ break;
13323
+ message.destinationCidrs.push(reader.string());
13324
+ continue;
13325
+ }
13326
+ case 3: {
13327
+ // packed or unpacked repeated scalar
13328
+ if ((tag & 7) === 2) {
13329
+ const end2 = reader.uint32() + reader.pos;
13330
+ while (reader.pos < end2) {
13331
+ message.destinationPorts.push(reader.int32());
13332
+ }
13333
+ continue;
13334
+ }
13335
+ else if ((tag & 7) === 0 || (tag & 7) === 5 || (tag & 7) === 1) { // allow valid scalar wire types
13336
+ message.destinationPorts.push(reader.int32());
13337
+ continue;
13338
+ }
13339
+ break; // wrong wire type
13340
+ }
13341
+ default:
13342
+ break;
13343
+ }
13344
+ if ((tag & 7) === 4 || tag === 0) {
13345
+ break;
13346
+ }
13347
+ {
13348
+ if (!writer)
13349
+ writer = new index_1.BinaryWriter();
13350
+ const skipped = reader.skip(tag & 7, tag >>> 3);
13351
+ writer.uint32(tag).raw(skipped);
13352
+ }
13353
+ }
13354
+ if (writer) {
13355
+ message[index_1.unknownFieldsSymbol] = writer.finish();
13356
+ }
13357
+ return message;
13358
+ },
13359
+ fromJSON(object) {
13360
+ return applyRuleEgressCustom({
13361
+ $type: "nebius.vpc.v1.RuleEgress",
13362
+ destinationSecurityGroupId: (0, index_1.isSet)(object.destinationSecurityGroupId ?? object.destination_security_group_id)
13363
+ ? String(object.destinationSecurityGroupId ?? object.destination_security_group_id)
13364
+ : "",
13365
+ destinationCidrs: globalThis.Array.isArray(object?.destinationCidrs ?? object?.destination_cidrs)
13366
+ ? (object.destinationCidrs ?? object.destination_cidrs).map((e) => String(e))
13367
+ : [],
13368
+ destinationPorts: globalThis.Array.isArray(object?.destinationPorts ?? object?.destination_ports)
13369
+ ? (object.destinationPorts ?? object.destination_ports).map((e) => Number(e))
13370
+ : [],
13371
+ });
13372
+ },
13373
+ toJSON(message, use = "json") {
13374
+ const obj = {};
13375
+ const pick = (json, pb) => (use === "json" ? json : pb);
13376
+ if (message.destinationSecurityGroupId !== "") {
13377
+ obj[pick("destinationSecurityGroupId", "destination_security_group_id")] = message.destinationSecurityGroupId;
13378
+ }
13379
+ if (message.destinationCidrs?.length) {
13380
+ obj[pick("destinationCidrs", "destination_cidrs")] = message.destinationCidrs.map((e) => e);
13381
+ }
13382
+ if (message.destinationPorts?.length) {
13383
+ obj[pick("destinationPorts", "destination_ports")] = message.destinationPorts.map((e) => e);
13384
+ }
13385
+ return obj;
13386
+ },
13387
+ create(base) {
13388
+ return exports.RuleEgress.fromPartial(base ?? {});
13389
+ },
13390
+ fromPartial(object) {
13391
+ const message = createBaseRuleEgress();
13392
+ message.destinationSecurityGroupId = (object.destinationSecurityGroupId !== undefined && object.destinationSecurityGroupId !== null)
13393
+ ? object.destinationSecurityGroupId
13394
+ : "";
13395
+ message.destinationCidrs = object.destinationCidrs?.map((e) => e) || [];
13396
+ message.destinationPorts = object.destinationPorts?.map((e) => e) || [];
13397
+ return message;
13398
+ },
13399
+ };
13400
+ protobuf_1.protoRegistry.registerMessage(exports.RuleEgress);
13401
+ function RuleEgressCustomInspect() {
13402
+ const parts = [];
13403
+ if (this.destinationSecurityGroupId !== "")
13404
+ parts.push("destinationSecurityGroupId" + "=" + (0, util_1.inspect)(this.destinationSecurityGroupId));
13405
+ if ((this.destinationCidrs?.length ?? 0) !== 0)
13406
+ parts.push("destinationCidrs" + "=" + (0, util_1.inspect)(this.destinationCidrs));
13407
+ if ((this.destinationPorts?.length ?? 0) !== 0)
13408
+ parts.push("destinationPorts" + "=" + (0, util_1.inspect)(this.destinationPorts));
13409
+ return `${this.$type}(${parts.join(", ")})`;
13410
+ }
13411
+ function RuleEgressCustomJson() {
13412
+ const obj = {
13413
+ type: this.$type,
13414
+ };
13415
+ if (this.destinationSecurityGroupId !== "")
13416
+ obj.destinationSecurityGroupId = (0, logging_1.inspectJson)(this.destinationSecurityGroupId);
13417
+ if ((this.destinationCidrs?.length ?? 0) !== 0)
13418
+ obj.destinationCidrs = (0, logging_1.inspectJson)(this.destinationCidrs);
13419
+ if ((this.destinationPorts?.length ?? 0) !== 0)
13420
+ obj.destinationPorts = (0, logging_1.inspectJson)(this.destinationPorts);
13421
+ return obj;
13422
+ }
13423
+ function applyRuleEgressCustom(message) {
13424
+ message[logging_1.custom] = RuleEgressCustomInspect;
13425
+ message[logging_1.customJson] = RuleEgressCustomJson;
13426
+ return message;
13427
+ }
13428
+ function createBaseRuleEgress() {
13429
+ const message = {
13430
+ $type: "nebius.vpc.v1.RuleEgress",
13431
+ destinationSecurityGroupId: "",
13432
+ destinationCidrs: [],
13433
+ destinationPorts: [],
13434
+ };
13435
+ return applyRuleEgressCustom(message);
13436
+ }
13437
+ exports.SecurityRuleStatus = {
13438
+ $type: "nebius.vpc.v1.SecurityRuleStatus",
13439
+ encode(message, writer = new index_1.BinaryWriter()) {
13440
+ if ((message.state ?? exports.SecurityRuleStatus_State.STATE_UNSPECIFIED) !== exports.SecurityRuleStatus_State.STATE_UNSPECIFIED) {
13441
+ exports.SecurityRuleStatus_State.encodeField(writer, 1, message.state);
13442
+ }
13443
+ if ((message.effectivePriority ?? 0) !== 0) {
13444
+ writer.uint32(32).int32(message.effectivePriority);
13445
+ }
13446
+ if ((message.direction ?? exports.RuleDirection.DIRECTION_UNSPECIFIED) !== exports.RuleDirection.DIRECTION_UNSPECIFIED) {
13447
+ exports.RuleDirection.encodeField(writer, 6, message.direction);
13448
+ }
13449
+ if (message.source !== undefined) {
13450
+ const w = writer.uint32(58).fork();
13451
+ exports.RuleMatchStatus.encode(message.source, w);
13452
+ w.join();
13453
+ }
13454
+ if (message.destination !== undefined) {
13455
+ const w = writer.uint32(66).fork();
13456
+ exports.RuleMatchStatus.encode(message.destination, w);
13457
+ w.join();
13458
+ }
13459
+ if (message[index_1.unknownFieldsSymbol]) {
13460
+ writer.raw(message[index_1.unknownFieldsSymbol]);
13461
+ }
13462
+ return writer;
13463
+ },
13464
+ decode(input, length) {
13465
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
13466
+ const end = length === undefined ? reader.len : reader.pos + length;
13467
+ const message = createBaseSecurityRuleStatus();
13468
+ let writer = undefined;
13469
+ while (reader.pos < end) {
13470
+ const tag = reader.uint32();
13471
+ switch (tag >>> 3) {
13472
+ case 1: {
13473
+ if (tag !== 8)
13474
+ break;
13475
+ message.state = exports.SecurityRuleStatus_State.fromNumber(reader.int32());
13476
+ continue;
13477
+ }
13478
+ case 4: {
13479
+ if (tag !== 32)
13480
+ break;
13481
+ message.effectivePriority = reader.int32();
13482
+ continue;
13483
+ }
13484
+ case 6: {
13485
+ if (tag !== 48)
13486
+ break;
13487
+ message.direction = exports.RuleDirection.fromNumber(reader.int32());
13488
+ continue;
13489
+ }
13490
+ case 7: {
13491
+ if (tag !== 58)
13492
+ break;
13493
+ message.source = exports.RuleMatchStatus.decode(reader, reader.uint32());
13494
+ continue;
13495
+ }
13496
+ case 8: {
13497
+ if (tag !== 66)
13498
+ break;
13499
+ message.destination = exports.RuleMatchStatus.decode(reader, reader.uint32());
13500
+ continue;
13501
+ }
13502
+ default:
13503
+ break;
13504
+ }
13505
+ if ((tag & 7) === 4 || tag === 0) {
13506
+ break;
13507
+ }
13508
+ {
13509
+ if (!writer)
13510
+ writer = new index_1.BinaryWriter();
13511
+ const skipped = reader.skip(tag & 7, tag >>> 3);
13512
+ writer.uint32(tag).raw(skipped);
13513
+ }
13514
+ }
13515
+ if (writer) {
13516
+ message[index_1.unknownFieldsSymbol] = writer.finish();
13517
+ }
13518
+ return message;
13519
+ },
13520
+ fromJSON(object) {
13521
+ return applySecurityRuleStatusCustom({
13522
+ $type: "nebius.vpc.v1.SecurityRuleStatus",
13523
+ state: (0, index_1.isSet)(object.state ?? object.state)
13524
+ ? exports.SecurityRuleStatus_State.fromJSON(object.state ?? object.state)
13525
+ : exports.SecurityRuleStatus_State.STATE_UNSPECIFIED,
13526
+ effectivePriority: (0, index_1.isSet)(object.effectivePriority ?? object.effective_priority)
13527
+ ? Number(object.effectivePriority ?? object.effective_priority)
13528
+ : 0,
13529
+ direction: (0, index_1.isSet)(object.direction ?? object.direction)
13530
+ ? exports.RuleDirection.fromJSON(object.direction ?? object.direction)
13531
+ : exports.RuleDirection.DIRECTION_UNSPECIFIED,
13532
+ source: (0, index_1.isSet)(object.source ?? object.source)
13533
+ ? exports.RuleMatchStatus.fromJSON(object.source ?? object.source)
13534
+ : undefined,
13535
+ destination: (0, index_1.isSet)(object.destination ?? object.destination)
13536
+ ? exports.RuleMatchStatus.fromJSON(object.destination ?? object.destination)
13537
+ : undefined,
13538
+ });
13539
+ },
13540
+ toJSON(message, use = "json") {
13541
+ const obj = {};
13542
+ const pick = (json, pb) => (use === "json" ? json : pb);
13543
+ if ((message.state ?? exports.SecurityRuleStatus_State.STATE_UNSPECIFIED) !== exports.SecurityRuleStatus_State.STATE_UNSPECIFIED) {
13544
+ obj[pick("state", "state")] = exports.SecurityRuleStatus_State.toJSON(message.state);
13545
+ }
13546
+ if ((message.effectivePriority ?? 0) !== 0) {
13547
+ obj[pick("effectivePriority", "effective_priority")] = message.effectivePriority;
13548
+ }
13549
+ if ((message.direction ?? exports.RuleDirection.DIRECTION_UNSPECIFIED) !== exports.RuleDirection.DIRECTION_UNSPECIFIED) {
13550
+ obj[pick("direction", "direction")] = exports.RuleDirection.toJSON(message.direction);
13551
+ }
13552
+ if (message.source !== undefined) {
13553
+ obj[pick("source", "source")] = message.source
13554
+ ? exports.RuleMatchStatus.toJSON(message.source, use)
13555
+ : undefined;
13556
+ }
13557
+ if (message.destination !== undefined) {
13558
+ obj[pick("destination", "destination")] = message.destination
13559
+ ? exports.RuleMatchStatus.toJSON(message.destination, use)
13560
+ : undefined;
13561
+ }
13562
+ return obj;
13563
+ },
13564
+ create(base) {
13565
+ return exports.SecurityRuleStatus.fromPartial(base ?? {});
13566
+ },
13567
+ fromPartial(object) {
13568
+ const message = createBaseSecurityRuleStatus();
13569
+ message.state = (object.state !== undefined && object.state !== null)
13570
+ ? exports.SecurityRuleStatus_State.fromJSON(object.state.name)
13571
+ : exports.SecurityRuleStatus_State.STATE_UNSPECIFIED;
13572
+ message.effectivePriority = (object.effectivePriority !== undefined && object.effectivePriority !== null)
13573
+ ? object.effectivePriority
13574
+ : 0;
13575
+ message.direction = (object.direction !== undefined && object.direction !== null)
13576
+ ? exports.RuleDirection.fromJSON(object.direction.name)
13577
+ : exports.RuleDirection.DIRECTION_UNSPECIFIED;
13578
+ message.source = (object.source !== undefined && object.source !== null)
13579
+ ? exports.RuleMatchStatus.fromPartial(object.source)
13580
+ : undefined;
13581
+ message.destination = (object.destination !== undefined && object.destination !== null)
13582
+ ? exports.RuleMatchStatus.fromPartial(object.destination)
13583
+ : undefined;
13584
+ return message;
13585
+ },
13586
+ };
13587
+ protobuf_1.protoRegistry.registerMessage(exports.SecurityRuleStatus);
13588
+ function SecurityRuleStatusCustomInspect() {
13589
+ const parts = [];
13590
+ if (this.state !== undefined)
13591
+ parts.push("state" + "=" + (0, util_1.inspect)(this.state));
13592
+ if ((this.effectivePriority ?? 0) !== 0)
13593
+ parts.push("effectivePriority" + "=" + (0, util_1.inspect)(this.effectivePriority));
13594
+ if (this.direction !== undefined)
13595
+ parts.push("direction" + "=" + (0, util_1.inspect)(this.direction));
13596
+ if (this.source !== undefined)
13597
+ parts.push("source" + "=" + (0, util_1.inspect)(this.source));
13598
+ if (this.destination !== undefined)
13599
+ parts.push("destination" + "=" + (0, util_1.inspect)(this.destination));
13600
+ return `${this.$type}(${parts.join(", ")})`;
13601
+ }
13602
+ function SecurityRuleStatusCustomJson() {
13603
+ const obj = {
13604
+ type: this.$type,
13605
+ };
13606
+ if (this.state !== undefined)
13607
+ obj.state = (0, logging_1.inspectJson)(this.state);
13608
+ if ((this.effectivePriority ?? 0) !== 0)
13609
+ obj.effectivePriority = (0, logging_1.inspectJson)(this.effectivePriority);
13610
+ if (this.direction !== undefined)
13611
+ obj.direction = (0, logging_1.inspectJson)(this.direction);
13612
+ if (this.source !== undefined)
13613
+ obj.source = (0, logging_1.inspectJson)(this.source);
13614
+ if (this.destination !== undefined)
13615
+ obj.destination = (0, logging_1.inspectJson)(this.destination);
13616
+ return obj;
13617
+ }
13618
+ function applySecurityRuleStatusCustom(message) {
13619
+ message[logging_1.custom] = SecurityRuleStatusCustomInspect;
13620
+ message[logging_1.customJson] = SecurityRuleStatusCustomJson;
13621
+ return message;
13622
+ }
13623
+ function createBaseSecurityRuleStatus() {
13624
+ const message = {
13625
+ $type: "nebius.vpc.v1.SecurityRuleStatus",
13626
+ state: exports.SecurityRuleStatus_State.STATE_UNSPECIFIED,
13627
+ effectivePriority: 0,
13628
+ direction: exports.RuleDirection.DIRECTION_UNSPECIFIED,
13629
+ source: undefined,
13630
+ destination: undefined,
13631
+ };
13632
+ return applySecurityRuleStatusCustom(message);
13633
+ }
13634
+ exports.RuleMatchStatus = {
13635
+ $type: "nebius.vpc.v1.RuleMatchStatus",
13636
+ encode(message, writer = new index_1.BinaryWriter()) {
13637
+ if (message.securityGroupId !== "") {
13638
+ writer.uint32(10).string(message.securityGroupId);
13639
+ }
13640
+ for (const v of (message.cidrs ?? [])) {
13641
+ writer.uint32(18).string(v);
13642
+ }
13643
+ if (message.ports?.length) {
13644
+ const w = writer.uint32(26).fork();
13645
+ for (const v of message.ports)
13646
+ w.int32(v);
13647
+ w.join();
13648
+ }
13649
+ if (message[index_1.unknownFieldsSymbol]) {
13650
+ writer.raw(message[index_1.unknownFieldsSymbol]);
13651
+ }
13652
+ return writer;
13653
+ },
13654
+ decode(input, length) {
13655
+ const reader = input instanceof index_1.BinaryReader ? input : new index_1.BinaryReader(input);
13656
+ const end = length === undefined ? reader.len : reader.pos + length;
13657
+ const message = createBaseRuleMatchStatus();
13658
+ let writer = undefined;
13659
+ while (reader.pos < end) {
13660
+ const tag = reader.uint32();
13661
+ switch (tag >>> 3) {
13662
+ case 1: {
13663
+ if (tag !== 10)
13664
+ break;
13665
+ message.securityGroupId = reader.string();
13666
+ continue;
13667
+ }
13668
+ case 2: {
13669
+ if (tag !== 18)
13670
+ break;
13671
+ message.cidrs.push(reader.string());
13672
+ continue;
13673
+ }
13674
+ case 3: {
13675
+ // packed or unpacked repeated scalar
13676
+ if ((tag & 7) === 2) {
13677
+ const end2 = reader.uint32() + reader.pos;
13678
+ while (reader.pos < end2) {
13679
+ message.ports.push(reader.int32());
13680
+ }
13681
+ continue;
13682
+ }
13683
+ else if ((tag & 7) === 0 || (tag & 7) === 5 || (tag & 7) === 1) { // allow valid scalar wire types
13684
+ message.ports.push(reader.int32());
13685
+ continue;
13686
+ }
13687
+ break; // wrong wire type
13688
+ }
13689
+ default:
13690
+ break;
13691
+ }
13692
+ if ((tag & 7) === 4 || tag === 0) {
13693
+ break;
13694
+ }
13695
+ {
13696
+ if (!writer)
13697
+ writer = new index_1.BinaryWriter();
13698
+ const skipped = reader.skip(tag & 7, tag >>> 3);
13699
+ writer.uint32(tag).raw(skipped);
13700
+ }
13701
+ }
13702
+ if (writer) {
13703
+ message[index_1.unknownFieldsSymbol] = writer.finish();
13704
+ }
13705
+ return message;
13706
+ },
13707
+ fromJSON(object) {
13708
+ return applyRuleMatchStatusCustom({
13709
+ $type: "nebius.vpc.v1.RuleMatchStatus",
13710
+ securityGroupId: (0, index_1.isSet)(object.securityGroupId ?? object.security_group_id)
13711
+ ? String(object.securityGroupId ?? object.security_group_id)
13712
+ : "",
13713
+ cidrs: globalThis.Array.isArray(object?.cidrs ?? object?.cidrs)
13714
+ ? (object.cidrs ?? object.cidrs).map((e) => String(e))
13715
+ : [],
13716
+ ports: globalThis.Array.isArray(object?.ports ?? object?.ports)
13717
+ ? (object.ports ?? object.ports).map((e) => Number(e))
13718
+ : [],
13719
+ });
13720
+ },
13721
+ toJSON(message, use = "json") {
13722
+ const obj = {};
13723
+ const pick = (json, pb) => (use === "json" ? json : pb);
13724
+ if (message.securityGroupId !== "") {
13725
+ obj[pick("securityGroupId", "security_group_id")] = message.securityGroupId;
13726
+ }
13727
+ if (message.cidrs?.length) {
13728
+ obj[pick("cidrs", "cidrs")] = message.cidrs.map((e) => e);
13729
+ }
13730
+ if (message.ports?.length) {
13731
+ obj[pick("ports", "ports")] = message.ports.map((e) => e);
13732
+ }
13733
+ return obj;
13734
+ },
13735
+ create(base) {
13736
+ return exports.RuleMatchStatus.fromPartial(base ?? {});
13737
+ },
13738
+ fromPartial(object) {
13739
+ const message = createBaseRuleMatchStatus();
13740
+ message.securityGroupId = (object.securityGroupId !== undefined && object.securityGroupId !== null)
13741
+ ? object.securityGroupId
13742
+ : "";
13743
+ message.cidrs = object.cidrs?.map((e) => e) || [];
13744
+ message.ports = object.ports?.map((e) => e) || [];
13745
+ return message;
13746
+ },
13747
+ };
13748
+ protobuf_1.protoRegistry.registerMessage(exports.RuleMatchStatus);
13749
+ function RuleMatchStatusCustomInspect() {
13750
+ const parts = [];
13751
+ if (this.securityGroupId !== "")
13752
+ parts.push("securityGroupId" + "=" + (0, util_1.inspect)(this.securityGroupId));
13753
+ if ((this.cidrs?.length ?? 0) !== 0)
13754
+ parts.push("cidrs" + "=" + (0, util_1.inspect)(this.cidrs));
13755
+ if ((this.ports?.length ?? 0) !== 0)
13756
+ parts.push("ports" + "=" + (0, util_1.inspect)(this.ports));
13757
+ return `${this.$type}(${parts.join(", ")})`;
13758
+ }
13759
+ function RuleMatchStatusCustomJson() {
13760
+ const obj = {
13761
+ type: this.$type,
13762
+ };
13763
+ if (this.securityGroupId !== "")
13764
+ obj.securityGroupId = (0, logging_1.inspectJson)(this.securityGroupId);
13765
+ if ((this.cidrs?.length ?? 0) !== 0)
13766
+ obj.cidrs = (0, logging_1.inspectJson)(this.cidrs);
13767
+ if ((this.ports?.length ?? 0) !== 0)
13768
+ obj.ports = (0, logging_1.inspectJson)(this.ports);
13769
+ return obj;
13770
+ }
13771
+ function applyRuleMatchStatusCustom(message) {
13772
+ message[logging_1.custom] = RuleMatchStatusCustomInspect;
13773
+ message[logging_1.customJson] = RuleMatchStatusCustomJson;
13774
+ return message;
13775
+ }
13776
+ function createBaseRuleMatchStatus() {
13777
+ const message = {
13778
+ $type: "nebius.vpc.v1.RuleMatchStatus",
13779
+ securityGroupId: "",
13780
+ cidrs: [],
13781
+ ports: [],
13782
+ };
13783
+ return applyRuleMatchStatusCustom(message);
13784
+ }
10213
13785
  exports.GetSubnetRequest = {
10214
13786
  $type: "nebius.vpc.v1.GetSubnetRequest",
10215
13787
  encode(message, writer = new index_1.BinaryWriter()) {