# Google Cloud Dialogflow v2 API - Class EnvironmentsClient (4.30.0)

4.30.0 (latest) 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 abstract class EnvironmentsClient

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

Environments client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> EnvironmentsClient

## Inherited Members

[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)

## Derived Types

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

## Namespace

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

## Assembly

Google.Cloud.Dialogflow.V2.dll

## Remarks

Service for managing \[Environments\]\[google.cloud.dialogflow.v2.Environment\].

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the Environments service, which is a host of "dialogflow.googleapis.com" and a port
of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default Environments scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default Environments scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/dialogflow>

### GrpcClient

    public virtual Environments.EnvironmentsClient GrpcClient { get; }

The underlying gRPC Environments client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environmentshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environments.EnvironmentsClient` |   |

### LocationsClient

    public virtual LocationsClient LocationsClient { get; }

The [LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static EnvironmentsClient Create()

Synchronously creates a [EnvironmentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [EnvironmentsClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient` | The created [EnvironmentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient). |

### CreateAsync(CancellationToken)

    public static Task<EnvironmentsClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [EnvironmentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [EnvironmentsClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient` | The task representing the created [EnvironmentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient). |

### CreateEnvironment(CreateEnvironmentRequest, CallSettings)

    public virtual Environment CreateEnvironment(CreateEnvironmentRequest request, CallSettings callSettings = null)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.CreateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | The RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::CreateEnvironmentRequest request = new gcdv::CreateEnvironmentRequest
    {
        ParentAsAgentName = gcdv::AgentName.FromProject("[PROJECT]"),
        Environment = new gcdv::Environment(),
        EnvironmentId = "",
    };
    // Make the request
    gcdv::Environment response = environmentsClient.CreateEnvironment(request);

### CreateEnvironmentAsync(CreateEnvironmentRequest, CallSettings)

    public virtual Task<Environment> CreateEnvironmentAsync(CreateEnvironmentRequest request, CallSettings callSettings = null)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.CreateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::CreateEnvironmentRequest request = new gcdv::CreateEnvironmentRequest
    {
        ParentAsAgentName = gcdv::AgentName.FromProject("[PROJECT]"),
        Environment = new gcdv::Environment(),
        EnvironmentId = "",
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.CreateEnvironmentAsync(request);

### CreateEnvironmentAsync(CreateEnvironmentRequest, CancellationToken)

    public virtual Task<Environment> CreateEnvironmentAsync(CreateEnvironmentRequest request, CancellationToken cancellationToken)

Creates an agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.CreateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::CreateEnvironmentRequest request = new gcdv::CreateEnvironmentRequest
    {
        ParentAsAgentName = gcdv::AgentName.FromProject("[PROJECT]"),
        Environment = new gcdv::Environment(),
        EnvironmentId = "",
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.CreateEnvironmentAsync(request);

### DeleteEnvironment(DeleteEnvironmentRequest, CallSettings)

    public virtual void DeleteEnvironment(DeleteEnvironmentRequest request, CallSettings callSettings = null)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DeleteEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::DeleteEnvironmentRequest request = new gcdv::DeleteEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    environmentsClient.DeleteEnvironment(request);

### DeleteEnvironmentAsync(DeleteEnvironmentRequest, CallSettings)

    public virtual Task DeleteEnvironmentAsync(DeleteEnvironmentRequest request, CallSettings callSettings = null)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DeleteEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::DeleteEnvironmentRequest request = new gcdv::DeleteEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    await environmentsClient.DeleteEnvironmentAsync(request);

### DeleteEnvironmentAsync(DeleteEnvironmentRequest, CancellationToken)

    public virtual Task DeleteEnvironmentAsync(DeleteEnvironmentRequest request, CancellationToken cancellationToken)

Deletes the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.DeleteEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::DeleteEnvironmentRequest request = new gcdv::DeleteEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    await environmentsClient.DeleteEnvironmentAsync(request);

### GetEnvironment(GetEnvironmentRequest, CallSettings)

    public virtual Environment GetEnvironment(GetEnvironmentRequest request, CallSettings callSettings = null)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | The RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::GetEnvironmentRequest request = new gcdv::GetEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    gcdv::Environment response = environmentsClient.GetEnvironment(request);

### GetEnvironmentAsync(GetEnvironmentRequest, CallSettings)

    public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CallSettings callSettings = null)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::GetEnvironmentRequest request = new gcdv::GetEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.GetEnvironmentAsync(request);

### GetEnvironmentAsync(GetEnvironmentRequest, CancellationToken)

    public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CancellationToken cancellationToken)

Retrieves the specified agent environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::GetEnvironmentRequest request = new gcdv::GetEnvironmentRequest
    {
        EnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.GetEnvironmentAsync(request);

### GetEnvironmentHistory(GetEnvironmentHistoryRequest, CallSettings)

    public virtual PagedEnumerable<EnvironmentHistory, EnvironmentHistory.Types.Entry> GetEnvironmentHistory(GetEnvironmentHistoryRequest request, CallSettings callSettings = null)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEnvironmentHistoryRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistoryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistoryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Types.Entry` | A pageable sequence of [EnvironmentHistory.Types.Entry](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Types.Entry) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::GetEnvironmentHistoryRequest request = new gcdv::GetEnvironmentHistoryRequest
    {
        ParentAsEnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    PagedEnumerable<gcdv::EnvironmentHistory, gcdv::EnvironmentHistory.Types.Entry> response = environmentsClient.GetEnvironmentHistory(request);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (gcdv::EnvironmentHistory.Types.Entry item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (gcdv::EnvironmentHistory page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::EnvironmentHistory.Types.Entry item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::EnvironmentHistory.Types.Entry> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::EnvironmentHistory.Types.Entry item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest, CallSettings)

    public virtual PagedAsyncEnumerable<EnvironmentHistory, EnvironmentHistory.Types.Entry> GetEnvironmentHistoryAsync(GetEnvironmentHistoryRequest request, CallSettings callSettings = null)

Gets the history of the specified environment.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.GetEnvironmentHistoryRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistoryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistoryhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Types.Entry` | A pageable asynchronous sequence of [EnvironmentHistory.Types.Entry](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentHistory.Types.Entry) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::GetEnvironmentHistoryRequest request = new gcdv::GetEnvironmentHistoryRequest
    {
        ParentAsEnvironmentName = gcdv::EnvironmentName.FromProjectEnvironment("[PROJECT]", "[ENVIRONMENT]"),
    };
    // Make the request
    PagedAsyncEnumerable<gcdv::EnvironmentHistory, gcdv::EnvironmentHistory.Types.Entry> response = environmentsClient.GetEnvironmentHistoryAsync(request);

    // Iterate over all response items, lazily performing RPCs as required
    await foreach (gcdv::EnvironmentHistory.Types.Entry item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await foreach (gcdv::EnvironmentHistory page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::EnvironmentHistory.Types.Entry item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::EnvironmentHistory.Types.Entry> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::EnvironmentHistory.Types.Entry item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironments(AgentName, string, int?, CallSettings)

    public virtual PagedEnumerable<ListEnvironmentsResponse, Environment> ListEnvironments(AgentName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.AgentName` Required. The agent to list all environments from. Format: - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::AgentName parent = gcdv::AgentName.FromProject("[PROJECT]");
    // Make the request
    PagedEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironments(parent);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironments(ListEnvironmentsRequest, CallSettings)

    public virtual PagedEnumerable<ListEnvironmentsResponse, Environment> ListEnvironments(ListEnvironmentsRequest request, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::ListEnvironmentsRequest request = new gcdv::ListEnvironmentsRequest
    {
        ParentAsAgentName = gcdv::AgentName.FromProject("[PROJECT]"),
    };
    // Make the request
    PagedEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironments(request);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironments(string, string, int?, CallSettings)

    public virtual PagedEnumerable<ListEnvironmentsResponse, Environment> ListEnvironments(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The agent to list all environments from. Format: - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    string parent = "projects/[PROJECT]/agent";
    // Make the request
    PagedEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironments(parent);

    // Iterate over all response items, lazily performing RPCs as required
    foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = response.ReadPage(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironmentsAsync(AgentName, string, int?, CallSettings)

    public virtual PagedAsyncEnumerable<ListEnvironmentsResponse, Environment> ListEnvironmentsAsync(AgentName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.AgentName` Required. The agent to list all environments from. Format: - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable asynchronous sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::AgentName parent = gcdv::AgentName.FromProject("[PROJECT]");
    // Make the request
    PagedAsyncEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironmentsAsync(parent);

    // Iterate over all response items, lazily performing RPCs as required
    await foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironmentsAsync(ListEnvironmentsRequest, CallSettings)

    public virtual PagedAsyncEnumerable<ListEnvironmentsResponse, Environment> ListEnvironmentsAsync(ListEnvironmentsRequest request, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable asynchronous sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::ListEnvironmentsRequest request = new gcdv::ListEnvironmentsRequest
    {
        ParentAsAgentName = gcdv::AgentName.FromProject("[PROJECT]"),
    };
    // Make the request
    PagedAsyncEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironmentsAsync(request);

    // Iterate over all response items, lazily performing RPCs as required
    await foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ListEnvironmentsAsync(string, string, int?, CallSettings)

    public virtual PagedAsyncEnumerable<ListEnvironmentsResponse, Environment> ListEnvironmentsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The agent to list all environments from. Format: - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent` |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` The size of page to request. The response will not be larger than this, but may be smaller. A value of `null` or `0` uses a server-defined page size. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.ListEnvironmentsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A pageable asynchronous sequence of [Environment](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment) resources. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    string parent = "projects/[PROJECT]/agent";
    // Make the request
    PagedAsyncEnumerable<gcdv::ListEnvironmentsResponse, gcdv::Environment> response = environmentsClient.ListEnvironmentsAsync(parent);

    // Iterate over all response items, lazily performing RPCs as required
    await foreach (gcdv::Environment item in response)
    {
        // Do something with each item
        Console.WriteLine(item);
    }

    // Or iterate over pages (of server-defined size), performing one RPC per page
    await foreach (gcdv::ListEnvironmentsResponse page in response.AsRawResponses())
    {
        // Do something with each page of items
        Console.WriteLine("A page of results:");
        foreach (gcdv::Environment item in page)
        {
            // Do something with each item
            Console.WriteLine(item);
        }
    }

    // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
    int pageSize = 10;
    Page<gcdv::Environment> singlePage = await response.ReadPageAsync(pageSize);
    // Do something with the page of items
    Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
    foreach (gcdv::Environment item in singlePage)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
    // Store the pageToken, for when the next page is required.
    string nextPageToken = singlePage.NextPageToken;

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient#Google_Cloud_Dialogflow_V2_EnvironmentsClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient#Google_Cloud_Dialogflow_V2_EnvironmentsClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient#Google_Cloud_Dialogflow_V2_EnvironmentsClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.EnvironmentsClient#Google_Cloud_Dialogflow_V2_EnvironmentsClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

### UpdateEnvironment(UpdateEnvironmentRequest, CallSettings)

    public virtual Environment UpdateEnvironment(UpdateEnvironmentRequest request, CallSettings callSettings = null)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.UpdateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | The RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = gcdv::EnvironmentsClient.Create();
    // Initialize request argument(s)
    gcdv::UpdateEnvironmentRequest request = new gcdv::UpdateEnvironmentRequest
    {
        Environment = new gcdv::Environment(),
        UpdateMask = new FieldMask(),
        AllowLoadToDraftAndDiscardChanges = false,
    };
    // Make the request
    gcdv::Environment response = environmentsClient.UpdateEnvironment(request);

### UpdateEnvironmentAsync(UpdateEnvironmentRequest, CallSettings)

    public virtual Task<Environment> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, CallSettings callSettings = null)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.UpdateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::UpdateEnvironmentRequest request = new gcdv::UpdateEnvironmentRequest
    {
        Environment = new gcdv::Environment(),
        UpdateMask = new FieldMask(),
        AllowLoadToDraftAndDiscardChanges = false,
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.UpdateEnvironmentAsync(request);

### UpdateEnvironmentAsync(UpdateEnvironmentRequest, CancellationToken)

    public virtual Task<Environment> UpdateEnvironmentAsync(UpdateEnvironmentRequest request, CancellationToken cancellationToken)

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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.UpdateEnvironmentRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    gcdv::EnvironmentsClient environmentsClient = await gcdv::EnvironmentsClient.CreateAsync();
    // Initialize request argument(s)
    gcdv::UpdateEnvironmentRequest request = new gcdv::UpdateEnvironmentRequest
    {
        Environment = new gcdv::Environment(),
        UpdateMask = new FieldMask(),
        AllowLoadToDraftAndDiscardChanges = false,
    };
    // Make the request
    gcdv::Environment response = await environmentsClient.UpdateEnvironmentAsync(request);