Reference documentation and code samples for the Google API Common Protos Client class TypeReference.
A reference to a message type, for use in 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 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 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 for more details.
[[["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-08-28 UTC."],[],[],null,["# Google API Common Protos Client - Class TypeReference (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.TypeReference)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.TypeReference)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.TypeReference)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.TypeReference)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.TypeReference)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.TypeReference) \nReference documentation and code samples for the Google API Common Protos Client class TypeReference.\n\nA reference to a message type, for use in [FieldInfo](/php/docs/reference/common-protos/latest/Api.FieldInfo).\n\nGenerated from protobuf message `google.api.TypeReference`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getTypeName\n\nThe name of the type that the annotated, generic field may represent.\n\nIf the type is in the same protobuf package, the value can be the simple\nmessage name e.g., `\"MyMessage\"`. Otherwise, the value must be the\nfully-qualified message name e.g., `\"google.library.v1.Book\"`.\nIf the type(s) are unknown to the service (e.g. the field accepts generic\nuser input), use the wildcard `\"*\"` to denote this behavior.\nSee [AIP-202](https://google.aip.dev/202#type-references) for more details.\n\n### setTypeName\n\nThe name of the type that the annotated, generic field may represent.\n\nIf the type is in the same protobuf package, the value can be the simple\nmessage name e.g., `\"MyMessage\"`. Otherwise, the value must be the\nfully-qualified message name e.g., `\"google.library.v1.Book\"`.\nIf the type(s) are unknown to the service (e.g. the field accepts generic\nuser input), use the wildcard `\"*\"` to denote this behavior.\nSee [AIP-202](https://google.aip.dev/202#type-references) for more details."]]