Glossary.CreateCategories Method

Definition

Overloads

Name Description
CreateCategories(IEnumerable<AtlasGlossaryCategory>, CancellationToken)

Create glossary category in bulk.

CreateCategories(RequestContent, RequestContext)

[Protocol Method] Create glossary category in bulk.

CreateCategories(IEnumerable<AtlasGlossaryCategory>, CancellationToken)

Source:
Glossary.cs

Create glossary category in bulk.

public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory>> CreateCategories(System.Collections.Generic.IEnumerable<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory> body, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateCategories : seq<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory>>
override this.CreateCategories : seq<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.Analytics.Purview.DataMap.AtlasGlossaryCategory>>
Public Overridable Function CreateCategories (body As IEnumerable(Of AtlasGlossaryCategory), Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of AtlasGlossaryCategory))

Parameters

body
IEnumerable<AtlasGlossaryCategory>

An array of glossary category definitions to be created.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

body is null.

Examples

This sample shows how to call CreateCategories.

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

Response<IReadOnlyList<AtlasGlossaryCategory>> response = client.CreateCategories(new AtlasGlossaryCategory[]
{
    new AtlasGlossaryCategory
    {
        Name = "ExampleCategory2",
        Anchor = new AtlasGlossaryHeader
        {
            GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        },
    },
    new AtlasGlossaryCategory
    {
        Name = "ExampleCategory3",
        Anchor = new AtlasGlossaryHeader
        {
            GlossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        },
    }
});

Applies to

CreateCategories(RequestContent, RequestContext)

Source:
Glossary.cs

[Protocol Method] Create glossary category in bulk.

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

Parameters

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

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call CreateCategories 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 object[]
{
    new
    {
        name = "ExampleCategory2",
        anchor = new
        {
            glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        },
    },
    new
    {
        name = "ExampleCategory3",
        anchor = new
        {
            glossaryGuid = "c018ddaf-7c21-4b37-a838-dae5f110c3d8",
        },
    }
});
Response response = client.CreateCategories(content);

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

Applies to