Share via


SearchIndexClient.CreateOrUpdateKnowledgeAgent Method

Definition

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

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