Entity.AddClassificationsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddClassificationsAsync(String, RequestContent, RequestContext) |
[Protocol Method] Add classifications to an existing entity represented by a GUID.
|
AddClassificationsAsync(String, IEnumerable<AtlasClassification>, CancellationToken) |
Add classifications to an existing entity represented by a GUID. |
AddClassificationsAsync(String, RequestContent, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Add classifications to an existing entity represented by a GUID.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler AddClassificationsAsync(String, IEnumerable<AtlasClassification>, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Response> AddClassificationsAsync (string guid, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AddClassificationsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.AddClassificationsAsync : string * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AddClassificationsAsync (guid As String, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)
Parameters
- guid
- String
The globally unique identifier of the entity.
- 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
guid
or content
is null.
guid
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 AddClassificationsAsync.
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.AddClassificationsAsync("<guid>", content);
Console.WriteLine(response.Status);
This sample shows how to call AddClassificationsAsync 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.AddClassificationsAsync("<guid>", content);
Console.WriteLine(response.Status);
Applies to
AddClassificationsAsync(String, IEnumerable<AtlasClassification>, CancellationToken)
- Source:
- Entity.cs
Add classifications to an existing entity represented by a GUID.
public virtual System.Threading.Tasks.Task<Azure.Response> AddClassificationsAsync (string guid, System.Collections.Generic.IEnumerable<Azure.Analytics.Purview.DataMap.AtlasClassification> body, System.Threading.CancellationToken cancellationToken = default);
abstract member AddClassificationsAsync : string * seq<Azure.Analytics.Purview.DataMap.AtlasClassification> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.AddClassificationsAsync : string * seq<Azure.Analytics.Purview.DataMap.AtlasClassification> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function AddClassificationsAsync (guid As String, body As IEnumerable(Of AtlasClassification), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)
Parameters
- guid
- String
The globally unique identifier of the entity.
An array of classifications to be added.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
guid
or body
is null.
guid
is an empty string, and was expected to be non-empty.
Examples
This sample shows how to call AddClassificationsAsync.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
Response response = await client.AddClassificationsAsync("<guid>", new AtlasClassification[]
{
new AtlasClassification()
});
This sample shows how to call AddClassificationsAsync 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.AddClassificationsAsync("<guid>", 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>",
}},
}
});
Applies to
Azure SDK for .NET