# Google API Common Protos Client - Class VisibilityRule (4.14.0)

4.14.0 (latest) 4.13.0 4.12.5 4.11.0 4.10.0 4.9.0 4.8.3 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](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) 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.

Refer to [selector](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax
details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSelector

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to [selector](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax
details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRestriction

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |