Google Cloud Dialogflow v2 API - Class AgentsClientImpl (4.4.0)

public sealed class AgentsClientImpl : AgentsClient

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

Agents client wrapper implementation, for convenient use.

Inheritance

Object > AgentsClient > AgentsClientImpl

Namespace

Google.Cloud.Dialogflow.V2

Assembly

Google.Cloud.Dialogflow.V2.dll

Remarks

Service for managing [Agents][google.cloud.dialogflow.v2.Agent].

Constructors

AgentsClientImpl(Agents.AgentsClient, AgentsSettings, ILogger)

public AgentsClientImpl(Agents.AgentsClient grpcClient, AgentsSettings settings, ILogger logger)

Constructs a client wrapper for the Agents service, with the specified gRPC client and settings.

Parameters
NameDescription
grpcClientAgents.AgentsClient

The underlying gRPC client.

settingsAgentsSettings

The base AgentsSettings used within this client.

loggerILogger

Optional ILogger to use within this client.

Properties

ExportAgentOperationsClient

public override OperationsClient ExportAgentOperationsClient { get; }

The long-running operations client for ExportAgent.

Property Value
TypeDescription
OperationsClient
Overrides

GrpcClient

public override Agents.AgentsClient GrpcClient { get; }

The underlying gRPC Agents client

Property Value
TypeDescription
Agents.AgentsClient
Overrides

ImportAgentOperationsClient

public override OperationsClient ImportAgentOperationsClient { get; }

The long-running operations client for ImportAgent.

Property Value
TypeDescription
OperationsClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient
Overrides

RestoreAgentOperationsClient

public override OperationsClient RestoreAgentOperationsClient { get; }

The long-running operations client for RestoreAgent.

Property Value
TypeDescription
OperationsClient
Overrides

TrainAgentOperationsClient

public override OperationsClient TrainAgentOperationsClient { get; }

The long-running operations client for TrainAgent.

Property Value
TypeDescription
OperationsClient
Overrides

Methods

DeleteAgent(DeleteAgentRequest, CallSettings)

public override void DeleteAgent(DeleteAgentRequest request, CallSettings callSettings = null)

Deletes the specified agent.

Parameters
NameDescription
requestDeleteAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteAgentAsync(DeleteAgentRequest, CallSettings)

public override Task DeleteAgentAsync(DeleteAgentRequest request, CallSettings callSettings = null)

Deletes the specified agent.

Parameters
NameDescription
requestDeleteAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Overrides

ExportAgent(ExportAgentRequest, CallSettings)

public override Operation<ExportAgentResponse, Struct> ExportAgent(ExportAgentRequest request, CallSettings callSettings = null)

Exports the specified agent to a ZIP file.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

  • metadata: An empty Struct message
  • response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
Parameters
NameDescription
requestExportAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ExportAgentResponse, Struct>

The RPC response.

Overrides

ExportAgentAsync(ExportAgentRequest, CallSettings)

public override async Task<Operation<ExportAgentResponse, Struct>> ExportAgentAsync(ExportAgentRequest request, CallSettings callSettings = null)

Exports the specified agent to a ZIP file.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

  • metadata: An empty Struct message
  • response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
Parameters
NameDescription
requestExportAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ExportAgentResponse, Struct>>

A Task containing the RPC response.

Overrides

GetAgent(GetAgentRequest, CallSettings)

public override Agent GetAgent(GetAgentRequest request, CallSettings callSettings = null)

Retrieves the specified agent.

Parameters
NameDescription
requestGetAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Agent

The RPC response.

Overrides

GetAgentAsync(GetAgentRequest, CallSettings)

public override Task<Agent> GetAgentAsync(GetAgentRequest request, CallSettings callSettings = null)

Retrieves the specified agent.

Parameters
NameDescription
requestGetAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Agent>

A Task containing the RPC response.

Overrides

GetValidationResult(GetValidationResultRequest, CallSettings)

