Share via


Glossary.UpdateAsync Method

Definition

Overloads

UpdateAsync(String, AtlasGlossary, Nullable<Boolean>, CancellationToken)

Update the given glossary.

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

[Protocol Method] Update the given glossary.

UpdateAsync(String, AtlasGlossary, Nullable<Boolean>, CancellationToken)

Source:
Glossary.cs

Update the given glossary.

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

Parameters

glossaryId
String

The globally unique identifier for glossary.

body
AtlasGlossary

Body parameter.

ignoreTermsAndCategories
Nullable<Boolean>

Whether ignore terms and categories.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

glossaryId or body is null.

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

Examples

This sample shows how to call UpdateAsync.

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

AtlasGlossary body = new AtlasGlossary
{
    Guid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
    LongDescription = "Example Long Description",
    Name = "Glossary",
    QualifiedName = "Glossary",
    ShortDescription = "Example Short Description",
    LastModifiedTS = "1",
    Categories = {new AtlasRelatedCategoryHeader
    {
        CategoryGuid = "0d6766f6-f4b6-435b-bda2-d3edc358998e",
        DisplayText = "ExampleCategory3",
        ParentCategoryGuid = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
        RelationGuid = "26a486a4-a8e2-483c-8a84-3b88e909f8d2",
    }, new AtlasRelatedCategoryHeader
    {
        CategoryGuid = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
        DisplayText = "ExampleCategory1",
        ParentCategoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
        RelationGuid = "7bdcef93-a57a-4d1d-95ab-9d3036f394a0",
    }, new AtlasRelatedCategoryHeader
    {
        CategoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
        DisplayText = "ExampleCategory2",
        RelationGuid = "94071e56-fd3e-4441-93ff-1834f818482d",
    }},
    Language = "en",
    Terms = {new AtlasRelatedTermHeader
    {
        DisplayText = "ExampleTerm1",
        RelationGuid = "7b6a8149-a928-476a-a068-dce58653cfa0",
        TermGuid = "54688d39-b298-4104-9e80-f2a16f44aaea",
    }, new AtlasRelatedTermHeader
    {
        DisplayText = "ExampleTerm2",
        RelationGuid = "9385640b-e6be-437d-a6b9-62d11c14a189",
        TermGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
    }},
    Usage = "Example Glossary",
};
Response<AtlasGlossary> response = await client.UpdateAsync("c018ddaf-7c21-4b37-a838-dae5f110c3d8", body);

Applies to

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

Source:
Glossary.cs

[Protocol Method] Update the given glossary.

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

Parameters

glossaryId
String

The globally unique identifier for glossary.

content
RequestContent

The content to send as the body of the request.

ignoreTermsAndCategories
Nullable<Boolean>

Whether ignore terms and categories.

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

glossaryId or content is null.

glossaryId 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 UpdateAsync 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 = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
    qualifiedName = "Glossary",
    name = "Glossary",
    shortDescription = "Example Short Description",
    longDescription = "Example Long Description",
    lastModifiedTS = "1",
    language = "en",
    usage = "Example Glossary",
    terms = new object[]
    {
        new
        {
            termGuid = "54688d39-b298-4104-9e80-f2a16f44aaea",
            relationGuid = "7b6a8149-a928-476a-a068-dce58653cfa0",
            displayText = "ExampleTerm1",
        },
        new
        {
            termGuid = "952c7ba4-4c89-42d8-a05a-7d2161be7008",
            relationGuid = "9385640b-e6be-437d-a6b9-62d11c14a189",
            displayText = "ExampleTerm2",
        }
    },
    categories = new object[]
    {
        new
        {
            categoryGuid = "0d6766f6-f4b6-435b-bda2-d3edc358998e",
            parentCategoryGuid = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
            relationGuid = "26a486a4-a8e2-483c-8a84-3b88e909f8d2",
            displayText = "ExampleCategory3",
        },
        new
        {
            categoryGuid = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
            parentCategoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
            relationGuid = "7bdcef93-a57a-4d1d-95ab-9d3036f394a0",
            displayText = "ExampleCategory1",
        },
        new
        {
            categoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
            relationGuid = "94071e56-fd3e-4441-93ff-1834f818482d",
            displayText = "ExampleCategory2",
        }
    },
});
Response response = await client.UpdateAsync("c018ddaf-7c21-4b37-a838-dae5f110c3d8", content);

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

Applies to