# Google API Common Protos Client - Class ContextRule (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 ContextRule.

A context rule provides information about the context for an individual API
element.

Generated from protobuf message `google.api.ContextRule`

## Namespace

Google \\ Api

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ selector` | `string` Selects the methods 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. |
| `↳ requested` | `string[]` A list of full type names of requested contexts, only the requested context will be made available to the backend. |
| `↳ provided` | `string[]` A list of full type names of provided contexts. It is used to support propagating HTTP headers and ETags from the response extension. |
| `↳ allowed_request_extensions` | `string[]` A list of full type names or extension IDs of extensions allowed in grpc side channel from client to backend. |
| `↳ allowed_response_extensions` | `string[]` A list of full type names or extension IDs of extensions allowed in grpc side channel from backend to client. |

### getSelector

Selects the methods 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 the methods 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` |   |

### getRequested

A list of full type names of requested contexts, only the requested context
will be made available to the backend.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setRequested

A list of full type names of requested contexts, only the requested context
will be made available to the backend.

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

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

### getProvided

A list of full type names of provided contexts. It is used to support
propagating HTTP headers and ETags from the response extension.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setProvided

A list of full type names of provided contexts. It is used to support
propagating HTTP headers and ETags from the response extension.

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

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

### getAllowedRequestExtensions

A list of full type names or extension IDs of extensions allowed in grpc
side channel from client to backend.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedRequestExtensions

A list of full type names or extension IDs of extensions allowed in grpc
side channel from client to backend.

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

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

### getAllowedResponseExtensions

A list of full type names or extension IDs of extensions allowed in grpc
side channel from backend to client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedResponseExtensions

A list of full type names or extension IDs of extensions allowed in grpc
side channel from backend to client.

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

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