Partilhar via


Glossary.AssignTermToEntitiesAsync Method

Definition

Overloads

AssignTermToEntitiesAsync(String, RequestContent, RequestContext)

[Protocol Method] Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

AssignTermToEntitiesAsync(String, IEnumerable<AtlasRelatedObjectId>, CancellationToken)

Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

AssignTermToEntitiesAsync(String, RequestContent, RequestContext)

Source:
Glossary.cs

[Protocol Method] Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

public virtual System.Threading.Tasks.Task<Azure.Response> AssignTermToEntitiesAsync (string termId, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AssignTermToEntitiesAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AssignTermToEntitiesAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AssignTermToEntitiesAsync (termId As String, content As RequestContent, 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.

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 AssignTermToEntitiesAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

using RequestContent content = RequestContent.Create(new object[]
{
    new object()
});
Response response = await client.AssignTermToEntitiesAsync("<termId>", content);

Console.WriteLine(response.Status);

This sample shows how to call AssignTermToEntitiesAsync with all parameters and request content.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

using RequestContent content = RequestContent.Create(new object[]
{
    new
    {
        guid = "<guid>",
        typeName = "<typeName>",
        uniqueAttributes = new
        {
            key = new object(),
        },
        displayText = "<displayText>",
        entityStatus = "ACTIVE",
        relationshipType = "<relationshipType>",
        relationshipAttributes = new
        {
            attributes = new
            {
                key = new object(),
            },
            typeName = "<typeName>",
            lastModifiedTS = "<lastModifiedTS>",
        },
        relationshipGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
        relationshipStatus = "ACTIVE",
    }
});
Response response = await client.AssignTermToEntitiesAsync("<termId>", content);

Console.WriteLine(response.Status);

Applies to

AssignTermToEntitiesAsync(String, IEnumerable<AtlasRelatedObjectId>, CancellationToken)

Source:
Glossary.cs

Assign the given term to the provided list of related objects. Recommend using small batches with multiple API calls.

Entities Create Or Update operation is an alternative to assign a term to multiple entities.

public virtual System.Threading.Tasks.Task<Azure.Response> AssignTermToEntitiesAsync (string termId, System.Collections.Generic.IEnumerable<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> body, System.Threading.CancellationToken cancellationToken = default);
abstract member AssignTermToEntitiesAsync : string * seq<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.AssignTermToEntitiesAsync : string * seq<Azure.Analytics.Purview.DataMap.AtlasRelatedObjectId> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AssignTermToEntitiesAsync (termId As String, body As IEnumerable(Of AtlasRelatedObjectId), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

Parameters

termId
String

The globally unique identifier for glossary term.

body
IEnumerable<AtlasRelatedObjectId>

An array of related object IDs to which the term has to be associated.

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 AssignTermToEntitiesAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

Response response = await client.AssignTermToEntitiesAsync("<termId>", new AtlasRelatedObjectId[]
{
    new AtlasRelatedObjectId()
});

This sample shows how to call AssignTermToEntitiesAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

Response response = await client.AssignTermToEntitiesAsync("<termId>", new AtlasRelatedObjectId[]
{
    new AtlasRelatedObjectId
    {
        Guid = "<guid>",
        TypeName = "<typeName>",
        UniqueAttributes =
        {
            ["key"] = BinaryData.FromObjectAsJson(new object())
        },
        DisplayText = "<displayText>",
        EntityStatus = EntityStatus.Active,
        RelationshipType = "<relationshipType>",
        RelationshipAttributes = new AtlasStruct
        {
            Attributes =
            {
                ["key"] = BinaryData.FromObjectAsJson(new object())
            },
            TypeName = "<typeName>",
            LastModifiedTS = "<lastModifiedTS>",
        },
        RelationshipGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
        RelationshipStatus = StatusAtlasRelationship.Active,
    }
});

Applies to