From 2c5c5e5c7ead69b9489c2594e1b3b711e2fb9c33 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 28 May 2026 12:47:02 -0400 Subject: [PATCH] contracts: add BrowseChildren RPC for lazy hierarchy browse --- .../Generated/GalaxyRepository.cs | 1041 ++++++++++++++++- .../Generated/GalaxyRepositoryGrpc.cs | 91 +- .../Protos/galaxy_repository.proto | 47 + .../ProtobufContractRoundTripTests.cs | 109 ++ 4 files changed, 1274 insertions(+), 14 deletions(-) diff --git a/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepository.cs b/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepository.cs index 37e775a..cee1396 100644 --- a/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepository.cs +++ b/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepository.cs @@ -62,18 +62,32 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { "KAUSHwoXYXJyYXlfZGltZW5zaW9uX3ByZXNlbnQYByABKAgSHQoVbXhfYXR0", "cmlidXRlX2NhdGVnb3J5GAggASgFEh8KF3NlY3VyaXR5X2NsYXNzaWZpY2F0", "aW9uGAkgASgFEhUKDWlzX2hpc3Rvcml6ZWQYCiABKAgSEAoIaXNfYWxhcm0Y", - "CyABKAgyzAMKEEdhbGF4eVJlcG9zaXRvcnkSaAoOVGVzdENvbm5lY3Rpb24S", - "Ky5nYWxheHlfcmVwb3NpdG9yeS52MS5UZXN0Q29ubmVjdGlvblJlcXVlc3Qa", - "KS5nYWxheHlfcmVwb3NpdG9yeS52MS5UZXN0Q29ubmVjdGlvblJlcGx5EnEK", - "EUdldExhc3REZXBsb3lUaW1lEi4uZ2FsYXh5X3JlcG9zaXRvcnkudjEuR2V0", - "TGFzdERlcGxveVRpbWVSZXF1ZXN0GiwuZ2FsYXh5X3JlcG9zaXRvcnkudjEu", - "R2V0TGFzdERlcGxveVRpbWVSZXBseRJxChFEaXNjb3ZlckhpZXJhcmNoeRIu", - "LmdhbGF4eV9yZXBvc2l0b3J5LnYxLkRpc2NvdmVySGllcmFyY2h5UmVxdWVz", - "dBosLmdhbGF4eV9yZXBvc2l0b3J5LnYxLkRpc2NvdmVySGllcmFyY2h5UmVw", - "bHkSaAoRV2F0Y2hEZXBsb3lFdmVudHMSLi5nYWxheHlfcmVwb3NpdG9yeS52", - "MS5XYXRjaERlcGxveUV2ZW50c1JlcXVlc3QaIS5nYWxheHlfcmVwb3NpdG9y", - "eS52MS5EZXBsb3lFdmVudDABQi2qAipaQi5NT00uV1cuTXhHYXRld2F5LkNv", - "bnRyYWN0cy5Qcm90by5HYWxheHliBnByb3RvMw==")); + "CyABKAgi3AIKFUJyb3dzZUNoaWxkcmVuUmVxdWVzdBIbChFwYXJlbnRfZ29i", + "amVjdF9pZBgBIAEoBUgAEhkKD3BhcmVudF90YWdfbmFtZRgCIAEoCUgAEh8K", + "FXBhcmVudF9jb250YWluZWRfcGF0aBgDIAEoCUgAEhEKCXBhZ2Vfc2l6ZRgE", + "IAEoBRISCgpwYWdlX3Rva2VuGAUgASgJEhQKDGNhdGVnb3J5X2lkcxgGIAMo", + "BRIfChd0ZW1wbGF0ZV9jaGFpbl9jb250YWlucxgHIAMoCRIVCg10YWdfbmFt", + "ZV9nbG9iGAggASgJEh8KEmluY2x1ZGVfYXR0cmlidXRlcxgJIAEoCEgBiAEB", + "EhoKEmFsYXJtX2JlYXJpbmdfb25seRgKIAEoCBIXCg9oaXN0b3JpemVkX29u", + "bHkYCyABKAhCCAoGcGFyZW50QhUKE19pbmNsdWRlX2F0dHJpYnV0ZXMiswEK", + "E0Jyb3dzZUNoaWxkcmVuUmVwbHkSNAoIY2hpbGRyZW4YASADKAsyIi5nYWxh", + "eHlfcmVwb3NpdG9yeS52MS5HYWxheHlPYmplY3QSFwoPbmV4dF9wYWdlX3Rv", + "a2VuGAIgASgJEhkKEXRvdGFsX2NoaWxkX2NvdW50GAMgASgFEhoKEmNoaWxk", + "X2hhc19jaGlsZHJlbhgEIAMoCBIWCg5jYWNoZV9zZXF1ZW5jZRgFIAEoBDK2", + "BAoQR2FsYXh5UmVwb3NpdG9yeRJoCg5UZXN0Q29ubmVjdGlvbhIrLmdhbGF4", + "eV9yZXBvc2l0b3J5LnYxLlRlc3RDb25uZWN0aW9uUmVxdWVzdBopLmdhbGF4", + "eV9yZXBvc2l0b3J5LnYxLlRlc3RDb25uZWN0aW9uUmVwbHkScQoRR2V0TGFz", + "dERlcGxveVRpbWUSLi5nYWxheHlfcmVwb3NpdG9yeS52MS5HZXRMYXN0RGVw", + "bG95VGltZVJlcXVlc3QaLC5nYWxheHlfcmVwb3NpdG9yeS52MS5HZXRMYXN0", + "RGVwbG95VGltZVJlcGx5EnEKEURpc2NvdmVySGllcmFyY2h5Ei4uZ2FsYXh5", + "X3JlcG9zaXRvcnkudjEuRGlzY292ZXJIaWVyYXJjaHlSZXF1ZXN0GiwuZ2Fs", + "YXh5X3JlcG9zaXRvcnkudjEuRGlzY292ZXJIaWVyYXJjaHlSZXBseRJoChFX", + "YXRjaERlcGxveUV2ZW50cxIuLmdhbGF4eV9yZXBvc2l0b3J5LnYxLldhdGNo", + "RGVwbG95RXZlbnRzUmVxdWVzdBohLmdhbGF4eV9yZXBvc2l0b3J5LnYxLkRl", + "cGxveUV2ZW50MAESaAoOQnJvd3NlQ2hpbGRyZW4SKy5nYWxheHlfcmVwb3Np", + "dG9yeS52MS5Ccm93c2VDaGlsZHJlblJlcXVlc3QaKS5nYWxheHlfcmVwb3Np", + "dG9yeS52MS5Ccm93c2VDaGlsZHJlblJlcGx5Qi2qAipaQi5NT00uV1cuTXhH", + "YXRld2F5LkNvbnRyYWN0cy5Qcm90by5HYWxheHliBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -86,7 +100,9 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.WatchDeployEventsRequest), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.WatchDeployEventsRequest.Parser, new[]{ "LastSeenDeployTime" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.DeployEvent), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.DeployEvent.Parser, new[]{ "Sequence", "ObservedAt", "TimeOfLastDeploy", "TimeOfLastDeployPresent", "ObjectCount", "AttributeCount" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyObject), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyObject.Parser, new[]{ "GobjectId", "TagName", "ContainedName", "BrowseName", "ParentGobjectId", "IsArea", "CategoryId", "HostedByGobjectId", "TemplateChain", "Attributes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyAttribute), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyAttribute.Parser, new[]{ "AttributeName", "FullTagReference", "MxDataType", "DataTypeName", "IsArray", "ArrayDimension", "ArrayDimensionPresent", "MxAttributeCategory", "SecurityClassification", "IsHistorized", "IsAlarm" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyAttribute), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyAttribute.Parser, new[]{ "AttributeName", "FullTagReference", "MxDataType", "DataTypeName", "IsArray", "ArrayDimension", "ArrayDimensionPresent", "MxAttributeCategory", "SecurityClassification", "IsHistorized", "IsAlarm" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest.Parser, new[]{ "ParentGobjectId", "ParentTagName", "ParentContainedPath", "PageSize", "PageToken", "CategoryIds", "TemplateChainContains", "TagNameGlob", "IncludeAttributes", "AlarmBearingOnly", "HistorizedOnly" }, new[]{ "Parent", "IncludeAttributes" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenReply), global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenReply.Parser, new[]{ "Children", "NextPageToken", "TotalChildCount", "ChildHasChildren", "CacheSequence" }, null, null, null, null) })); } #endregion @@ -3561,6 +3577,1005 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { } + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class BrowseChildrenRequest : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BrowseChildrenRequest()); + private pb::UnknownFieldSet _unknownFields; + private int _hasBits0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyRepositoryReflection.Descriptor.MessageTypes[10]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenRequest() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenRequest(BrowseChildrenRequest other) : this() { + _hasBits0 = other._hasBits0; + pageSize_ = other.pageSize_; + pageToken_ = other.pageToken_; + categoryIds_ = other.categoryIds_.Clone(); + templateChainContains_ = other.templateChainContains_.Clone(); + tagNameGlob_ = other.tagNameGlob_; + includeAttributes_ = other.includeAttributes_; + alarmBearingOnly_ = other.alarmBearingOnly_; + historizedOnly_ = other.historizedOnly_; + switch (other.ParentCase) { + case ParentOneofCase.ParentGobjectId: + ParentGobjectId = other.ParentGobjectId; + break; + case ParentOneofCase.ParentTagName: + ParentTagName = other.ParentTagName; + break; + case ParentOneofCase.ParentContainedPath: + ParentContainedPath = other.ParentContainedPath; + break; + } + + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenRequest Clone() { + return new BrowseChildrenRequest(this); + } + + /// Field number for the "parent_gobject_id" field. + public const int ParentGobjectIdFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int ParentGobjectId { + get { return HasParentGobjectId ? (int) parent_ : 0; } + set { + parent_ = value; + parentCase_ = ParentOneofCase.ParentGobjectId; + } + } + /// Gets whether the "parent_gobject_id" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasParentGobjectId { + get { return parentCase_ == ParentOneofCase.ParentGobjectId; } + } + /// Clears the value of the oneof if it's currently set to "parent_gobject_id" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearParentGobjectId() { + if (HasParentGobjectId) { + ClearParent(); + } + } + + /// Field number for the "parent_tag_name" field. + public const int ParentTagNameFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ParentTagName { + get { return HasParentTagName ? (string) parent_ : ""; } + set { + parent_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + parentCase_ = ParentOneofCase.ParentTagName; + } + } + /// Gets whether the "parent_tag_name" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasParentTagName { + get { return parentCase_ == ParentOneofCase.ParentTagName; } + } + /// Clears the value of the oneof if it's currently set to "parent_tag_name" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearParentTagName() { + if (HasParentTagName) { + ClearParent(); + } + } + + /// Field number for the "parent_contained_path" field. + public const int ParentContainedPathFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string ParentContainedPath { + get { return HasParentContainedPath ? (string) parent_ : ""; } + set { + parent_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + parentCase_ = ParentOneofCase.ParentContainedPath; + } + } + /// Gets whether the "parent_contained_path" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasParentContainedPath { + get { return parentCase_ == ParentOneofCase.ParentContainedPath; } + } + /// Clears the value of the oneof if it's currently set to "parent_contained_path" + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearParentContainedPath() { + if (HasParentContainedPath) { + ClearParent(); + } + } + + /// Field number for the "page_size" field. + public const int PageSizeFieldNumber = 4; + private int pageSize_; + /// + /// Maximum number of direct children to return. Server default 500; cap 5000. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int PageSize { + get { return pageSize_; } + set { + pageSize_ = value; + } + } + + /// Field number for the "page_token" field. + public const int PageTokenFieldNumber = 5; + private string pageToken_ = ""; + /// + /// Opaque token returned by a previous BrowseChildren response. Bound to the + /// cache sequence, parent selector, and the filter set; a mismatch returns + /// InvalidArgument. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string PageToken { + get { return pageToken_; } + set { + pageToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "category_ids" field. + public const int CategoryIdsFieldNumber = 6; + private static readonly pb::FieldCodec _repeated_categoryIds_codec + = pb::FieldCodec.ForInt32(50); + private readonly pbc::RepeatedField categoryIds_ = new pbc::RepeatedField(); + /// + /// --- Filter parity with DiscoverHierarchy. AND-combined. --- + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField CategoryIds { + get { return categoryIds_; } + } + + /// Field number for the "template_chain_contains" field. + public const int TemplateChainContainsFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_templateChainContains_codec + = pb::FieldCodec.ForString(58); + private readonly pbc::RepeatedField templateChainContains_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField TemplateChainContains { + get { return templateChainContains_; } + } + + /// Field number for the "tag_name_glob" field. + public const int TagNameGlobFieldNumber = 8; + private string tagNameGlob_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string TagNameGlob { + get { return tagNameGlob_; } + set { + tagNameGlob_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "include_attributes" field. + public const int IncludeAttributesFieldNumber = 9; + private readonly static bool IncludeAttributesDefaultValue = false; + + private bool includeAttributes_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool IncludeAttributes { + get { if ((_hasBits0 & 1) != 0) { return includeAttributes_; } else { return IncludeAttributesDefaultValue; } } + set { + _hasBits0 |= 1; + includeAttributes_ = value; + } + } + /// Gets whether the "include_attributes" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasIncludeAttributes { + get { return (_hasBits0 & 1) != 0; } + } + /// Clears the value of the "include_attributes" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearIncludeAttributes() { + _hasBits0 &= ~1; + } + + /// Field number for the "alarm_bearing_only" field. + public const int AlarmBearingOnlyFieldNumber = 10; + private bool alarmBearingOnly_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool AlarmBearingOnly { + get { return alarmBearingOnly_; } + set { + alarmBearingOnly_ = value; + } + } + + /// Field number for the "historized_only" field. + public const int HistorizedOnlyFieldNumber = 11; + private bool historizedOnly_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HistorizedOnly { + get { return historizedOnly_; } + set { + historizedOnly_ = value; + } + } + + private object parent_; + /// Enum of possible cases for the "parent" oneof. + public enum ParentOneofCase { + None = 0, + ParentGobjectId = 1, + ParentTagName = 2, + ParentContainedPath = 3, + } + private ParentOneofCase parentCase_ = ParentOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ParentOneofCase ParentCase { + get { return parentCase_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearParent() { + parentCase_ = ParentOneofCase.None; + parent_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BrowseChildrenRequest); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BrowseChildrenRequest other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ParentGobjectId != other.ParentGobjectId) return false; + if (ParentTagName != other.ParentTagName) return false; + if (ParentContainedPath != other.ParentContainedPath) return false; + if (PageSize != other.PageSize) return false; + if (PageToken != other.PageToken) return false; + if(!categoryIds_.Equals(other.categoryIds_)) return false; + if(!templateChainContains_.Equals(other.templateChainContains_)) return false; + if (TagNameGlob != other.TagNameGlob) return false; + if (IncludeAttributes != other.IncludeAttributes) return false; + if (AlarmBearingOnly != other.AlarmBearingOnly) return false; + if (HistorizedOnly != other.HistorizedOnly) return false; + if (ParentCase != other.ParentCase) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasParentGobjectId) hash ^= ParentGobjectId.GetHashCode(); + if (HasParentTagName) hash ^= ParentTagName.GetHashCode(); + if (HasParentContainedPath) hash ^= ParentContainedPath.GetHashCode(); + if (PageSize != 0) hash ^= PageSize.GetHashCode(); + if (PageToken.Length != 0) hash ^= PageToken.GetHashCode(); + hash ^= categoryIds_.GetHashCode(); + hash ^= templateChainContains_.GetHashCode(); + if (TagNameGlob.Length != 0) hash ^= TagNameGlob.GetHashCode(); + if (HasIncludeAttributes) hash ^= IncludeAttributes.GetHashCode(); + if (AlarmBearingOnly != false) hash ^= AlarmBearingOnly.GetHashCode(); + if (HistorizedOnly != false) hash ^= HistorizedOnly.GetHashCode(); + hash ^= (int) parentCase_; + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasParentGobjectId) { + output.WriteRawTag(8); + output.WriteInt32(ParentGobjectId); + } + if (HasParentTagName) { + output.WriteRawTag(18); + output.WriteString(ParentTagName); + } + if (HasParentContainedPath) { + output.WriteRawTag(26); + output.WriteString(ParentContainedPath); + } + if (PageSize != 0) { + output.WriteRawTag(32); + output.WriteInt32(PageSize); + } + if (PageToken.Length != 0) { + output.WriteRawTag(42); + output.WriteString(PageToken); + } + categoryIds_.WriteTo(output, _repeated_categoryIds_codec); + templateChainContains_.WriteTo(output, _repeated_templateChainContains_codec); + if (TagNameGlob.Length != 0) { + output.WriteRawTag(66); + output.WriteString(TagNameGlob); + } + if (HasIncludeAttributes) { + output.WriteRawTag(72); + output.WriteBool(IncludeAttributes); + } + if (AlarmBearingOnly != false) { + output.WriteRawTag(80); + output.WriteBool(AlarmBearingOnly); + } + if (HistorizedOnly != false) { + output.WriteRawTag(88); + output.WriteBool(HistorizedOnly); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasParentGobjectId) { + output.WriteRawTag(8); + output.WriteInt32(ParentGobjectId); + } + if (HasParentTagName) { + output.WriteRawTag(18); + output.WriteString(ParentTagName); + } + if (HasParentContainedPath) { + output.WriteRawTag(26); + output.WriteString(ParentContainedPath); + } + if (PageSize != 0) { + output.WriteRawTag(32); + output.WriteInt32(PageSize); + } + if (PageToken.Length != 0) { + output.WriteRawTag(42); + output.WriteString(PageToken); + } + categoryIds_.WriteTo(ref output, _repeated_categoryIds_codec); + templateChainContains_.WriteTo(ref output, _repeated_templateChainContains_codec); + if (TagNameGlob.Length != 0) { + output.WriteRawTag(66); + output.WriteString(TagNameGlob); + } + if (HasIncludeAttributes) { + output.WriteRawTag(72); + output.WriteBool(IncludeAttributes); + } + if (AlarmBearingOnly != false) { + output.WriteRawTag(80); + output.WriteBool(AlarmBearingOnly); + } + if (HistorizedOnly != false) { + output.WriteRawTag(88); + output.WriteBool(HistorizedOnly); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasParentGobjectId) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ParentGobjectId); + } + if (HasParentTagName) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ParentTagName); + } + if (HasParentContainedPath) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ParentContainedPath); + } + if (PageSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PageSize); + } + if (PageToken.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(PageToken); + } + size += categoryIds_.CalculateSize(_repeated_categoryIds_codec); + size += templateChainContains_.CalculateSize(_repeated_templateChainContains_codec); + if (TagNameGlob.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(TagNameGlob); + } + if (HasIncludeAttributes) { + size += 1 + 1; + } + if (AlarmBearingOnly != false) { + size += 1 + 1; + } + if (HistorizedOnly != false) { + size += 1 + 1; + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BrowseChildrenRequest other) { + if (other == null) { + return; + } + if (other.PageSize != 0) { + PageSize = other.PageSize; + } + if (other.PageToken.Length != 0) { + PageToken = other.PageToken; + } + categoryIds_.Add(other.categoryIds_); + templateChainContains_.Add(other.templateChainContains_); + if (other.TagNameGlob.Length != 0) { + TagNameGlob = other.TagNameGlob; + } + if (other.HasIncludeAttributes) { + IncludeAttributes = other.IncludeAttributes; + } + if (other.AlarmBearingOnly != false) { + AlarmBearingOnly = other.AlarmBearingOnly; + } + if (other.HistorizedOnly != false) { + HistorizedOnly = other.HistorizedOnly; + } + switch (other.ParentCase) { + case ParentOneofCase.ParentGobjectId: + ParentGobjectId = other.ParentGobjectId; + break; + case ParentOneofCase.ParentTagName: + ParentTagName = other.ParentTagName; + break; + case ParentOneofCase.ParentContainedPath: + ParentContainedPath = other.ParentContainedPath; + break; + } + + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ParentGobjectId = input.ReadInt32(); + break; + } + case 18: { + ParentTagName = input.ReadString(); + break; + } + case 26: { + ParentContainedPath = input.ReadString(); + break; + } + case 32: { + PageSize = input.ReadInt32(); + break; + } + case 42: { + PageToken = input.ReadString(); + break; + } + case 50: + case 48: { + categoryIds_.AddEntriesFrom(input, _repeated_categoryIds_codec); + break; + } + case 58: { + templateChainContains_.AddEntriesFrom(input, _repeated_templateChainContains_codec); + break; + } + case 66: { + TagNameGlob = input.ReadString(); + break; + } + case 72: { + IncludeAttributes = input.ReadBool(); + break; + } + case 80: { + AlarmBearingOnly = input.ReadBool(); + break; + } + case 88: { + HistorizedOnly = input.ReadBool(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ParentGobjectId = input.ReadInt32(); + break; + } + case 18: { + ParentTagName = input.ReadString(); + break; + } + case 26: { + ParentContainedPath = input.ReadString(); + break; + } + case 32: { + PageSize = input.ReadInt32(); + break; + } + case 42: { + PageToken = input.ReadString(); + break; + } + case 50: + case 48: { + categoryIds_.AddEntriesFrom(ref input, _repeated_categoryIds_codec); + break; + } + case 58: { + templateChainContains_.AddEntriesFrom(ref input, _repeated_templateChainContains_codec); + break; + } + case 66: { + TagNameGlob = input.ReadString(); + break; + } + case 72: { + IncludeAttributes = input.ReadBool(); + break; + } + case 80: { + AlarmBearingOnly = input.ReadBool(); + break; + } + case 88: { + HistorizedOnly = input.ReadBool(); + break; + } + } + } + } + #endif + + } + + [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] + public sealed partial class BrowseChildrenReply : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BrowseChildrenReply()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyRepositoryReflection.Descriptor.MessageTypes[11]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenReply() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenReply(BrowseChildrenReply other) : this() { + children_ = other.children_.Clone(); + nextPageToken_ = other.nextPageToken_; + totalChildCount_ = other.totalChildCount_; + childHasChildren_ = other.childHasChildren_.Clone(); + cacheSequence_ = other.cacheSequence_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public BrowseChildrenReply Clone() { + return new BrowseChildrenReply(this); + } + + /// Field number for the "children" field. + public const int ChildrenFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_children_codec + = pb::FieldCodec.ForMessage(10, global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.GalaxyObject.Parser); + private readonly pbc::RepeatedField children_ = new pbc::RepeatedField(); + /// + /// Direct children matching the filter, sorted areas-first then by + /// case-insensitive display name (same order as the dashboard tree). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Children { + get { return children_; } + } + + /// Field number for the "next_page_token" field. + public const int NextPageTokenFieldNumber = 2; + private string nextPageToken_ = ""; + /// + /// Non-empty when another page of siblings is available. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string NextPageToken { + get { return nextPageToken_; } + set { + nextPageToken_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "total_child_count" field. + public const int TotalChildCountFieldNumber = 3; + private int totalChildCount_; + /// + /// Total matching direct children of the parent (post-filter). + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int TotalChildCount { + get { return totalChildCount_; } + set { + totalChildCount_ = value; + } + } + + /// Field number for the "child_has_children" field. + public const int ChildHasChildrenFieldNumber = 4; + private static readonly pb::FieldCodec _repeated_childHasChildren_codec + = pb::FieldCodec.ForBool(34); + private readonly pbc::RepeatedField childHasChildren_ = new pbc::RepeatedField(); + /// + /// Parallel array, indexed with `children`. True when the child has at least + /// one matching descendant under the same filter set. Lets a UI choose + /// whether to draw an expand triangle without an extra round trip. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField ChildHasChildren { + get { return childHasChildren_; } + } + + /// Field number for the "cache_sequence" field. + public const int CacheSequenceFieldNumber = 5; + private ulong cacheSequence_; + /// + /// Cache sequence this reply was projected from. Clients may pass it back as + /// part of the page_token contract. Mismatch on the next page -> InvalidArgument. + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public ulong CacheSequence { + get { return cacheSequence_; } + set { + cacheSequence_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as BrowseChildrenReply); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(BrowseChildrenReply other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!children_.Equals(other.children_)) return false; + if (NextPageToken != other.NextPageToken) return false; + if (TotalChildCount != other.TotalChildCount) return false; + if(!childHasChildren_.Equals(other.childHasChildren_)) return false; + if (CacheSequence != other.CacheSequence) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= children_.GetHashCode(); + if (NextPageToken.Length != 0) hash ^= NextPageToken.GetHashCode(); + if (TotalChildCount != 0) hash ^= TotalChildCount.GetHashCode(); + hash ^= childHasChildren_.GetHashCode(); + if (CacheSequence != 0UL) hash ^= CacheSequence.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + children_.WriteTo(output, _repeated_children_codec); + if (NextPageToken.Length != 0) { + output.WriteRawTag(18); + output.WriteString(NextPageToken); + } + if (TotalChildCount != 0) { + output.WriteRawTag(24); + output.WriteInt32(TotalChildCount); + } + childHasChildren_.WriteTo(output, _repeated_childHasChildren_codec); + if (CacheSequence != 0UL) { + output.WriteRawTag(40); + output.WriteUInt64(CacheSequence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + children_.WriteTo(ref output, _repeated_children_codec); + if (NextPageToken.Length != 0) { + output.WriteRawTag(18); + output.WriteString(NextPageToken); + } + if (TotalChildCount != 0) { + output.WriteRawTag(24); + output.WriteInt32(TotalChildCount); + } + childHasChildren_.WriteTo(ref output, _repeated_childHasChildren_codec); + if (CacheSequence != 0UL) { + output.WriteRawTag(40); + output.WriteUInt64(CacheSequence); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += children_.CalculateSize(_repeated_children_codec); + if (NextPageToken.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(NextPageToken); + } + if (TotalChildCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TotalChildCount); + } + size += childHasChildren_.CalculateSize(_repeated_childHasChildren_codec); + if (CacheSequence != 0UL) { + size += 1 + pb::CodedOutputStream.ComputeUInt64Size(CacheSequence); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(BrowseChildrenReply other) { + if (other == null) { + return; + } + children_.Add(other.children_); + if (other.NextPageToken.Length != 0) { + NextPageToken = other.NextPageToken; + } + if (other.TotalChildCount != 0) { + TotalChildCount = other.TotalChildCount; + } + childHasChildren_.Add(other.childHasChildren_); + if (other.CacheSequence != 0UL) { + CacheSequence = other.CacheSequence; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + children_.AddEntriesFrom(input, _repeated_children_codec); + break; + } + case 18: { + NextPageToken = input.ReadString(); + break; + } + case 24: { + TotalChildCount = input.ReadInt32(); + break; + } + case 34: + case 32: { + childHasChildren_.AddEntriesFrom(input, _repeated_childHasChildren_codec); + break; + } + case 40: { + CacheSequence = input.ReadUInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + if ((tag & 7) == 4) { + // Abort on any end group tag. + return; + } + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + children_.AddEntriesFrom(ref input, _repeated_children_codec); + break; + } + case 18: { + NextPageToken = input.ReadString(); + break; + } + case 24: { + TotalChildCount = input.ReadInt32(); + break; + } + case 34: + case 32: { + childHasChildren_.AddEntriesFrom(ref input, _repeated_childHasChildren_codec); + break; + } + case 40: { + CacheSequence = input.ReadUInt64(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepositoryGrpc.cs b/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepositoryGrpc.cs index 0062d92..bc5b691 100644 --- a/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepositoryGrpc.cs +++ b/src/ZB.MOM.WW.MxGateway.Contracts/Generated/GalaxyRepositoryGrpc.cs @@ -67,6 +67,10 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { static readonly grpc::Marshaller __Marshaller_galaxy_repository_v1_WatchDeployEventsRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.WatchDeployEventsRequest.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Marshaller __Marshaller_galaxy_repository_v1_DeployEvent = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.DeployEvent.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_galaxy_repository_v1_BrowseChildrenRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest.Parser)); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Marshaller __Marshaller_galaxy_repository_v1_BrowseChildrenReply = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenReply.Parser)); [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] static readonly grpc::Method __Method_TestConnection = new grpc::Method( @@ -100,6 +104,14 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { __Marshaller_galaxy_repository_v1_WatchDeployEventsRequest, __Marshaller_galaxy_repository_v1_DeployEvent); + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + static readonly grpc::Method __Method_BrowseChildren = new grpc::Method( + grpc::MethodType.Unary, + __ServiceName, + "BrowseChildren", + __Marshaller_galaxy_repository_v1_BrowseChildrenRequest, + __Marshaller_galaxy_repository_v1_BrowseChildrenReply); + /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { @@ -146,6 +158,21 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); } + /// + /// Returns the direct children of a parent object (or the root objects when + /// `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + /// one level at a time instead of paging the full hierarchy. Filters mirror + /// DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + /// + /// The request received from the client. + /// The context of the server-side call handler being invoked. + /// The response to send back to the client (wrapped by a task). + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::System.Threading.Tasks.Task BrowseChildren(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest request, grpc::ServerCallContext context) + { + throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); + } + } /// Client for GalaxyRepository @@ -269,6 +296,66 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { { return CallInvoker.AsyncServerStreamingCall(__Method_WatchDeployEvents, null, options, request); } + /// + /// Returns the direct children of a parent object (or the root objects when + /// `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + /// one level at a time instead of paging the full hierarchy. Filters mirror + /// DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenReply BrowseChildren(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return BrowseChildren(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Returns the direct children of a parent object (or the root objects when + /// `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + /// one level at a time instead of paging the full hierarchy. Filters mirror + /// DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + /// + /// The request to send to the server. + /// The options for the call. + /// The response received from the server. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenReply BrowseChildren(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest request, grpc::CallOptions options) + { + return CallInvoker.BlockingUnaryCall(__Method_BrowseChildren, null, options, request); + } + /// + /// Returns the direct children of a parent object (or the root objects when + /// `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + /// one level at a time instead of paging the full hierarchy. Filters mirror + /// DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + /// + /// The request to send to the server. + /// The initial metadata to send with the call. This parameter is optional. + /// An optional deadline for the call. The call will be cancelled if deadline is hit. + /// An optional token for canceling the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall BrowseChildrenAsync(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) + { + return BrowseChildrenAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); + } + /// + /// Returns the direct children of a parent object (or the root objects when + /// `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + /// one level at a time instead of paging the full hierarchy. Filters mirror + /// DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + /// + /// The request to send to the server. + /// The options for the call. + /// The call object. + [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] + public virtual grpc::AsyncUnaryCall BrowseChildrenAsync(global::ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy.BrowseChildrenRequest request, grpc::CallOptions options) + { + return CallInvoker.AsyncUnaryCall(__Method_BrowseChildren, null, options, request); + } /// Creates a new instance of client from given ClientBaseConfiguration. [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] protected override GalaxyRepositoryClient NewInstance(ClientBaseConfiguration configuration) @@ -286,7 +373,8 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { .AddMethod(__Method_TestConnection, serviceImpl.TestConnection) .AddMethod(__Method_GetLastDeployTime, serviceImpl.GetLastDeployTime) .AddMethod(__Method_DiscoverHierarchy, serviceImpl.DiscoverHierarchy) - .AddMethod(__Method_WatchDeployEvents, serviceImpl.WatchDeployEvents).Build(); + .AddMethod(__Method_WatchDeployEvents, serviceImpl.WatchDeployEvents) + .AddMethod(__Method_BrowseChildren, serviceImpl.BrowseChildren).Build(); } /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. @@ -300,6 +388,7 @@ namespace ZB.MOM.WW.MxGateway.Contracts.Proto.Galaxy { serviceBinder.AddMethod(__Method_GetLastDeployTime, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.GetLastDeployTime)); serviceBinder.AddMethod(__Method_DiscoverHierarchy, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.DiscoverHierarchy)); serviceBinder.AddMethod(__Method_WatchDeployEvents, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod(serviceImpl.WatchDeployEvents)); + serviceBinder.AddMethod(__Method_BrowseChildren, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.BrowseChildren)); } } diff --git a/src/ZB.MOM.WW.MxGateway.Contracts/Protos/galaxy_repository.proto b/src/ZB.MOM.WW.MxGateway.Contracts/Protos/galaxy_repository.proto index bf10d35..7b4a171 100644 --- a/src/ZB.MOM.WW.MxGateway.Contracts/Protos/galaxy_repository.proto +++ b/src/ZB.MOM.WW.MxGateway.Contracts/Protos/galaxy_repository.proto @@ -30,6 +30,12 @@ service GalaxyRepository { // increasing per server start; gaps indicate the per-subscriber buffer dropped // older events because the client was too slow. rpc WatchDeployEvents(WatchDeployEventsRequest) returns (stream DeployEvent); + + // Returns the direct children of a parent object (or the root objects when + // `parent` is unset). Designed for OPC UA-style lazy expand: clients walk + // one level at a time instead of paging the full hierarchy. Filters mirror + // DiscoverHierarchy exactly. Backed by the same shared hierarchy cache. + rpc BrowseChildren(BrowseChildrenRequest) returns (BrowseChildrenReply); } message TestConnectionRequest {} @@ -141,3 +147,44 @@ message GalaxyAttribute { bool is_historized = 10; bool is_alarm = 11; } + +message BrowseChildrenRequest { + // Parent selector. Empty oneof returns root objects (parent_gobject_id == 0). + oneof parent { + int32 parent_gobject_id = 1; + string parent_tag_name = 2; + string parent_contained_path = 3; + } + + // Maximum number of direct children to return. Server default 500; cap 5000. + int32 page_size = 4; + // Opaque token returned by a previous BrowseChildren response. Bound to the + // cache sequence, parent selector, and the filter set; a mismatch returns + // InvalidArgument. + string page_token = 5; + + // --- Filter parity with DiscoverHierarchy. AND-combined. --- + repeated int32 category_ids = 6; + repeated string template_chain_contains = 7; + string tag_name_glob = 8; + optional bool include_attributes = 9; + bool alarm_bearing_only = 10; + bool historized_only = 11; +} + +message BrowseChildrenReply { + // Direct children matching the filter, sorted areas-first then by + // case-insensitive display name (same order as the dashboard tree). + repeated GalaxyObject children = 1; + // Non-empty when another page of siblings is available. + string next_page_token = 2; + // Total matching direct children of the parent (post-filter). + int32 total_child_count = 3; + // Parallel array, indexed with `children`. True when the child has at least + // one matching descendant under the same filter set. Lets a UI choose + // whether to draw an expand triangle without an extra round trip. + repeated bool child_has_children = 4; + // Cache sequence this reply was projected from. Clients may pass it back as + // part of the page_token contract. Mismatch on the next page -> InvalidArgument. + uint64 cache_sequence = 5; +} diff --git a/src/ZB.MOM.WW.MxGateway.Tests/Contracts/ProtobufContractRoundTripTests.cs b/src/ZB.MOM.WW.MxGateway.Tests/Contracts/ProtobufContractRoundTripTests.cs index 036b0e4..f35fe70 100644 --- a/src/ZB.MOM.WW.MxGateway.Tests/Contracts/ProtobufContractRoundTripTests.cs +++ b/src/ZB.MOM.WW.MxGateway.Tests/Contracts/ProtobufContractRoundTripTests.cs @@ -661,6 +661,7 @@ public sealed class ProtobufContractRoundTripTests Assert.Contains(service.Methods, method => method.Name == "GetLastDeployTime"); Assert.Contains(service.Methods, method => method.Name == "DiscoverHierarchy"); Assert.Contains(service.Methods, method => method.Name == "WatchDeployEvents"); + Assert.Contains(service.Methods, method => method.Name == "BrowseChildren"); } /// @@ -769,6 +770,114 @@ public sealed class ProtobufContractRoundTripTests Assert.True(parsed.Objects[0].Attributes[0].IsAlarm); } + /// + /// Verifies that a BrowseChildrenRequest round-trips through every + /// parent oneof arm with the full filter set populated. + /// + /// The oneof arm selector (0=ParentGobjectId, 1=ParentTagName, 2=ParentContainedPath). + [Theory] + [InlineData(0)] + [InlineData(1)] + [InlineData(2)] + public void BrowseChildrenRequest_RoundTripsParentOneofAndFilters(int parentArm) + { + var original = new BrowseChildrenRequest + { + PageSize = 200, + PageToken = "opaque-2", + CategoryIds = { 3, 9 }, + TemplateChainContains = { "Analog", "Pump" }, + TagNameGlob = "Tank*", + IncludeAttributes = true, + AlarmBearingOnly = true, + HistorizedOnly = false, + }; + switch (parentArm) + { + case 0: + original.ParentGobjectId = 4711; + break; + case 1: + original.ParentTagName = "Tank01"; + break; + default: + original.ParentContainedPath = "Area1.Tank01"; + break; + } + + var parsed = BrowseChildrenRequest.Parser.ParseFrom(original.ToByteArray()); + + Assert.Equal(original, parsed); + Assert.Equal(original.ParentCase, parsed.ParentCase); + Assert.NotEqual(BrowseChildrenRequest.ParentOneofCase.None, parsed.ParentCase); + Assert.True(parsed.HasIncludeAttributes); + Assert.True(parsed.IncludeAttributes); + } + + /// + /// Verifies that a BrowseChildrenReply round-trips its children list, + /// the parallel-indexed child_has_children array, and the + /// cache sequence used to bind page tokens. + /// + [Fact] + public void BrowseChildrenReply_RoundTripsChildrenAndHasChildrenParallelArrays() + { + var original = new BrowseChildrenReply + { + NextPageToken = "opaque-3", + TotalChildCount = 2, + CacheSequence = 42UL, + Children = + { + new GalaxyObject + { + GobjectId = 4711, + TagName = "Tank01", + ContainedName = "Tank01", + BrowseName = "Tank 01", + ParentGobjectId = 12, + IsArea = false, + CategoryId = 3, + HostedByGobjectId = 8, + TemplateChain = { "$AnalogDevice", "$Tank" }, + Attributes = + { + new GalaxyAttribute + { + AttributeName = "Level", + FullTagReference = "Galaxy!Tank01.Level", + MxDataType = 3, + DataTypeName = "Float", + IsArray = false, + ArrayDimension = 0, + ArrayDimensionPresent = false, + MxAttributeCategory = 1, + SecurityClassification = 0, + IsHistorized = true, + IsAlarm = true, + }, + }, + }, + new GalaxyObject + { + GobjectId = 12, + TagName = "Area1", + IsArea = true, + }, + }, + ChildHasChildren = { true, false }, + }; + + var parsed = BrowseChildrenReply.Parser.ParseFrom(original.ToByteArray()); + + Assert.Equal(original, parsed); + Assert.Equal(2, parsed.Children.Count); + Assert.Equal(2, parsed.ChildHasChildren.Count); + Assert.True(parsed.ChildHasChildren[0]); + Assert.False(parsed.ChildHasChildren[1]); + Assert.Equal(42UL, parsed.CacheSequence); + } + /// Verifies that a DeployEvent round-trips with its timestamp and counters. [Fact] public void DeployEvent_RoundTripsTimestampAndCounters()