Share via


Glossary.UpdateTermAsync Method

Definition

Overloads

UpdateTermAsync(String, AtlasGlossaryTerm, Nullable<Boolean>, CancellationToken)

Update the given glossary term by its GUID.

UpdateTermAsync(String, RequestContent, Nullable<Boolean>, RequestContext)

[Protocol Method] Update the given glossary term by its GUID.

UpdateTermAsync(String, AtlasGlossaryTerm, Nullable<Boolean>, CancellationToken)

Source:
Glossary.cs

Update the given glossary term by its GUID.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>> UpdateTermAsync(string termId, Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm body, bool? includeTermHierarchy = default, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateTermAsync : string * Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>>
override this.UpdateTermAsync : string * Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm * Nullable<bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryTerm>>
Public Overridable Function UpdateTermAsync (termId As String, body As AtlasGlossaryTerm, Optional includeTermHierarchy As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasGlossaryTerm))

Parameters

termId
String

The globally unique identifier for glossary term.

body
AtlasGlossaryTerm

Body parameter.

includeTermHierarchy
Nullable<Boolean>

Whether include term hierarchy.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

termId or body is null.

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

Examples

This sample shows how to call UpdateTermAsync.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

AtlasGlossaryTerm body = new AtlasGlossaryTerm
{
    Guid = "54688d39-b298-4104-9e80-f2a16f44aaea",
    Name = "ExampleTerm1",
    QualifiedName = "ExampleTerm1@Glossary",
    ShortDescription = "Example Short Description",
    LastModifiedTS = "1",
    Abbreviation = "T1",
    Anchor = new AtlasGlossaryHeader
    {
        GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        RelationGuid = "7b6a8149-a928-476a-a068-dce58653cfa0",
    },
    Status = TermStatus.Approved,
    Resources = {new ResourceLink
    {
        DisplayName = "Example Display Name",
        Url = "Example Url",
    }},
    SeeAlso = {new AtlasRelatedTermHeader
    {
        TermGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
    }, new AtlasRelatedTermHeader
    {
        TermGuid = "821beef0-ced9-47ba-8f7f-c4f3459f4d18",
    }},
    Synonyms = {new AtlasRelatedTermHeader
    {
        TermGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
    }, new AtlasRelatedTermHeader
    {
        TermGuid = "821beef0-ced9-47ba-8f7f-c4f3459f4d18",
    }},
};
Response<AtlasGlossaryTerm> response = await client.UpdateTermAsync("54688d39-b298-4104-9e80-f2a16f44aaea", body);

Applies to

UpdateTermAsync(String, RequestContent, Nullable<Boolean>, RequestContext)

Source:
Glossary.cs

[Protocol Method] Update the given glossary term by its GUID.

public virtual System.Threading.Tasks.Task<Azure.Response> UpdateTermAsync(string termId, Azure.Core.RequestContent content, bool? includeTermHierarchy = default, Azure.RequestContext context = default);
abstract member UpdateTermAsync : string * Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.UpdateTermAsync : string * Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function UpdateTermAsync (termId As String, content As RequestContent, Optional includeTermHierarchy As Nullable(Of Boolean) = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

termId
String

The globally unique identifier for glossary term.

content
RequestContent

The content to send as the body of the request.

includeTermHierarchy
Nullable<Boolean>

Whether include term hierarchy.

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

termId or content is null.

termId 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 UpdateTermAsync and parse the result.

Uri endpoint = new Uri("<endpoint>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

using RequestContent content = RequestContent.Create(new
{
    guid = "54688d39-b298-4104-9e80-f2a16f44aaea",
    qualifiedName = "ExampleTerm1@Glossary",
    name = "ExampleTerm1",
    shortDescription = "Example Short Description",
    lastModifiedTS = "1",
    abbreviation = "T1",
    status = "Approved",
    anchor = new
    {
        glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        relationGuid = "7b6a8149-a928-476a-a068-dce58653cfa0",
    },
    resources = new object[]
    {
        new
        {
            displayName = "Example Display Name",
            url = "Example Url",
        }
    },
    seeAlso = new object[]
    {
        new
        {
            termGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
        },
        new
        {
            termGuid = "821beef0-ced9-47ba-8f7f-c4f3459f4d18",
        }
    },
    synonyms = new object[]
    {
        new
        {
            termGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
        },
        new
        {
            termGuid = "821beef0-ced9-47ba-8f7f-c4f3459f4d18",
        }
    },
});
Response response = await client.UpdateTermAsync("54688d39-b298-4104-9e80-f2a16f44aaea", content);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

Applies to