Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class Version.
You can create multiple versions of your agent and publish them to separate
environments.
When you edit an agent, you are editing the draft agent. At any point, you
can save the draft agent as an agent version, which is an immutable snapshot
of your agent.
When you save the draft agent, it is published to the default environment.
When you create agent versions, you can publish them to custom environments.
You can create a variety of custom environments for:
[[["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 Cloud Dialogflow V2 Client - Class Version (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.Version)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.Version)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.Version)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.Version)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.Version)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.Version)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.Version)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.Version)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.Version)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.Version)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.Version)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.Version)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.Version)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.Version)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.Version)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.Version)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.Version)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.Version)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.Version)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.Version)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.Version) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class Version.\n\nYou can create multiple versions of your agent and publish them to separate\nenvironments.\n\nWhen you edit an agent, you are editing the draft agent. At any point, you\ncan save the draft agent as an agent version, which is an immutable snapshot\nof your agent.\nWhen you save the draft agent, it is published to the default environment.\nWhen you create agent versions, you can publish them to custom environments.\nYou can create a variety of custom environments for:\n\n- testing\n- development\n- production\n- etc. For more information, see the [versions and environments\n guide](https://cloud.google.com/dialogflow/docs/agents-versions).\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.Version`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOutput only. The unique identifier of this agent version.\n\nSupported formats:\n\n- `projects/\u003cProject ID\u003e/agent/versions/\u003cVersion ID\u003e`\n- `projects/\u003cProject ID\u003e/locations/\u003cLocation ID\u003e/agent/versions/\u003cVersion\n ID\u003e`\n\n### setName\n\nOutput only. The unique identifier of this agent version.\n\nSupported formats:\n\n- `projects/\u003cProject ID\u003e/agent/versions/\u003cVersion ID\u003e`\n- `projects/\u003cProject ID\u003e/locations/\u003cLocation ID\u003e/agent/versions/\u003cVersion\n ID\u003e`\n\n### getDescription\n\nOptional. The developer-provided description of this version.\n\n### setDescription\n\nOptional. The developer-provided description of this version.\n\n### getVersionNumber\n\nOutput only. The sequential number of this version. This field is read-only\nwhich means it cannot be set by create and update methods.\n\n### setVersionNumber\n\nOutput only. The sequential number of this version. This field is read-only\nwhich means it cannot be set by create and update methods.\n\n### getCreateTime\n\nOutput only. The creation time of this version. This field is read-only,\ni.e., it cannot be set by create and update methods.\n\n### hasCreateTime\n\n### clearCreateTime\n\n### setCreateTime\n\nOutput only. The creation time of this version. This field is read-only,\ni.e., it cannot be set by create and update methods.\n\n### getStatus\n\nOutput only. The status of this version. This field is read-only and cannot\nbe set by create and update methods.\n\n### setStatus\n\nOutput only. The status of this version. This field is read-only and cannot\nbe set by create and update methods."]]