public override ValidationResult GetValidationResult(GetValidationResultRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetValidationResultRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ValidationResult

The RPC response.

Overrides

GetValidationResultAsync(GetValidationResultRequest, CallSettings)

public override Task<ValidationResult> GetValidationResultAsync(GetValidationResultRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestGetValidationResultRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ValidationResult>

A Task containing the RPC response.

Overrides

ImportAgent(ImportAgentRequest, CallSettings)

public override Operation<Empty, Struct> ImportAgent(ImportAgentRequest request, CallSettings callSettings = null)

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. The returned Operation type has the following method-specific fields:

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.

Parameters
NameDescription
requestImportAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, Struct>

The RPC response.

Overrides

ImportAgentAsync(ImportAgentRequest, CallSettings)

public override async Task<Operation<Empty, Struct>> ImportAgentAsync(ImportAgentRequest request, CallSettings callSettings = null)

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. The returned Operation type has the following method-specific fields:

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.

Parameters
NameDescription
requestImportAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, Struct>>

A Task containing the RPC response.

Overrides

RestoreAgent(RestoreAgentRequest, CallSettings)

public override Operation<Empty, Struct> RestoreAgent(RestoreAgentRequest request, CallSettings callSettings = null)

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. The returned Operation type has the following method-specific fields:

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.

Parameters
NameDescription
requestRestoreAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, Struct>

The RPC response.

Overrides

RestoreAgentAsync(RestoreAgentRequest, CallSettings)

public override async Task<Operation<Empty, Struct>> RestoreAgentAsync(RestoreAgentRequest request, CallSettings callSettings = null)

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. The returned Operation type has the following method-specific fields:

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.

Parameters
NameDescription
requestRestoreAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, Struct>>

A Task containing the RPC response.

Overrides

SearchAgents(SearchAgentsRequest, CallSettings)

public override PagedEnumerable<SearchAgentsResponse, Agent> SearchAgents(SearchAgentsRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestSearchAgentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<SearchAgentsResponse, Agent>

A pageable sequence of Agent resources.

Overrides

SearchAgentsAsync(SearchAgentsRequest, CallSettings)

public override PagedAsyncEnumerable<SearchAgentsResponse, Agent> SearchAgentsAsync(SearchAgentsRequest request, CallSettings callSettings = null)

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.

Parameters
NameDescription
requestSearchAgentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<SearchAgentsResponse, Agent>

A pageable asynchronous sequence of Agent resources.

Overrides

SetAgent(SetAgentRequest, CallSettings)

public override Agent SetAgent(SetAgentRequest request, CallSettings callSettings = null)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the training documentation.

Parameters
NameDescription
requestSetAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Agent

The RPC response.

Overrides

SetAgentAsync(SetAgentRequest, CallSettings)

public override Task<Agent> SetAgentAsync(SetAgentRequest request, CallSettings callSettings = null)

Creates/updates the specified agent.

Note: You should always train an agent prior to sending it queries. See the training documentation.

Parameters
NameDescription
requestSetAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Agent>

A Task containing the RPC response.

Overrides

TrainAgent(TrainAgentRequest, CallSettings)

public override Operation<Empty, Struct> TrainAgent(TrainAgentRequest request, CallSettings callSettings = null)

Trains the specified agent.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Note: You should always train an agent prior to sending it queries. See the training documentation.

Parameters
NameDescription
requestTrainAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, Struct>

The RPC response.

Overrides

TrainAgentAsync(TrainAgentRequest, CallSettings)

public override async Task<Operation<Empty, Struct>> TrainAgentAsync(TrainAgentRequest request, CallSettings callSettings = null)

Trains the specified agent.

This method is a long-running operation. The returned Operation type has the following method-specific fields:

Note: You should always train an agent prior to sending it queries. See the training documentation.

Parameters
NameDescription
requestTrainAgentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, Struct>>

A Task containing the RPC response.

Overrides