Reference documentation and code samples for the Google API Common Protos Client class Visibility.
Visibilityrestricts service consumer's access to service elements,
such as whether an application can call a visibility-restricted method.
The restriction is expressed by applying visibility labels on service
elements. The visibility labels are elsewhere linked to service consumers.
A service can define multiple visibility labels, but a service consumer
should be granted at most one visibility label. Multiple visibility
labels for a single service consumer are not supported.
If an element and all its parents have no visibility label, its visibility
is unconditionally granted.
Example:
visibility:
rules:
selector: google.calendar.Calendar.Delegate
restriction: INTERNAL
Here, all methods are publicly visible except for the restricted methods
EnhancedSearch and Delegate.
Generated from protobuf messagegoogle.api.Visibility
[[["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 Visibility (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.Visibility)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.Visibility)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.Visibility)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.Visibility)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.Visibility)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.Visibility) \nReference documentation and code samples for the Google API Common Protos Client class Visibility.\n\n`Visibility` restricts service consumer's access to service elements,\nsuch as whether an application can call a visibility-restricted method.\n\nThe restriction is expressed by applying visibility labels on service\nelements. The visibility labels are elsewhere linked to service consumers.\nA service can define multiple visibility labels, but a service consumer\nshould be granted at most one visibility label. Multiple visibility\nlabels for a single service consumer are not supported.\nIf an element and all its parents have no visibility label, its visibility\nis unconditionally granted.\nExample:\nvisibility:\nrules:\n\n- selector: google.calendar.Calendar.EnhancedSearch restriction: PREVIEW\n- selector: google.calendar.Calendar.Delegate restriction: INTERNAL Here, all methods are publicly visible except for the restricted methods EnhancedSearch and Delegate.\n\nGenerated from protobuf message `google.api.Visibility`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getRules\n\nA list of visibility rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order.\n\n### setRules\n\nA list of visibility rules that apply to individual API elements.\n\n**NOTE:** All service configuration rules follow \"last one wins\" order."]]