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

A reference to a message type, for use in [FieldInfo](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.FieldInfo).

Generated from protobuf message `google.api.TypeReference`

## Namespace

Google \\ Api

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ type_name` | `string` The name of the type that the annotated, generic field may represent. If the type is in the same protobuf package, the value can be the simple message name e.g., `"MyMessage"`. Otherwise, the value must be the fully-qualified message name e.g., `"google.library.v1.Book"`. If the type(s) are unknown to the service (e.g. the field accepts generic user input), use the wildcard `"*"` to denote this behavior. See [AIP-202](https://google.aip.dev/202#type-references) for more details. |

### getTypeName

The name of the type that the annotated, generic field may represent.

If the type is in the same protobuf package, the value can be the simple
message name e.g., `"MyMessage"`. Otherwise, the value must be the
fully-qualified message name e.g., `"google.library.v1.Book"`.
If the type(s) are unknown to the service (e.g. the field accepts generic
user input), use the wildcard `"*"` to denote this behavior.
See [AIP-202](https://google.aip.dev/202#type-references) for more details.

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

### setTypeName

The name of the type that the annotated, generic field may represent.

If the type is in the same protobuf package, the value can be the simple
message name e.g., `"MyMessage"`. Otherwise, the value must be the
fully-qualified message name e.g., `"google.library.v1.Book"`.
If the type(s) are unknown to the service (e.g. the field accepts generic
user input), use the wildcard `"*"` to denote this behavior.
See [AIP-202](https://google.aip.dev/202#type-references) for more details.

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

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