Partilhar via


Glossary.UpdateCategory Method

Definition

Overloads

UpdateCategory(String, AtlasGlossaryCategory, CancellationToken)

Update the given glossary category by its GUID.

UpdateCategory(String, RequestContent, RequestContext)

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

UpdateCategory(String, AtlasGlossaryCategory, CancellationToken)

Source:
Glossary.cs

Update the given glossary category by its GUID.

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory> UpdateCategory(string categoryId, Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory body, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateCategory : string * Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory>
override this.UpdateCategory : string * Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory>
Public Overridable Function UpdateCategory (categoryId As String, body As AtlasGlossaryCategory, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasGlossaryCategory)

Parameters

categoryId
String

The globally unique identifier of the category.

body
AtlasGlossaryCategory

Body parameter.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

categoryId or body is null.

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

Examples

This sample shows how to call UpdateCategory.

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

AtlasGlossaryCategory body = new AtlasGlossaryCategory
{
    Guid = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
    Name = "ExampleCategory1",
    QualifiedName = "ExampleCategory1@Glossary",
    LastModifiedTS = "1",
    Anchor = new AtlasGlossaryHeader
    {
        GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        RelationGuid = "7bdcef93-a57a-4d1d-95ab-9d3036f394a0",
    },
    ChildrenCategories = {new AtlasRelatedCategoryHeader
    {
        CategoryGuid = "0d6766f6-f4b6-435b-bda2-d3edc358998e",
    }},
    ParentCategory = new AtlasRelatedCategoryHeader
    {
        CategoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
    },
    Terms = {new AtlasRelatedTermHeader
    {
        RelationGuid = "6aebf5ac-0c83-40c0-98bf-958fe9c99007",
        TermGuid = "54688d39-b298-4104-9e80-f2a16f44aaea",
    }},
};
Response<AtlasGlossaryCategory> response = client.UpdateCategory("ed7458f0-9463-48a5-b5c6-4f785fb34e12", body);

Applies to

UpdateCategory(String, RequestContent, RequestContext)

Source:
Glossary.cs

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

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

Parameters

categoryId
String

The globally unique identifier of the category.

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

categoryId or content is null.

categoryId 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 UpdateCategory 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 = "ed7458f0-9463-48a5-b5c6-4f785fb34e12",
    qualifiedName = "ExampleCategory1@Glossary",
    name = "ExampleCategory1",
    lastModifiedTS = "1",
    anchor = new
    {
        glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        relationGuid = "7bdcef93-a57a-4d1d-95ab-9d3036f394a0",
    },
    terms = new object[]
    {
        new
        {
            termGuid = "54688d39-b298-4104-9e80-f2a16f44aaea",
            relationGuid = "6aebf5ac-0c83-40c0-98bf-958fe9c99007",
        }
    },
    childrenCategories = new object[]
    {
        new
        {
            categoryGuid = "0d6766f6-f4b6-435b-bda2-d3edc358998e",
        }
    },
    parentCategory = new
    {
        categoryGuid = "e47c4584-daca-4f9e-9092-194e04692c9a",
    },
});
Response response = client.UpdateCategory("ed7458f0-9463-48a5-b5c6-4f785fb34e12", content);

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

Applies to