QuestionAnsweringAuthoringClient.UpdateSynonyms Method

Definition

Overloads

Name Description
UpdateSynonyms(String, SynonymAssets, CancellationToken)

Updates all the synonyms of a project.

UpdateSynonyms(String, RequestContent, RequestContext)

[Protocol Method] Updates all the synonyms of a project.

UpdateSynonyms(String, SynonymAssets, CancellationToken)

Source:
QuestionAnsweringAuthoringClient.cs

Updates all the synonyms of a project.

public virtual Azure.Response UpdateSynonyms(string projectName, Azure.AI.Language.QuestionAnswering.Authoring.SynonymAssets body, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateSynonyms : string * Azure.AI.Language.QuestionAnswering.Authoring.SynonymAssets * System.Threading.CancellationToken -> Azure.Response
override this.UpdateSynonyms : string * Azure.AI.Language.QuestionAnswering.Authoring.SynonymAssets * System.Threading.CancellationToken -> Azure.Response
Public Overridable Function UpdateSynonyms (projectName As String, body As SynonymAssets, Optional cancellationToken As CancellationToken = Nothing) As Response

Parameters

projectName
String

The name of the project to use.

body
SynonymAssets

All the synonyms of a project.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

projectName or body is null.

projectName is an empty string, and was expected to be non-empty.

Applies to

UpdateSynonyms(String, RequestContent, RequestContext)

Source:
QuestionAnsweringAuthoringClient.cs
Source:
QuestionAnsweringAuthoringClient.cs

[Protocol Method] Updates all the synonyms of a project.

public virtual Azure.Response UpdateSynonyms(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member UpdateSynonyms : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.UpdateSynonyms : string * Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function UpdateSynonyms (projectName As String, content As RequestContent, Optional context As RequestContext = Nothing) As Response

Parameters

projectName
String

The name of the project to use.

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

projectName or content is null.

projectName is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call UpdateSynonyms with required parameters.

var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);

var data = new {};

Response response = client.UpdateSynonyms("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);

This sample shows how to call UpdateSynonyms with all parameters and request content.

var credential = new AzureKeyCredential("<key>");
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new QuestionAnsweringAuthoringClient(endpoint, credential);

var data = new {
    value = new[] {
        new {
            alterations = new[] {
                "<String>"
            },
        }
    },
    nextLink = "<nextLink>",
};

Response response = client.UpdateSynonyms("<projectName>", RequestContent.Create(data));
Console.WriteLine(response.Status);

Remarks

Below is the JSON schema for the request payload. Additional information can be found in the service REST API documentation: https://learn.microsoft.com/rest/api/cognitiveservices/questionanswering/question-answering-projects/update-synonyms

Request Body:

Schema for SynonymAssets:

{
              value: [
                {
                  alterations: [string], # Required. Collection of word alterations.
                }
              ], # Optional. Collection of synonyms.
              nextLink: string, # Optional.
            }

Applies to