Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class Environment.
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:
Generated from protobuf messagegoogle.cloud.dialogflow.v2.Environment
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Output only. The unique identifier of this agent environment. Supported formats: -projects/<Project ID>/agent/environments/<Environment ID>-projects/<Project ID>/locations/<Location ID>/agent/environments/<Environment ID>The environment ID for the default environment is-.
↳ description
string
Optional. The developer-provided description for this environment. The maximum length is 500 characters. If exceeded, the request is rejected.
↳ agent_version
string
Optional. The agent version loaded into this environment. Supported formats: -projects/<Project ID>/agent/versions/<Version ID>-projects/<Project ID>/locations/<Location ID>/agent/versions/<Version ID>
↳ state
int
Output only. The state of this environment. This field is read-only, i.e., it cannot be set by create and update methods.
[[["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 Environment (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.Environment)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.Environment)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.Environment)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.Environment)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.Environment)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.Environment)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.Environment)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.Environment)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.Environment)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.Environment)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.Environment)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.Environment)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.Environment)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.Environment)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.Environment)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.Environment)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.Environment)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.Environment)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.Environment)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.Environment)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.Environment) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class Environment.\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.Environment`\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 environment.\n\nSupported formats:\n\n- `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e`\n- `projects/\u003cProject ID\u003e/locations/\u003cLocation\n ID\u003e/agent/environments/\u003cEnvironment ID\u003e` The environment ID for the default environment is `-`.\n\n### setName\n\nOutput only. The unique identifier of this agent environment.\n\nSupported formats:\n\n- `projects/\u003cProject ID\u003e/agent/environments/\u003cEnvironment ID\u003e`\n- `projects/\u003cProject ID\u003e/locations/\u003cLocation\n ID\u003e/agent/environments/\u003cEnvironment ID\u003e` The environment ID for the default environment is `-`.\n\n### getDescription\n\nOptional. The developer-provided description for this environment.\n\nThe maximum length is 500 characters. If exceeded, the request is rejected.\n\n### setDescription\n\nOptional. The developer-provided description for this environment.\n\nThe maximum length is 500 characters. If exceeded, the request is rejected.\n\n### getAgentVersion\n\nOptional. The agent version loaded into this environment.\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### setAgentVersion\n\nOptional. The agent version loaded into this environment.\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### getState\n\nOutput only. The state of this environment. This field is read-only, i.e.,\nit cannot be set by create and update methods.\n\n### setState\n\nOutput only. The state of this environment. This field is read-only, i.e.,\nit cannot be set by create and update methods.\n\n### getUpdateTime\n\nOutput only. The last update time of this environment. This field is\nread-only, i.e., it cannot be set by create and update methods.\n\n### hasUpdateTime\n\n### clearUpdateTime\n\n### setUpdateTime\n\nOutput only. The last update time of this environment. This field is\nread-only, i.e., it cannot be set by create and update methods.\n\n### getTextToSpeechSettings\n\nOptional. Text to speech settings for this environment.\n\n### hasTextToSpeechSettings\n\n### clearTextToSpeechSettings\n\n### setTextToSpeechSettings\n\nOptional. Text to speech settings for this environment.\n\n### getFulfillment\n\nOptional. The fulfillment settings to use for this environment.\n\n### hasFulfillment\n\n### clearFulfillment\n\n### setFulfillment\n\nOptional. The fulfillment settings to use for this environment."]]