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 Agents.AgentsClient : ClientBase<Agents.AgentsClient>

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

Client for Agents

## 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)[Agents](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Agents.md.txt)[AgentsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dialogflow.V2/latest/Google.Cloud.Dialogflow.V2.Agents.AgentsClient.md.txt) \> Agents.AgentsClient

## Inherited Members

[ClientBase\<Agents.AgentsClient\>.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

### AgentsClient()

    protected AgentsClient()

Protected parameterless constructor to allow creation of test doubles.

### AgentsClient(CallInvoker)

    public AgentsClient(CallInvoker callInvoker)

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

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

### AgentsClient(ChannelBase)

    public AgentsClient(ChannelBase channel)

Creates a new client for Agents

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

### AgentsClient(ClientBaseConfiguration)

    protected AgentsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

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

## Methods

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

### CreateOperationsClient()

    public virtual Operations.OperationsClient CreateOperationsClient()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OperationsOperationsClient` | A new Operations client for the same target as this client. |

### DeleteAgent(DeleteAgentRequest, CallOptions)

    public virtual Empty DeleteAgent(DeleteAgentRequest request, CallOptions options)

Deletes the specified agent.

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

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

### DeleteAgent(DeleteAgentRequest, Metadata, DateTime?, CancellationToken)

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

Deletes the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteAgentRequest` 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. |

### DeleteAgentAsync(DeleteAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Empty> DeleteAgentAsync(DeleteAgentRequest request, CallOptions options)

Deletes the specified agent.

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

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

### DeleteAgentAsync(DeleteAgentRequest, Metadata, DateTime?, CancellationToken)

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

Deletes the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteAgentRequest` 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. |

### ExportAgent(ExportAgentRequest, CallOptions)

    public virtual Operation ExportAgent(ExportAgentRequest request, CallOptions options)

Exports the specified agent to a ZIP file.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: \[ExportAgentResponse\]\[google.cloud.dialogflow.v2.ExportAgentResponse\]

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

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

### ExportAgent(ExportAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation ExportAgent(ExportAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Exports the specified agent to a ZIP file.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: \[ExportAgentResponse\]\[google.cloud.dialogflow.v2.ExportAgentResponse\]

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ExportAgentRequest` 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** |
| `Operation` | The response received from the server. |

### ExportAgentAsync(ExportAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> ExportAgentAsync(ExportAgentRequest request, CallOptions options)

Exports the specified agent to a ZIP file.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: \[ExportAgentResponse\]\[google.cloud.dialogflow.v2.ExportAgentResponse\]

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

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

### ExportAgentAsync(ExportAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> ExportAgentAsync(ExportAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Exports the specified agent to a ZIP file.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: \[ExportAgentResponse\]\[google.cloud.dialogflow.v2.ExportAgentResponse\]

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ExportAgentRequest` 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** |
| `AsyncUnaryCallOperation` | The call object. |

### GetAgent(GetAgentRequest, CallOptions)

    public virtual Agent GetAgent(GetAgentRequest request, CallOptions options)

Retrieves the specified agent.

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

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

### GetAgent(GetAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Agent GetAgent(GetAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetAgentRequest` 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** |
| `Agent` | The response received from the server. |

### GetAgentAsync(GetAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Agent> GetAgentAsync(GetAgentRequest request, CallOptions options)

Retrieves the specified agent.

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

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

### GetAgentAsync(GetAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Agent> GetAgentAsync(GetAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Retrieves the specified agent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetAgentRequest` 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** |
| `AsyncUnaryCallAgent` | The call object. |

### GetValidationResult(GetValidationResultRequest, CallOptions)

    public virtual ValidationResult GetValidationResult(GetValidationResultRequest request, CallOptions options)

Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.

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

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

### GetValidationResult(GetValidationResultRequest, Metadata, DateTime?, CancellationToken)

    public virtual ValidationResult GetValidationResult(GetValidationResultRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetValidationResultRequest` 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** |
| `ValidationResult` | The response received from the server. |

### GetValidationResultAsync(GetValidationResultRequest, CallOptions)

    public virtual AsyncUnaryCall<ValidationResult> GetValidationResultAsync(GetValidationResultRequest request, CallOptions options)

Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.

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

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

### GetValidationResultAsync(GetValidationResultRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<ValidationResult> GetValidationResultAsync(GetValidationResultRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets agent validation result. Agent validation is performed during
training time and is updated automatically when training is completed.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetValidationResultRequest` 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** |
| `AsyncUnaryCallValidationResult` | The call object. |

### ImportAgent(ImportAgentRequest, CallOptions)

    public virtual Operation ImportAgent(ImportAgentRequest request, CallOptions options)

Imports the specified agent from a ZIP file.

Uploads new intents and entity types without deleting the existing ones.
Intents and entity types with the same name are replaced with the new
versions from
\[ImportAgentRequest\]\[google.cloud.dialogflow.v2.ImportAgentRequest\]. After
the import, the imported draft agent will be trained automatically (unless
disabled in agent settings). However, once the import is done, training may
not be completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when importing is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### ImportAgent(ImportAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation ImportAgent(ImportAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Imports the specified agent from a ZIP file.

Uploads new intents and entity types without deleting the existing ones.
Intents and entity types with the same name are replaced with the new
versions from
\[ImportAgentRequest\]\[google.cloud.dialogflow.v2.ImportAgentRequest\]. After
the import, the imported draft agent will be trained automatically (unless
disabled in agent settings). However, once the import is done, training may
not be completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when importing is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ImportAgentRequest` 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** |
| `Operation` | The response received from the server. |

### ImportAgentAsync(ImportAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> ImportAgentAsync(ImportAgentRequest request, CallOptions options)

Imports the specified agent from a ZIP file.

Uploads new intents and entity types without deleting the existing ones.
Intents and entity types with the same name are replaced with the new
versions from
\[ImportAgentRequest\]\[google.cloud.dialogflow.v2.ImportAgentRequest\]. After
the import, the imported draft agent will be trained automatically (unless
disabled in agent settings). However, once the import is done, training may
not be completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when importing is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### ImportAgentAsync(ImportAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> ImportAgentAsync(ImportAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Imports the specified agent from a ZIP file.

Uploads new intents and entity types without deleting the existing ones.
Intents and entity types with the same name are replaced with the new
versions from
\[ImportAgentRequest\]\[google.cloud.dialogflow.v2.ImportAgentRequest\]. After
the import, the imported draft agent will be trained automatically (unless
disabled in agent settings). However, once the import is done, training may
not be completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when importing is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ImportAgentRequest` 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** |
| `AsyncUnaryCallOperation` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override Agents.AgentsClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

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

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AgentsAgentsClient` |   |

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

### RestoreAgent(RestoreAgentRequest, CallOptions)

    public virtual Operation RestoreAgent(RestoreAgentRequest request, CallOptions options)

Restores the specified agent from a ZIP file.

Replaces the current agent version with a new one. All the intents and
entity types in the older version are deleted. After the restore, the
restored draft agent will be trained automatically (unless disabled in
agent settings). However, once the restore is done, training may not be
completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when restoring is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### RestoreAgent(RestoreAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation RestoreAgent(RestoreAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Restores the specified agent from a ZIP file.

Replaces the current agent version with a new one. All the intents and
entity types in the older version are deleted. After the restore, the
restored draft agent will be trained automatically (unless disabled in
agent settings). However, once the restore is done, training may not be
completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when restoring is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `RestoreAgentRequest` 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** |
| `Operation` | The response received from the server. |

### RestoreAgentAsync(RestoreAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> RestoreAgentAsync(RestoreAgentRequest request, CallOptions options)

Restores the specified agent from a ZIP file.

Replaces the current agent version with a new one. All the intents and
entity types in the older version are deleted. After the restore, the
restored draft agent will be trained automatically (unless disabled in
agent settings). However, once the restore is done, training may not be
completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when restoring is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### RestoreAgentAsync(RestoreAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> RestoreAgentAsync(RestoreAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Restores the specified agent from a ZIP file.

Replaces the current agent version with a new one. All the intents and
entity types in the older version are deleted. After the restore, the
restored draft agent will be trained automatically (unless disabled in
agent settings). However, once the restore is done, training may not be
completed yet. Please call
\[TrainAgent\]\[google.cloud.dialogflow.v2.Agents.TrainAgent\] and wait for the
operation it returns in order to train explicitly.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

The operation only tracks when restoring is complete, not when it is done
training.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `RestoreAgentRequest` 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** |
| `AsyncUnaryCallOperation` | The call object. |

### SearchAgents(SearchAgentsRequest, CallOptions)

    public virtual SearchAgentsResponse SearchAgents(SearchAgentsRequest request, CallOptions options)

Returns the list of agents.

Since there is at most one conversational agent per project, this method is
useful primarily for listing all agents across projects the caller has
access to. One can achieve that with a wildcard project collection id "-".
Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

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

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

### SearchAgents(SearchAgentsRequest, Metadata, DateTime?, CancellationToken)

    public virtual SearchAgentsResponse SearchAgents(SearchAgentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the list of agents.

Since there is at most one conversational agent per project, this method is
useful primarily for listing all agents across projects the caller has
access to. One can achieve that with a wildcard project collection id "-".
Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SearchAgentsRequest` 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** |
| `SearchAgentsResponse` | The response received from the server. |

### SearchAgentsAsync(SearchAgentsRequest, CallOptions)

    public virtual AsyncUnaryCall<SearchAgentsResponse> SearchAgentsAsync(SearchAgentsRequest request, CallOptions options)

Returns the list of agents.

Since there is at most one conversational agent per project, this method is
useful primarily for listing all agents across projects the caller has
access to. One can achieve that with a wildcard project collection id "-".
Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

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

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

### SearchAgentsAsync(SearchAgentsRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<SearchAgentsResponse> SearchAgentsAsync(SearchAgentsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Returns the list of agents.

Since there is at most one conversational agent per project, this method is
useful primarily for listing all agents across projects the caller has
access to. One can achieve that with a wildcard project collection id "-".
Refer to [List
Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SearchAgentsRequest` 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** |
| `AsyncUnaryCallSearchAgentsResponse` | The call object. |

### SetAgent(SetAgentRequest, CallOptions)

    public virtual Agent SetAgent(SetAgentRequest request, CallOptions options)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### SetAgent(SetAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Agent SetAgent(SetAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SetAgentRequest` 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** |
| `Agent` | The response received from the server. |

### SetAgentAsync(SetAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Agent> SetAgentAsync(SetAgentRequest request, CallOptions options)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### SetAgentAsync(SetAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Agent> SetAgentAsync(SetAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `SetAgentRequest` 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** |
| `AsyncUnaryCallAgent` | The call object. |

### TrainAgent(TrainAgentRequest, CallOptions)

    public virtual Operation TrainAgent(TrainAgentRequest request, CallOptions options)

Trains the specified agent.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### TrainAgent(TrainAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation TrainAgent(TrainAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Trains the specified agent.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `TrainAgentRequest` 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** |
| `Operation` | The response received from the server. |

### TrainAgentAsync(TrainAgentRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> TrainAgentAsync(TrainAgentRequest request, CallOptions options)

Trains the specified agent.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

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

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

### TrainAgentAsync(TrainAgentRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> TrainAgentAsync(TrainAgentRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Trains the specified agent.

This method is a [long-running
operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
The returned `Operation` type has the following method-specific fields:

- `metadata`: An empty [Struct
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
- `response`: An [Empty
  message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

Note: You should always train an agent prior to sending it queries. See the
[training
documentation](https://cloud.google.com/dialogflow/es/docs/training).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `TrainAgentRequest` 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** |
| `AsyncUnaryCallOperation` | The call object. |