# Google Cloud Dialogflow V2 Client - Class Environment (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 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:

- testing
- development
- production
- etc. For more information, see the [versions and environments
  guide](https://cloud.google.com/dialogflow/docs/agents-versions).

Generated from protobuf message `google.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. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last update time of this environment. This field is read-only, i.e., it cannot be set by create and update methods. |
| `↳ text_to_speech_settings` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.TextToSpeechSettings` Optional. Text to speech settings for this environment. |
| `↳ fulfillment` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Fulfillment` Optional. The fulfillment settings to use for this environment. |

### getName

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 `-`.

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

### setName

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 `-`.

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

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

### getDescription

Optional. The developer-provided description for this environment.

The maximum length is 500 characters. If exceeded, the request is rejected.

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

### setDescription

Optional. The developer-provided description for this environment.

The maximum length is 500 characters. If exceeded, the request is rejected.

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

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

### getAgentVersion

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>`

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

### setAgentVersion

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>`

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

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

### getState

Output only. The state of this environment. This field is read-only, i.e.,
it cannot be set by create and update methods.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Environment.State). |

### setState

Output only. The state of this environment. This field is read-only, i.e.,
it cannot be set by create and update methods.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Environment.State). |

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

### getUpdateTime

Output only. The last update time of this environment. This field is
read-only, i.e., it cannot be set by create and update methods.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last update time of this environment. This field is
read-only, i.e., it cannot be set by create and update methods.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getTextToSpeechSettings

Optional. Text to speech settings for this environment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.TextToSpeechSettings|null` |   |

### hasTextToSpeechSettings

### clearTextToSpeechSettings

### setTextToSpeechSettings

Optional. Text to speech settings for this environment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.TextToSpeechSettings` |

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

### getFulfillment

Optional. The fulfillment settings to use for this environment.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Fulfillment|null` |   |

### hasFulfillment

### clearFulfillment

### setFulfillment

Optional. The fulfillment settings to use for this environment.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Fulfillment` |

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