次の方法で共有


Entity.AddClassificationsByUniqueAttributeAsync Method

Definition

Overloads

AddClassificationsByUniqueAttributeAsync(String, RequestContent, String, RequestContext)

[Protocol Method] Add classification to the entity identified by its type and unique attributes.

AddClassificationsByUniqueAttributeAsync(String, IEnumerable<AtlasClassification>, String, CancellationToken)

Add classification to the entity identified by its type and unique attributes.

AddClassificationsByUniqueAttributeAsync(String, RequestContent, String, RequestContext)

Source:
Entity.cs

[Protocol Method] Add classification to the entity identified by its type and unique attributes.

public virtual System.Threading.Tasks.Task<Azure.Response> AddClassificationsByUniqueAttributeAsync (string typeName, Azure.Core.RequestContent content, string attribute = default, Azure.RequestContext context = default);
abstract member AddClassificationsByUniqueAttributeAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AddClassificationsByUniqueAttributeAsync : string * Azure.Core.RequestContent * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AddClassificationsByUniqueAttributeAsync (typeName As String, content As RequestContent, Optional attribute As String = Nothing, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

typeName
String

The name of the type.

content
RequestContent

The content to send as the body of the request.

attribute
String

The qualified name of the entity. (This is only an example. qualifiedName can be changed to other unique attributes)

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

typeName or content is null.

typeName 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 AddClassificationsByUniqueAttributeAsync.

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

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

Console.WriteLine(response.Status);

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

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

using RequestContent content = RequestContent.Create(new object[]
{
    new
    {
        attributes = new
        {
            key = new object(),
        },
        typeName = "<typeName>",
        lastModifiedTS = "<lastModifiedTS>",
        entityGuid = "<entityGuid>",
        entityStatus = "ACTIVE",
        removePropagationsOnEntityDelete = true,
        validityPeriods = new object[]
        {
            new
            {
                endTime = "<endTime>",
                startTime = "<startTime>",
                timeZone = "<timeZone>",
            }
        },
    }
});
Response response = await client.AddClassificationsByUniqueAttributeAsync("<typeName>", content, attribute: "<attribute>");

Console.WriteLine(response.Status);

Applies to

AddClassificationsByUniqueAttributeAsync(String, IEnumerable<AtlasClassification>, String, CancellationToken)

Source:
Entity.cs

Add classification to the entity identified by its type and unique attributes.

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

Parameters

typeName
String

The name of the type.

body
IEnumerable<AtlasClassification>

An array of classification to be added.

attribute
String

The qualified name of the entity. (This is only an example. qualifiedName can be changed to other unique attributes)

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

typeName or body is null.

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

Examples

This sample shows how to call AddClassificationsByUniqueAttributeAsync.

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

Response response = await client.AddClassificationsByUniqueAttributeAsync("<typeName>", new AtlasClassification[]
{
    new AtlasClassification()
});

This sample shows how to call AddClassificationsByUniqueAttributeAsync with all parameters.

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

Response response = await client.AddClassificationsByUniqueAttributeAsync("<typeName>", new AtlasClassification[]
{
    new AtlasClassification
    {
        Attributes =
        {
            ["key"] = BinaryData.FromObjectAsJson(new object())
        },
        TypeName = "<typeName>",
        LastModifiedTS = "<lastModifiedTS>",
        EntityGuid = "<entityGuid>",
        EntityStatus = EntityStatus.Active,
        RemovePropagationsOnEntityDelete = true,
        ValidityPeriods = {new TimeBoundary
        {
            EndTime = "<endTime>",
            StartTime = "<startTime>",
            TimeZone = "<timeZone>",
        }},
    }
}, attribute: "<attribute>");

Applies to