Share via


SearchIndexClient.CreateOrUpdateKnowledgeAgentAsync Method

Definition

Creates a new agent or updates an agent if it already exists.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeAgent>> CreateOrUpdateKnowledgeAgentAsync(Azure.Search.Documents.Indexes.Models.KnowledgeAgent knowledgeAgent, bool onlyIfUnchanged = false, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateKnowledgeAgentAsync : Azure.Search.Documents.Indexes.Models.KnowledgeAgent * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeAgent>>
override this.CreateOrUpdateKnowledgeAgentAsync : Azure.Search.Documents.Indexes.Models.KnowledgeAgent * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Search.Documents.Indexes.Models.KnowledgeAgent>>
Public Overridable Function CreateOrUpdateKnowledgeAgentAsync (knowledgeAgent As KnowledgeAgent, Optional onlyIfUnchanged As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of KnowledgeAgent))

Parameters

knowledgeAgent
KnowledgeAgent

The definition of the agent to create or update.

onlyIfUnchanged
Boolean

True to throw a RequestFailedException if the ETag does not match the current service version; otherwise, the current service version will be overwritten.

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be canceled.

Returns

Exceptions

knowledgeAgent is null.

Applies to