Entity.BatchSetClassifications 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
BatchSetClassifications(RequestContent, RequestContext) |
[Protocol Method] Set classifications on entities in bulk.
|
BatchSetClassifications(AtlasEntityHeaders, CancellationToken) |
Set classifications on entities in bulk. |
BatchSetClassifications(RequestContent, RequestContext)
- Source:
- Entity.cs
[Protocol Method] Set classifications on entities in bulk.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler BatchSetClassifications(AtlasEntityHeaders, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response BatchSetClassifications (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member BatchSetClassifications : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.BatchSetClassifications : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function BatchSetClassifications (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 BatchSetClassifications and parse the result.
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.BatchSetClassifications(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].ToString());
This sample shows how to call BatchSetClassifications with all request content and parse the result.
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
{
guidHeaderMap = new
{
key = new
{
attributes = new
{
key = new object(),
},
typeName = "<typeName>",
lastModifiedTS = "<lastModifiedTS>",
classificationNames = new object[]
{
"<classificationNames>"
},
classifications = 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>",
}
},
}
},
displayText = "<displayText>",
guid = "<guid>",
isIncomplete = true,
labels = new object[]
{
"<labels>"
},
meaningNames = new object[]
{
"<meaningNames>"
},
meanings = new object[]
{
new
{
confidence = 1234,
createdBy = "<createdBy>",
description = "<description>",
displayText = "<displayText>",
expression = "<expression>",
relationGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
status = "DISCOVERED",
steward = "<steward>",
termGuid = "73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a",
}
},
status = "ACTIVE",
},
},
});
Response response = client.BatchSetClassifications(content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].ToString());
Applies to
BatchSetClassifications(AtlasEntityHeaders, CancellationToken)
- Source:
- Entity.cs
Set classifications on entities in bulk.
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<string>> BatchSetClassifications (Azure.Analytics.Purview.DataMap.AtlasEntityHeaders atlasEntityHeaders, System.Threading.CancellationToken cancellationToken = default);
abstract member BatchSetClassifications : Azure.Analytics.Purview.DataMap.AtlasEntityHeaders * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<string>>
override this.BatchSetClassifications : Azure.Analytics.Purview.DataMap.AtlasEntityHeaders * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<string>>
Public Overridable Function BatchSetClassifications (atlasEntityHeaders As AtlasEntityHeaders, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of String))
Parameters
- atlasEntityHeaders
- AtlasEntityHeaders
An instance of an entity header map.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
atlasEntityHeaders
is null.
Examples
This sample shows how to call BatchSetClassifications.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
AtlasEntityHeaders atlasEntityHeaders = new AtlasEntityHeaders();
Response<IReadOnlyList<string>> response = client.BatchSetClassifications(atlasEntityHeaders);
This sample shows how to call BatchSetClassifications with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Entity client = new DataMapClient(endpoint, credential).GetEntityClient();
AtlasEntityHeaders atlasEntityHeaders = new AtlasEntityHeaders
{
GuidHeaderMap =
{
["key"] = new AtlasEntityHeader
{
Attributes =
{
["key"] = BinaryData.FromObjectAsJson(new object())
},
TypeName = "<typeName>",
LastModifiedTS = "<lastModifiedTS>",
ClassificationNames = {"<classificationNames>"},
Classifications = {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>",
}},
}},
DisplayText = "<displayText>",
Guid = "<guid>",
IsIncomplete = true,
Labels = {"<labels>"},
MeaningNames = {"<meaningNames>"},
Meanings = {new AtlasTermAssignmentHeader
{
Confidence = 1234,
CreatedBy = "<createdBy>",
Description = "<description>",
DisplayText = "<displayText>",
Expression = "<expression>",
RelationGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
Status = AtlasTermAssignmentStatus.Discovered,
Steward = "<steward>",
TermGuid = Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"),
}},
Status = EntityStatus.Active,
}
},
};
Response<IReadOnlyList<string>> response = client.BatchSetClassifications(atlasEntityHeaders);
Applies to
Azure SDK for .NET