Share via


Glossary.UpdateTerm Method

Definition

Overloads

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

Update the given glossary term by its GUID.

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

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

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

Source:
Glossary.cs

Update the given glossary term by its GUID.

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

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 = client.UpdateTerm("54688d39-b298-4104-9e80-f2a16f44aaea", body);

Applies to

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

Source:
Glossary.cs

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

public virtual Azure.Response UpdateTerm(string termId, Azure.Core.RequestContent content, bool? includeTermHierarchy = default, Azure.RequestContext context = default);
abstract member UpdateTerm : string * Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> Azure.Response
override this.UpdateTerm : string * Azure.Core.RequestContent * Nullable<bool> * Azure.RequestContext -> Azure.Response
Public Overridable Function UpdateTerm (termId As String, content As RequestContent, Optional includeTermHierarchy As Nullable(Of Boolean) = Nothing, Optional context As RequestContext = Nothing) As 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 UpdateTerm 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 = client.UpdateTerm("54688d39-b298-4104-9e80-f2a16f44aaea", content);

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

Applies to