Condividi tramite


LargePersonGroupClient.CreatePerson Method

Definition

Overloads

CreatePerson(RequestContent, RequestContext)

[Protocol Method] Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person Group Person Face".

CreatePerson(String, String, CancellationToken)

Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person Group Person Face".

CreatePerson(RequestContent, RequestContext)

Source:
LargePersonGroupClient.cs

[Protocol Method] Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person Group Person Face".

public virtual Azure.Response CreatePerson (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member CreatePerson : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
override this.CreatePerson : Azure.Core.RequestContent * Azure.RequestContext -> Azure.Response
Public Overridable Function CreatePerson (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 CreatePerson and parse the result.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargePersonGroupClient client = new FaceAdministrationClient(endpoint, credential).GetLargePersonGroupClient("your_large_person_group_id");

using RequestContent content = RequestContent.Create(new
{
    name = "your_large_person_group_person_name",
    userData = "your_user_data",
});
Response response = client.CreatePerson(content);

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

Applies to

CreatePerson(String, String, CancellationToken)

Source:
LargePersonGroupClient.cs

Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person Group Person Face".

public virtual Azure.Response<Azure.AI.Vision.Face.CreatePersonResult> CreatePerson (string name, string userData = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreatePerson : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Vision.Face.CreatePersonResult>
override this.CreatePerson : string * string * System.Threading.CancellationToken -> Azure.Response<Azure.AI.Vision.Face.CreatePersonResult>
Public Overridable Function CreatePerson (name As String, Optional userData As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of CreatePersonResult)

Parameters

name
String

User defined name, maximum length is 128.

userData
String

Optional user defined data. Length should not exceed 16K.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

name is null.

Examples

This sample shows how to call CreatePerson.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargePersonGroupClient client = new FaceAdministrationClient(endpoint, credential).GetLargePersonGroupClient("your_large_person_group_id");

Response<CreatePersonResult> response = client.CreatePerson("your_large_person_group_person_name");

Remarks

Please refer to https://zcusa.951200.xyz/rest/api/face/person-group-operations/create-large-person-group-person for more details.

Applies to