4.34.0 (latest) 4.33.0 4.32.0 4.31.0 4.30.0 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.23.0 4.22.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.16.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0

    public class Environments.EnvironmentsClient : ClientBase<Environments.EnvironmentsClient>

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class Environments.EnvironmentsClient.

Client for Environments

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt)[Environments](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environments.md.txt)[EnvironmentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environments.EnvironmentsClient.md.txt) \> Environments.EnvironmentsClient

## Inherited Members

[ClientBase\<Environments.EnvironmentsClient\>.WithHost(string)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt#Grpc_Core_ClientBase_CallInvoker) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Dialogflow.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.md.txt)

## Assembly

Google.Cloud.Dialogflow.V2.dll

## Constructors

### EnvironmentsClient()

    protected EnvironmentsClient()

Protected parameterless constructor to allow creation of test doubles.

### EnvironmentsClient(CallInvoker)

    public EnvironmentsClient(CallInvoker callInvoker)

Creates a new client for Environments that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `CallInvoker` The callInvoker to use to make remote calls. |

### EnvironmentsClient(ChannelBase)

    public EnvironmentsClient(ChannelBase channel)

Creates a new client for Environments

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `ChannelBase` The channel to use to make remote calls. |

### EnvironmentsClient(ClientBaseConfiguration)

    protected EnvironmentsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` The client configuration. |

## Methods

### CreateEnvironment(CreateEnvironmentRequest, CallOptions)

    public virtual Environment CreateEnvironment(CreateEnvironmentRequest request, CallOptions options)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### CreateEnvironment(CreateEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Environment CreateEnvironment(CreateEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### CreateEnvironmentAsync(CreateEnvironmentRequest, CallOptions)

    public virtual AsyncUnaryCall<Environment> CreateEnvironmentAsync(CreateEnvironmentRequest request, CallOptions options)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |

### CreateEnvironmentAsync(CreateEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Environment> CreateEnvironmentAsync(CreateEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |

### CreateLocationsClient()

    public virtual Locations.LocationsClient CreateLocationsClient()

Creates a new instance of [Locations.LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient.md.txt) using the same call invoker as
this client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `LocationsLocationsClient` | A new [Locations.LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient.md.txt) for the same target as this client. |

### DeleteEnvironment(DeleteEnvironmentRequest, CallOptions)

    public virtual Empty DeleteEnvironment(DeleteEnvironmentRequest request, CallOptions options)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Empty` | The response received from the server. |

### DeleteEnvironment(DeleteEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Empty DeleteEnvironment(DeleteEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Empty` | The response received from the server. |

### DeleteEnvironmentAsync(DeleteEnvironmentRequest, CallOptions)

    public virtual AsyncUnaryCall<Empty> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, CallOptions options)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEmpty` | The call object. |

### DeleteEnvironmentAsync(DeleteEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Empty> DeleteEnvironmentAsync(DeleteEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEmpty` | The call object. |

### GetEnvironment(GetEnvironmentRequest, CallOptions)

    public virtual Environment GetEnvironment(GetEnvironmentRequest request, CallOptions options)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### GetEnvironment(GetEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Environment GetEnvironment(GetEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### GetEnvironmentAsync(GetEnvironmentRequest, CallOptions)

    public virtual AsyncUnaryCall<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CallOptions options)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |

### GetEnvironmentAsync(GetEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |

### GetEnvironmentHistory(GetEnvironmentHistoryRequest, CallOptions)

    public virtual EnvironmentHistory GetEnvironmentHistory(GetEnvironmentHistoryRequest request, CallOptions options)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentHistoryRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `EnvironmentHistory` | The response received from the server. |

### GetEnvironmentHistory(GetEnvironmentHistoryRequest, Metadata, DateTime?, CancellationToken)

    public virtual EnvironmentHistory GetEnvironmentHistory(GetEnvironmentHistoryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentHistoryRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `EnvironmentHistory` | The response received from the server. |

### GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest, CallOptions)

    public virtual AsyncUnaryCall<EnvironmentHistory> GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest request, CallOptions options)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentHistoryRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironmentHistory` | The call object. |

### GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<EnvironmentHistory> GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetEnvironmentHistoryRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironmentHistory` | The call object. |

