[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVisibilityRule\u003c/code\u003e class, found in the \u003ccode\u003eGoogle.Api\u003c/code\u003e namespace within the \u003ccode\u003eGoogle.Api.CommonProtos.dll\u003c/code\u003e assembly, configures visibility for individual API elements.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVisibilityRule\u003c/code\u003e implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis class provides constructors to create a new \u003ccode\u003eVisibilityRule\u003c/code\u003e or copy an existing one and includes methods for cloning, comparing, merging, calculating size, and writing to/from a stream.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eVisibilityRule\u003c/code\u003e class has two main properties, \u003ccode\u003eRestriction\u003c/code\u003e which is a list of comma-separated labels, and \u003ccode\u003eSelector\u003c/code\u003e, which targets the elements for the rule to apply to.\u003c/p\u003e\n"],["\u003cp\u003eThere are three versions of \u003ccode\u003eVisibilityRule\u003c/code\u003e available, with the latest being version 2.15.0.\u003c/p\u003e\n"]]],[],null,["# Class VisibilityRule (2.17.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.17.0 (latest)](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.VisibilityRule)\n- [2.15.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.15.0/Google.Api.VisibilityRule)\n- [2.10.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.10.0/Google.Api.VisibilityRule)\n- [2.2.0](/dotnet/docs/reference/Google.Api.CommonProtos/2.2.0/Google.Api.VisibilityRule) \n\n public sealed class VisibilityRule : IMessage\u003cVisibilityRule\u003e, IEquatable\u003cVisibilityRule\u003e, IDeepCloneable\u003cVisibilityRule\u003e, IBufferMessage, IMessage\n\nA visibility rule provides visibility configuration for an individual API\nelement. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e VisibilityRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[VisibilityRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.VisibilityRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[VisibilityRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.VisibilityRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[VisibilityRule](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api.VisibilityRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals)\n\nNamespace\n---------\n\n[Google.Api](/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Api)\n\nAssembly\n--------\n\nGoogle.Api.CommonProtos.dll\n\nConstructors\n------------\n\n### VisibilityRule()\n\n public VisibilityRule()\n\n### VisibilityRule(VisibilityRule)\n\n public VisibilityRule(VisibilityRule other)\n\nFields\n------\n\n### RestrictionFieldNumber\n\n public const int RestrictionFieldNumber = 2\n\nField number for the \"restriction\" field.\n\n### SelectorFieldNumber\n\n public const int SelectorFieldNumber = 1\n\nField number for the \"selector\" field.\n\nProperties\n----------\n\n### Descriptor\n\n public static MessageDescriptor Descriptor { get; }\n\n### Parser\n\n public static MessageParser\u003cVisibilityRule\u003e Parser { get; }\n\n### Restriction\n\n public string Restriction { get; set; }\n\nA comma-separated list of visibility labels that apply to the `selector`.\nAny of the listed labels can be used to grant the visibility.\n\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\n\nExample: \n\n visibility:\n rules:\n - selector: google.calendar.Calendar.EnhancedSearch\n restriction: INTERNAL, PREVIEW\n\nRemoving INTERNAL from this restriction will break clients that rely on\nthis method and only had access to it through INTERNAL.\n\n### Selector\n\n public string Selector { get; set; }\n\nSelects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to \\[selector\\]\\[google.api.DocumentationRule.selector\\] for syntax\ndetails.\n\nMethods\n-------\n\n### CalculateSize()\n\n public int CalculateSize()\n\n### Clone()\n\n public VisibilityRule Clone()\n\n### Equals(VisibilityRule)\n\n public bool Equals(VisibilityRule other)\n\n### Equals(object)\n\n public override bool Equals(object other)\n\n**Overrides** \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object))\n\n### GetHashCode()\n\n public override int GetHashCode()\n\n**Overrides** \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode)\n\n### MergeFrom(VisibilityRule)\n\n public void MergeFrom(VisibilityRule other)\n\n### MergeFrom(CodedInputStream)\n\n public void MergeFrom(CodedInputStream input)\n\n### ToString()\n\n public override string ToString()\n\n**Overrides** \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\n### WriteTo(CodedOutputStream)\n\n public void WriteTo(CodedOutputStream output)"]]