Reference documentation and code samples for the Google API Common Protos Client class VisibilityRule.
A visibility rule provides visibility configuration for an individual API
element.
Generated from protobuf message google.api.VisibilityRule
Namespace
Google \ Api
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ selector
string
Selects methods, messages, fields, enums, etc. to which this rule applies. Refer to selector for syntax details.
↳ restriction
string
A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility. If a rule has multiple labels, removing one of the labels but not all of them can break clients. Example: visibility: rules: - selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.
getSelector
Selects methods, messages, fields, enums, etc. to which this rule applies.
A comma-separated list of visibility labels that apply to the selector.
Any of the listed labels can be used to grant the visibility.
If a rule has multiple labels, removing one of the labels but not all of
them can break clients.
Example:
visibility:
rules:
selector: google.calendar.Calendar.EnhancedSearch
restriction: INTERNAL, PREVIEW
Removing INTERNAL from this restriction will break clients that rely on
this method and only had access to it through INTERNAL.
Returns
Type
Description
string
setRestriction
A comma-separated list of visibility labels that apply to the selector.
Any of the listed labels can be used to grant the visibility.
If a rule has multiple labels, removing one of the labels but not all of
them can break clients.
Example:
visibility:
rules:
selector: google.calendar.Calendar.EnhancedSearch
restriction: INTERNAL, PREVIEW
Removing INTERNAL from this restriction will break clients that rely on
this method and only had access to it through INTERNAL.
[[["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-09-04 UTC."],[],[],null,["# Google API Common Protos Client - Class VisibilityRule (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.VisibilityRule)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.VisibilityRule)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.VisibilityRule)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.VisibilityRule)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.VisibilityRule)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.VisibilityRule) \nReference documentation and code samples for the Google API Common Protos Client class VisibilityRule.\n\nA visibility rule provides visibility configuration for an individual API\nelement.\n\nGenerated from protobuf message `google.api.VisibilityRule`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSelector\n\nSelects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### setSelector\n\nSelects methods, messages, fields, enums, etc. to which this rule applies.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### getRestriction\n\nA comma-separated list of visibility labels that apply to the `selector`.\n\nAny of the listed labels can be used to grant the visibility.\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\nExample:\nvisibility:\nrules:\n\n- selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.\n\n### setRestriction\n\nA comma-separated list of visibility labels that apply to the `selector`.\n\nAny of the listed labels can be used to grant the visibility.\nIf a rule has multiple labels, removing one of the labels but not all of\nthem can break clients.\nExample:\nvisibility:\nrules:\n\n- selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL."]]