### ListEnvironments(ListEnvironmentsRequest, CallOptions)

    public virtual ListEnvironmentsResponse ListEnvironments(ListEnvironmentsRequest request, CallOptions options)

Returns the list of all non-default environments of the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListEnvironmentsRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListEnvironmentsResponse` | The response received from the server. |

### ListEnvironments(ListEnvironmentsRequest, Metadata, DateTime?, CancellationToken)

    public virtual ListEnvironmentsResponse ListEnvironments(ListEnvironmentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the list of all non-default environments of the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListEnvironmentsRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListEnvironmentsResponse` | The response received from the server. |

### ListEnvironmentsAsync(ListEnvironmentsRequest, CallOptions)

    public virtual AsyncUnaryCall<ListEnvironmentsResponse> ListEnvironmentsAsync(ListEnvironmentsRequest request, CallOptions options)

Returns the list of all non-default environments of the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListEnvironmentsRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallListEnvironmentsResponse` | The call object. |

### ListEnvironmentsAsync(ListEnvironmentsRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<ListEnvironmentsResponse> ListEnvironmentsAsync(ListEnvironmentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the list of all non-default environments of the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListEnvironmentsRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallListEnvironmentsResponse` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override Environments.EnvironmentsClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `EnvironmentsEnvironmentsClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Dialogflow.V2.Environments.EnvironmentsClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### UpdateEnvironment(UpdateEnvironmentRequest, CallOptions)

    public virtual Environment UpdateEnvironment(UpdateEnvironmentRequest request, CallOptions options)

Updates the specified agent environment.

This method allows you to deploy new agent versions into the environment.
When an environment is pointed to a new agent version by setting
`environment.agent_version`, the environment is temporarily set to the
`LOADING` state. During that time, the environment continues serving the
previous version of the agent. After the new agent version is done loading,
the environment is set back to the `RUNNING` state.
You can use "-" as Environment ID in environment name to update an agent
version in the default environment. WARNING: this will negate all recent
changes to the draft agent and can't be undone. You may want to save the
draft agent to a version before calling this method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### UpdateEnvironment(UpdateEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Environment UpdateEnvironment(UpdateEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates the specified agent environment.

This method allows you to deploy new agent versions into the environment.
When an environment is pointed to a new agent version by setting
`environment.agent_version`, the environment is temporarily set to the
`LOADING` state. During that time, the environment continues serving the
previous version of the agent. After the new agent version is done loading,
the environment is set back to the `RUNNING` state.
You can use "-" as Environment ID in environment name to update an agent
version in the default environment. WARNING: this will negate all recent
changes to the draft agent and can't be undone. You may want to save the
draft agent to a version before calling this method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Environment` | The response received from the server. |

### UpdateEnvironmentAsync(UpdateEnvironmentRequest, CallOptions)

    public virtual AsyncUnaryCall<Environment> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, CallOptions options)

Updates the specified agent environment.

This method allows you to deploy new agent versions into the environment.
When an environment is pointed to a new agent version by setting
`environment.agent_version`, the environment is temporarily set to the
`LOADING` state. During that time, the environment continues serving the
previous version of the agent. After the new agent version is done loading,
the environment is set back to the `RUNNING` state.
You can use "-" as Environment ID in environment name to update an agent
version in the default environment. WARNING: this will negate all recent
changes to the draft agent and can't be undone. You may want to save the
draft agent to a version before calling this method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateEnvironmentRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |

### UpdateEnvironmentAsync(UpdateEnvironmentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Environment> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates the specified agent environment.

This method allows you to deploy new agent versions into the environment.
When an environment is pointed to a new agent version by setting
`environment.agent_version`, the environment is temporarily set to the
`LOADING` state. During that time, the environment continues serving the
previous version of the agent. After the new agent version is done loading,
the environment is set back to the `RUNNING` state.
You can use "-" as Environment ID in environment name to update an agent
version in the default environment. WARNING: this will negate all recent
changes to the draft agent and can't be undone. You may want to save the
draft agent to a version before calling this method.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateEnvironmentRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEnvironment` | The call object. |