Partilhar via


Entity.GetClassificationAsync Method

Definition

Overloads

GetClassificationAsync(String, String, RequestContext)

[Protocol Method] Get classification for a given entity represented by a GUID.

GetClassificationAsync(String, String, CancellationToken)

Get classification for a given entity represented by a GUID.

GetClassificationAsync(String, String, RequestContext)

Source:
Entity.cs

[Protocol Method] Get classification for a given entity represented by a GUID.

public virtual System.Threading.Tasks.Task<Azure.Response> GetClassificationAsync (string guid, string classificationName, Azure.RequestContext context);
abstract member GetClassificationAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetClassificationAsync : string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetClassificationAsync (guid As String, classificationName As String, context As RequestContext) As Task(Of Response)

Parameters

guid
String

The globally unique identifier of the entity.

classificationName
String

The name of the classification.

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

guid or classificationName is null.

guid or classificationName 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 GetClassificationAsync and parse the result.

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

Response response = await client.GetClassificationAsync("<guid>", "<classificationName>", null);

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

This sample shows how to call GetClassificationAsync with all parameters and parse the result.

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

Response response = await client.GetClassificationAsync("<guid>", "<classificationName>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());

Applies to

GetClassificationAsync(String, String, CancellationToken)

Source:
Entity.cs

Get classification for a given entity represented by a GUID.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification>> GetClassificationAsync (string guid, string classificationName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClassificationAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification>>
override this.GetClassificationAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Analytics.Purview.DataMap.AtlasClassification>>
Public Overridable Function GetClassificationAsync (guid As String, classificationName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of AtlasClassification))

Parameters

guid
String

The globally unique identifier of the entity.

classificationName
String

The name of the classification.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

guid or classificationName is null.

guid or classificationName is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetClassificationAsync.

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

Response<AtlasClassification> response = await client.GetClassificationAsync("<guid>", "<classificationName>");

This sample shows how to call GetClassificationAsync with all parameters.

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

Response<AtlasClassification> response = await client.GetClassificationAsync("<guid>", "<classificationName>");

Applies to