Entity.AddClassification 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
AddClassification(ClassificationAssociateConfig, CancellationToken) |
Associate a classification to multiple entities in bulk. |
AddClassification(RequestContent, RequestContext) |
[Protocol Method] Associate a classification to multiple entities in bulk.
|
AddClassification(ClassificationAssociateConfig, CancellationToken)
- Source:
- Entity.cs
Associate a classification to multiple entities in bulk.
public virtual Azure.Response AddClassification (Azure.Analytics.Purview.DataMap.ClassificationAssociateConfig classificationAssociateConfig, System.Threading.CancellationToken cancellationToken = default);
abstract member AddClassification : Azure.Analytics.Purview.DataMap.ClassificationAssociateConfig * System.Threading.CancellationToken -> Azure.Response
override this.AddClassification : Azure.Analytics.Purview.DataMap.ClassificationAssociateConfig * System.Threading.CancellationToken -> Azure.Response
Public Overridable Function AddClassification (classificationAssociateConfig As ClassificationAssociateConfig, Optional cancellationToken As CancellationToken = Nothing) As Response
Parameters
- classificationAssociateConfig
- ClassificationAssociateConfig
The request payload for classification association.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
classificationAssociateConfig
is null.
Examples
This sample shows how to call AddClassification.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
ClassificationAssociateConfig classificationAssociateConfig = new ClassificationAssociateConfig();
Response response = client.AddClassification(classificationAssociateConfig);
This sample shows how to call AddClassification with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
ClassificationAssociateConfig classificationAssociateConfig = new ClassificationAssociateConfig
{
Classification = 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>",
}},
},
EntityGuids = { "<entityGuids>" },
};
Response response = client.AddClassification(classificationAssociateConfig);
Applies to
AddClassification(RequestContent, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Associate a classification to multiple entities in bulk.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler AddClassification(ClassificationAssociateConfig, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response AddClassification (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member AddClassification : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.AddClassification : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function AddClassification (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 AddClassification.
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());
Response response = client.AddClassification(content);
Console.WriteLine(response.Status);
This sample shows how to call AddClassification with all 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
{
classification = 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>",
}
},
},
entityGuids = new object[]
{
"<entityGuids>"
},
});
Response response = client.AddClassification(content);
Console.WriteLine(response.Status);
Applies to
Azure SDK for .NET