diff --git a/sdk/vision/azure-ai-vision-face/CHANGELOG.md b/sdk/vision/azure-ai-vision-face/CHANGELOG.md new file mode 100644 index 0000000000000..0247ae0a4084e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure Face client library for Java. This package contains Microsoft Azure Face client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/vision/azure-ai-vision-face/README.md b/sdk/vision/azure-ai-vision-face/README.md new file mode 100644 index 0000000000000..69ca84142546e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/README.md @@ -0,0 +1,65 @@ +# Azure Face client library for Java + +Azure Face client library for Java. + +This package contains Microsoft Azure Face client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-ai-vision-face;current}) +```xml + + com.azure + azure-ai-vision-face + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.ai.vision.face.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fvision%2Fazure-ai-vision-face%2FREADME.png) diff --git a/sdk/vision/azure-ai-vision-face/assets.json b/sdk/vision/azure-ai-vision-face/assets.json new file mode 100644 index 0000000000000..e000991cef12c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo" : "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath" : "java", + "TagPrefix" : "java/vision/azure-ai-vision-face", + "Tag" : "" +} \ No newline at end of file diff --git a/sdk/vision/azure-ai-vision-face/pom.xml b/sdk/vision/azure-ai-vision-face/pom.xml new file mode 100644 index 0000000000000..6a9c9561abe67 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/pom.xml @@ -0,0 +1,89 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-ai-vision-face + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Face + This package contains Microsoft Azure Face client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + com.azure + azure-core + 1.49.0 + + + com.azure + azure-core-http-netty + 1.15.0 + + + org.junit.jupiter + junit-jupiter-api + 5.9.3 + test + + + org.junit.jupiter + junit-jupiter-engine + 5.9.3 + test + + + com.azure + azure-core-test + 1.25.0 + test + + + com.azure + azure-identity + 1.12.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationAsyncClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationAsyncClient.java new file mode 100644 index 0000000000000..67576f2c7439e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationAsyncClient.java @@ -0,0 +1,7412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceListFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddLargeFaceListFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddLargePersonGroupPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddPersonGroupPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupWithPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreateFaceListRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupWithPersonChangesRequest; +import com.azure.ai.vision.face.implementation.models.UpdateFaceListRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonRequest; +import com.azure.ai.vision.face.models.AddFaceResult; +import com.azure.ai.vision.face.models.CreatePersonResult; +import com.azure.ai.vision.face.models.DynamicPersonGroup; +import com.azure.ai.vision.face.models.FaceCollectionTrainingResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceList; +import com.azure.ai.vision.face.models.FaceListItem; +import com.azure.ai.vision.face.models.FaceOperationResult; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.LargeFaceList; +import com.azure.ai.vision.face.models.LargeFaceListFace; +import com.azure.ai.vision.face.models.LargePersonGroup; +import com.azure.ai.vision.face.models.LargePersonGroupPerson; +import com.azure.ai.vision.face.models.LargePersonGroupPersonFace; +import com.azure.ai.vision.face.models.ListFaceResult; +import com.azure.ai.vision.face.models.ListGroupReferenceResult; +import com.azure.ai.vision.face.models.ListPersonResult; +import com.azure.ai.vision.face.models.PersonDirectoryFace; +import com.azure.ai.vision.face.models.PersonDirectoryPerson; +import com.azure.ai.vision.face.models.PersonGroup; +import com.azure.ai.vision.face.models.PersonGroupPerson; +import com.azure.ai.vision.face.models.PersonGroupPersonFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) +public final class FaceAdministrationAsyncClient { + @Generated + private final FaceAdministrationClientImpl serviceClient; + + /** + * Initializes an instance of FaceAdministrationAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceAdministrationAsyncClient(FaceAdministrationClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createFaceListWithResponseAsync(faceListId, request, requestOptions); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteFaceListWithResponseAsync(faceListId, requestOptions); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     faceListId: String (Required)
+     *     persistedFaces (Optional): [
+     *          (Optional){
+     *             persistedFaceId: String (Required)
+     *             userData: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face list is a list of faces, up to 1,000 faces along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + return this.serviceClient.getFaceListWithResponseAsync(faceListId, requestOptions); + } + + /** + * Update information of a Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateFaceListWithResponseAsync(faceListId, request, requestOptions); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getFaceListsWithResponseAsync(requestOptions); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceListFaceFromUrlWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.addFaceListFaceFromUrlWithResponseAsync(faceListId, request, requestOptions); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceListFaceWithResponse(String faceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addFaceListFaceWithResponseAsync(faceListId, imageContent, requestOptions); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceListFaceWithResponse(String faceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteFaceListFaceWithResponseAsync(faceListId, persistedFaceId, requestOptions); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createLargeFaceListWithResponseAsync(largeFaceListId, request, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteLargeFaceListWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return large face list is a list of faces, up to 1,000,000 faces along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Update information of a Large Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateLargeFaceListWithResponseAsync(largeFaceListId, request, requestOptions); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListsWithResponseAsync(requestOptions); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListTrainingStatusWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListTrainingStatusWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargeFaceList(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainLargeFaceListAsync(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargeFaceListFaceFromUrlWithResponse(String largeFaceListId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.addLargeFaceListFaceFromUrlWithResponseAsync(largeFaceListId, request, + requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargeFaceListFaceWithResponse(String largeFaceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addLargeFaceListFaceWithResponseAsync(largeFaceListId, imageContent, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLargeFaceListFaceWithResponseAsync(largeFaceListId, persistedFaceId, + requestOptions); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListFaceWithResponseAsync(largeFaceListId, persistedFaceId, + requestOptions); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargeFaceListFaceWithResponseAsync(largeFaceListId, persistedFaceId, request, + requestOptions); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFacesWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListFacesWithResponseAsync(largeFaceListId, requestOptions); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createPersonGroupWithResponseAsync(personGroupId, request, requestOptions); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupWithResponseAsync(personGroupId, requestOptions); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     personGroupId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupWithResponseAsync(personGroupId, requestOptions); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupWithResponseAsync(personGroupId, request, requestOptions); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         personGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupsWithResponseAsync(requestOptions); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupTrainingStatusWithResponse(String personGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupTrainingStatusWithResponseAsync(personGroupId, requestOptions); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainPersonGroup(String personGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainPersonGroupAsync(personGroupId, requestOptions); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonGroupPersonWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createPersonGroupPersonWithResponseAsync(personGroupId, request, requestOptions); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupPersonWithResponseAsync(personGroupId, personId, requestOptions); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonWithResponseAsync(personGroupId, personId, requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupPersonWithResponse(String personGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupPersonWithResponseAsync(personGroupId, personId, request, + requestOptions); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonsWithResponse(String personGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonsWithResponseAsync(personGroupId, requestOptions); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addPersonGroupPersonFaceFromUrlWithResponse(String personGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.addPersonGroupPersonFaceFromUrlWithResponseAsync(personGroupId, personId, request, + requestOptions); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.addPersonGroupPersonFaceWithResponseAsync(personGroupId, personId, imageContent, + requestOptions); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupPersonFaceWithResponseAsync(personGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonFaceWithResponseAsync(personGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupPersonFaceWithResponseAsync(personGroupId, personId, persistedFaceId, + request, requestOptions); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createLargePersonGroupWithResponseAsync(largePersonGroupId, request, requestOptions); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupWithResponseAsync(largePersonGroupId, request, requestOptions); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupsWithResponseAsync(requestOptions); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupTrainingStatusWithResponseAsync(largePersonGroupId, + requestOptions); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargePersonGroup(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainLargePersonGroupAsync(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargePersonGroupPersonWithResponse(String largePersonGroupId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.createLargePersonGroupPersonWithResponseAsync(largePersonGroupId, request, + requestOptions); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupPersonWithResponseAsync(largePersonGroupId, personId, + requestOptions); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonWithResponseAsync(largePersonGroupId, personId, + requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupPersonWithResponseAsync(largePersonGroupId, personId, request, + requestOptions); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonsWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonsWithResponseAsync(largePersonGroupId, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargePersonGroupPersonFaceFromUrlWithResponse(String largePersonGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.addLargePersonGroupPersonFaceFromUrlWithResponseAsync(largePersonGroupId, personId, + request, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, + String personId, BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.addLargePersonGroupPersonFaceWithResponseAsync(largePersonGroupId, personId, + imageContent, requestOptions); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupPersonFaceWithResponseAsync(largePersonGroupId, personId, + persistedFaceId, requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, + String personId, String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonFaceWithResponseAsync(largePersonGroupId, personId, + persistedFaceId, requestOptions); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupPersonFaceWithResponseAsync(largePersonGroupId, personId, + persistedFaceId, request, requestOptions); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreatePerson(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginCreatePersonAsync(request, requestOptions); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePerson(String personId, RequestOptions requestOptions) { + return this.serviceClient.beginDeletePersonAsync(personId, requestOptions); + } + + /** + * Retrieve a person's name and userData from Person Directory. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return person resource for person directory along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonWithResponse(String personId, RequestOptions requestOptions) { + return this.serviceClient.getPersonWithResponseAsync(personId, requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonWithResponse(String personId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updatePersonWithResponseAsync(personId, request, requestOptions); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getPersonsWithResponseAsync(requestOptions); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group of person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupReferencesWithResponse(String personId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupReferencesWithResponseAsync(personId, requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceFromUrl(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginAddPersonFaceFromUrlAsync(personId, recognitionModel, request, requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFace(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.beginAddPersonFaceAsync(personId, recognitionModel, imageContent, requestOptions); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonFace(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.beginDeletePersonFaceAsync(personId, recognitionModel, persistedFaceId, + requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person directory person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonFaceWithResponse(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getPersonFaceWithResponseAsync(personId, recognitionModel, persistedFaceId, + requestOptions); + } + + /** + * Update a persisted face's userData field of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonFaceWithResponse(String personId, String recognitionModel, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonFaceWithResponseAsync(personId, recognitionModel, persistedFaceId, + request, requestOptions); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     persistedFaceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list face of person along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonFacesWithResponse(String personId, String recognitionModel, + RequestOptions requestOptions) { + return this.serviceClient.getPersonFacesWithResponseAsync(personId, recognitionModel, requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateDynamicPersonGroupWithPerson(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginCreateDynamicPersonGroupWithPersonAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createDynamicPersonGroupWithResponseAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDynamicPersonGroup(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDynamicPersonGroupAsync(dynamicPersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a container that references Person Directory "Create Person" along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupWithResponseAsync(dynamicPersonGroupId, requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateDynamicPersonGroupWithPersonChanges( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginUpdateDynamicPersonGroupWithPersonChangesAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateDynamicPersonGroupWithResponseAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         dynamicPersonGroupId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupsWithResponseAsync(requestOptions); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupPersonsWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupPersonsWithResponseAsync(dynamicPersonGroupId, requestOptions); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createFaceList(String faceListId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateFaceListRequest requestObj + = new CreateFaceListRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + return createFaceListWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createFaceList(String faceListId, String name) { + // Generated convenience method for createFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateFaceListRequest requestObj = new CreateFaceListRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createFaceListWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteFaceList(String faceListId) { + // Generated convenience method for deleteFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteFaceListWithResponse(faceListId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face list is a list of faces, up to 1,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFaceList(String faceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getFaceListWithResponse(faceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceList.class)); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face list is a list of faces, up to 1,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFaceList(String faceListId) { + // Generated convenience method for getFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceListWithResponse(faceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceList.class)); + } + + /** + * Update information of a Face List, including name and userData. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFaceList(String faceListId, String name, String userData) { + // Generated convenience method for updateFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceListRequest requestObj = new UpdateFaceListRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateFaceListWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update information of a Face List, including name and userData. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateFaceList(String faceListId) { + // Generated convenience method for updateFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceListRequest requestObj = new UpdateFaceListRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateFaceListWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + * + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceLists(Boolean returnRecognitionModel) { + // Generated convenience method for getFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_LIST_ITEM)); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceLists() { + // Generated convenience method for getFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_LIST_ITEM)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addFaceListFaceFromUrl(String faceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceListFaceFromUrlRequest requestObj = new AddFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceListFaceFromUrlWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addFaceListFaceFromUrl(String faceListId, String url) { + // Generated convenience method for addFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceListFaceFromUrlRequest requestObj = new AddFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addFaceListFaceFromUrlWithResponse(faceListId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addFaceListFace(String faceListId, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceListFaceWithResponse(faceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addFaceListFace(String faceListId, BinaryData imageContent) { + // Generated convenience method for addFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceListFaceWithResponse(faceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteFaceListFace(String faceListId, String persistedFaceId) { + // Generated convenience method for deleteFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteFaceListFaceWithResponse(faceListId, persistedFaceId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargeFaceList(String largeFaceListId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargeFaceListRequest requestObj + = new CreateLargeFaceListRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargeFaceListWithResponse(largeFaceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargeFaceList(String largeFaceListId, String name) { + // Generated convenience method for createLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargeFaceListRequest requestObj = new CreateLargeFaceListRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargeFaceListWithResponse(largeFaceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLargeFaceList(String largeFaceListId) { + // Generated convenience method for deleteLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLargeFaceListWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargeFaceList(String largeFaceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceList.class)); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargeFaceList(String largeFaceListId) { + // Generated convenience method for getLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceList.class)); + } + + /** + * Update information of a Large Face List, including name and userData. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargeFaceList(String largeFaceListId, String name, String userData) { + // Generated convenience method for updateLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListRequest requestObj = new UpdateLargeFaceListRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargeFaceListWithResponse(largeFaceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update information of a Large Face List, including name and userData. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargeFaceList(String largeFaceListId) { + // Generated convenience method for updateLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListRequest requestObj = new UpdateLargeFaceListRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargeFaceListWithResponse(largeFaceListId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceLists(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST)); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceLists() { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST)); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargeFaceListTrainingStatus(String largeFaceListId) { + // Generated convenience method for getLargeFaceListTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListTrainingStatusWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceCollectionTrainingResult.class)); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargeFaceList(String largeFaceListId) { + // Generated convenience method for beginTrainLargeFaceListWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainLargeFaceListWithModelAsync(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargeFaceListFaceFromUrl(String largeFaceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargeFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargeFaceListFaceFromUrlRequest requestObj = new AddLargeFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargeFaceListFaceFromUrlWithResponse(largeFaceListId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargeFaceListFaceFromUrl(String largeFaceListId, String url) { + // Generated convenience method for addLargeFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargeFaceListFaceFromUrlRequest requestObj = new AddLargeFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addLargeFaceListFaceFromUrlWithResponse(largeFaceListId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargeFaceListFace(String largeFaceListId, BinaryData imageContent, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargeFaceListFaceWithResponse(largeFaceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargeFaceListFace(String largeFaceListId, BinaryData imageContent) { + // Generated convenience method for addLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addLargeFaceListFaceWithResponse(largeFaceListId, imageContent, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for deleteLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large face list on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for getLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargeFaceListFace.class)); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargeFaceListFace(String largeFaceListId, String persistedFaceId, String userData) { + // Generated convenience method for updateLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListFaceRequest requestObj = new UpdateLargeFaceListFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for updateLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListFaceRequest requestObj = new UpdateLargeFaceListFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFaces(String largeFaceListId, String start, Integer top) { + // Generated convenience method for getLargeFaceListFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLargeFaceListFacesWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE)); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFaces(String largeFaceListId) { + // Generated convenience method for getLargeFaceListFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListFacesWithResponse(largeFaceListId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE)); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPersonGroup(String personGroupId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupRequest requestObj + = new CreatePersonGroupRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPersonGroup(String personGroupId, String name) { + // Generated convenience method for createPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupRequest requestObj = new CreatePersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deletePersonGroup(String personGroupId) { + // Generated convenience method for deletePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deletePersonGroupWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + * + * @param personGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonGroup(String personGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getPersonGroupWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonGroup.class)); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonGroup(String personGroupId) { + // Generated convenience method for getPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonGroup.class)); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroup(String personGroupId, String name, String userData) { + // Generated convenience method for updatePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupRequest requestObj = new UpdatePersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroup(String personGroupId) { + // Generated convenience method for updatePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupRequest requestObj = new UpdatePersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroups(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getPersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_GROUP)); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroups() { + // Generated convenience method for getPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_GROUP)); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonGroupTrainingStatus(String personGroupId) { + // Generated convenience method for getPersonGroupTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupTrainingStatusWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceCollectionTrainingResult.class)); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainPersonGroup(String personGroupId) { + // Generated convenience method for beginTrainPersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainPersonGroupWithModelAsync(personGroupId, requestOptions); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPersonGroupPerson(String personGroupId, String name, String userData) { + // Generated convenience method for createPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupPersonRequest requestObj = new CreatePersonGroupPersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupPersonWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createPersonGroupPerson(String personGroupId, String name) { + // Generated convenience method for createPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupPersonRequest requestObj = new CreatePersonGroupPersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupPersonWithResponse(personGroupId, request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deletePersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for deletePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deletePersonGroupPersonWithResponse(personGroupId, personId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified person group on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for getPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonWithResponse(personGroupId, personId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonGroupPerson.class)); + } + + /** + * Update name or userData of a person. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroupPerson(String personGroupId, String personId, String name, String userData) { + // Generated convenience method for updatePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonRequest requestObj + = new UpdatePersonGroupPersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupPersonWithResponse(personGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Update name or userData of a person. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for updatePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonRequest requestObj = new UpdatePersonGroupPersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupPersonWithResponse(personGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersons(String personGroupId, String start, Integer top) { + // Generated convenience method for getPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonGroupPersonsWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON)); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersons(String personGroupId) { + // Generated convenience method for getPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonsWithResponse(personGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addPersonGroupPersonFaceFromUrl(String personGroupId, String personId, String url, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addPersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddPersonGroupPersonFaceFromUrlRequest requestObj = new AddPersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addPersonGroupPersonFaceFromUrlWithResponse(personGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addPersonGroupPersonFaceFromUrl(String personGroupId, String personId, String url) { + // Generated convenience method for addPersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddPersonGroupPersonFaceFromUrlRequest requestObj = new AddPersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addPersonGroupPersonFaceFromUrlWithResponse(personGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addPersonGroupPersonFace(String personGroupId, String personId, BinaryData imageContent, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addPersonGroupPersonFaceWithResponse(personGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addPersonGroupPersonFace(String personGroupId, String personId, + BinaryData imageContent) { + // Generated convenience method for addPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addPersonGroupPersonFaceWithResponse(personGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deletePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId) { + // Generated convenience method for deletePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deletePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for person group person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonGroupPersonFace(String personGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for getPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonGroupPersonFace.class)); + } + + /** + * Update a person persisted face's userData field. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId, + String userData) { + // Generated convenience method for updatePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonFaceRequest requestObj = new UpdatePersonGroupPersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update a person persisted face's userData field. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId) { + // Generated convenience method for updatePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonFaceRequest requestObj = new UpdatePersonGroupPersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargePersonGroup(String largePersonGroupId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupRequest requestObj + = new CreateLargePersonGroupRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargePersonGroup(String largePersonGroupId, String name) { + // Generated convenience method for createLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupRequest requestObj = new CreateLargePersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for deleteLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLargePersonGroupWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + * + * @param largePersonGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargePersonGroup(String largePersonGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroup.class)); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroup.class)); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroup(String largePersonGroupId, String name, String userData) { + // Generated convenience method for updateLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupRequest requestObj + = new UpdateLargePersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for updateLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupRequest requestObj = new UpdateLargePersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroups(String start, Integer top, + Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP)); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroups() { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP)); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargePersonGroupTrainingStatus(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupTrainingStatusWithResponse(largePersonGroupId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceCollectionTrainingResult.class)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for beginTrainLargePersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainLargePersonGroupWithModelAsync(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargePersonGroupPerson(String largePersonGroupId, String name, + String userData) { + // Generated convenience method for createLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupPersonRequest requestObj + = new CreateLargePersonGroupPersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupPersonWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createLargePersonGroupPerson(String largePersonGroupId, String name) { + // Generated convenience method for createLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupPersonRequest requestObj = new CreateLargePersonGroupPersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupPersonWithResponse(largePersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreatePersonResult.class)); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for deleteLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLargePersonGroupPersonWithResponse(largePersonGroupId, personId, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified large person group on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for getLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonWithResponse(largePersonGroupId, personId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroupPerson.class)); + } + + /** + * Update name or userData of a person. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroupPerson(String largePersonGroupId, String personId, String name, + String userData) { + // Generated convenience method for updateLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonRequest requestObj + = new UpdateLargePersonGroupPersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupPersonWithResponse(largePersonGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Update name or userData of a person. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for updateLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonRequest requestObj = new UpdateLargePersonGroupPersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupPersonWithResponse(largePersonGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largePersonGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersons(String largePersonGroupId, String start, + Integer top) { + // Generated convenience method for getLargePersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLargePersonGroupPersonsWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON)); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersons(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonsWithResponse(largePersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargePersonGroupPersonFaceFromUrl(String largePersonGroupId, String personId, + String url, List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargePersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargePersonGroupPersonFaceFromUrlRequest requestObj = new AddLargePersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargePersonGroupPersonFaceFromUrlWithResponse(largePersonGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargePersonGroupPersonFaceFromUrl(String largePersonGroupId, String personId, + String url) { + // Generated convenience method for addLargePersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargePersonGroupPersonFaceFromUrlRequest requestObj = new AddLargePersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addLargePersonGroupPersonFaceFromUrlWithResponse(largePersonGroupId, personId, request, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargePersonGroupPersonFace(String largePersonGroupId, String personId, + BinaryData imageContent, List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono addLargePersonGroupPersonFace(String largePersonGroupId, String personId, + BinaryData imageContent) { + // Generated convenience method for addLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLargePersonGroupPersonFace(String largePersonGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for deleteLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large person group person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLargePersonGroupPersonFace(String largePersonGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for getLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LargePersonGroupPersonFace.class)); + } + + /** + * Update a person persisted face's userData field. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroupPersonFace(String largePersonGroupId, String personId, + String persistedFaceId, String userData) { + // Generated convenience method for updateLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonFaceRequest requestObj + = new UpdateLargePersonGroupPersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update a person persisted face's userData field. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateLargePersonGroupPersonFace(String largePersonGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for updateLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonFaceRequest requestObj = new UpdateLargePersonGroupPersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + * + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreatePerson(String name, String userData) { + // Generated convenience method for beginCreatePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest requestObj = new CreatePersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreatePersonWithModelAsync(request, requestOptions); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + * + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreatePerson(String name) { + // Generated convenience method for beginCreatePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest requestObj = new CreatePersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreatePersonWithModelAsync(request, requestOptions); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePerson(String personId) { + // Generated convenience method for beginDeletePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeletePersonWithModelAsync(personId, requestOptions); + } + + /** + * Retrieve a person's name and userData from Person Directory. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return person resource for person directory on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPerson(String personId) { + // Generated convenience method for getPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonWithResponse(personId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonDirectoryPerson.class)); + } + + /** + * Update name or userData of a person. + * + * @param personId Person ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePerson(String personId, String name, String userData) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest requestObj = new UpdatePersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonWithResponse(personId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update name or userData of a person. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePerson(String personId) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest requestObj = new UpdatePersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonWithResponse(personId, request, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersons(String start, Integer top) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON)); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersons() { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON)); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personId Person ID of the person. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group of person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDynamicPersonGroupReferences(String personId, String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupReferencesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupReferencesWithResponse(personId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ListGroupReferenceResult.class)); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group of person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDynamicPersonGroupReferences(String personId) { + // Generated convenience method for getDynamicPersonGroupReferencesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupReferencesWithResponse(personId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ListGroupReferenceResult.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceFromUrl(String personId, + FaceRecognitionModel recognitionModel, String url, List targetFace, FaceDetectionModel detectionModel, + String userData) { + // Generated convenience method for beginAddPersonFaceFromUrlWithModel + RequestOptions requestOptions = new RequestOptions(); + AddPersonFaceFromUrlRequest requestObj = new AddPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return serviceClient.beginAddPersonFaceFromUrlWithModelAsync(personId, recognitionModel.toString(), request, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceFromUrl(String personId, + FaceRecognitionModel recognitionModel, String url) { + // Generated convenience method for beginAddPersonFaceFromUrlWithModel + RequestOptions requestOptions = new RequestOptions(); + AddPersonFaceFromUrlRequest requestObj = new AddPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginAddPersonFaceFromUrlWithModelAsync(personId, recognitionModel.toString(), request, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFace(String personId, + FaceRecognitionModel recognitionModel, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for beginAddPersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return serviceClient.beginAddPersonFaceWithModelAsync(personId, recognitionModel.toString(), imageContent, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFace(String personId, + FaceRecognitionModel recognitionModel, BinaryData imageContent) { + // Generated convenience method for beginAddPersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginAddPersonFaceWithModelAsync(personId, recognitionModel.toString(), imageContent, + requestOptions); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonFace(String personId, + FaceRecognitionModel recognitionModel, String persistedFaceId) { + // Generated convenience method for beginDeletePersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeletePersonFaceWithModelAsync(personId, recognitionModel.toString(), persistedFaceId, + requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for person directory person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonFace(String personId, FaceRecognitionModel recognitionModel, + String persistedFaceId) { + // Generated convenience method for getPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PersonDirectoryFace.class)); + } + + /** + * Update a persisted face's userData field of a person. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonFace(String personId, FaceRecognitionModel recognitionModel, String persistedFaceId, + String userData) { + // Generated convenience method for updatePersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonFaceRequest requestObj = new UpdatePersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Update a persisted face's userData field of a person. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updatePersonFace(String personId, FaceRecognitionModel recognitionModel, String persistedFaceId) { + // Generated convenience method for updatePersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonFaceRequest requestObj = new UpdatePersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updatePersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, request, + requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list face of person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getPersonFaces(String personId, FaceRecognitionModel recognitionModel) { + // Generated convenience method for getPersonFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonFacesWithResponse(personId, recognitionModel.toString(), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ListFaceResult.class)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateDynamicPersonGroupWithPerson( + String dynamicPersonGroupId, String name, List addPersonIds, String userData) { + // Generated convenience method for beginCreateDynamicPersonGroupWithPersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupWithPersonRequest requestObj + = new CreateDynamicPersonGroupWithPersonRequest(name, addPersonIds).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreateDynamicPersonGroupWithPersonWithModelAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginCreateDynamicPersonGroupWithPerson(String dynamicPersonGroupId, String name, List addPersonIds) { + // Generated convenience method for beginCreateDynamicPersonGroupWithPersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupWithPersonRequest requestObj + = new CreateDynamicPersonGroupWithPersonRequest(name, addPersonIds); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreateDynamicPersonGroupWithPersonWithModelAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createDynamicPersonGroup(String dynamicPersonGroupId, String name, String userData) { + // Generated convenience method for createDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupRequest requestObj = new CreateDynamicPersonGroupRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return createDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createDynamicPersonGroup(String dynamicPersonGroupId, String name) { + // Generated convenience method for createDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupRequest requestObj = new CreateDynamicPersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for beginDeleteDynamicPersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDynamicPersonGroupWithModelAsync(dynamicPersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container that references Person Directory "Create Person" on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for getDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupWithResponse(dynamicPersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DynamicPersonGroup.class)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @param removePersonIds Array of personIds created by Person Directory "Create Person" to be removed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateDynamicPersonGroupWithPersonChanges( + String dynamicPersonGroupId, String name, String userData, List addPersonIds, + List removePersonIds) { + // Generated convenience method for beginUpdateDynamicPersonGroupWithPersonChangesWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupWithPersonChangesRequest requestObj + = new UpdateDynamicPersonGroupWithPersonChangesRequest().setName(name) + .setUserData(userData) + .setAddPersonIds(addPersonIds) + .setRemovePersonIds(removePersonIds); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModelAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginUpdateDynamicPersonGroupWithPersonChanges(String dynamicPersonGroupId) { + // Generated convenience method for beginUpdateDynamicPersonGroupWithPersonChangesWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupWithPersonChangesRequest requestObj + = new UpdateDynamicPersonGroupWithPersonChangesRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModelAsync(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateDynamicPersonGroup(String dynamicPersonGroupId, String name, String userData) { + // Generated convenience method for updateDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupRequest requestObj + = new UpdateDynamicPersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return updateDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for updateDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupRequest requestObj = new UpdateDynamicPersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return updateDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroups(String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP)); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroups() { + // Generated convenience method for getDynamicPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP)); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDynamicPersonGroupPersons(String dynamicPersonGroupId, String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupPersonsWithResponse(dynamicPersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ListPersonResult.class)); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group person on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDynamicPersonGroupPersons(String dynamicPersonGroupId) { + // Generated convenience method for getDynamicPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupPersonsWithResponse(dynamicPersonGroupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ListPersonResult.class)); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_LIST_ITEM + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClient.java new file mode 100644 index 0000000000000..aec242515717c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClient.java @@ -0,0 +1,7286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceListFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddLargeFaceListFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddLargePersonGroupPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.AddPersonGroupPersonFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupWithPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreateFaceListRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.CreatePersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupWithPersonChangesRequest; +import com.azure.ai.vision.face.implementation.models.UpdateFaceListRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.UpdatePersonRequest; +import com.azure.ai.vision.face.models.AddFaceResult; +import com.azure.ai.vision.face.models.CreatePersonResult; +import com.azure.ai.vision.face.models.DynamicPersonGroup; +import com.azure.ai.vision.face.models.FaceCollectionTrainingResult; +import com.azure.ai.vision.face.models.FaceDetectionModel; +import com.azure.ai.vision.face.models.FaceList; +import com.azure.ai.vision.face.models.FaceListItem; +import com.azure.ai.vision.face.models.FaceOperationResult; +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.ai.vision.face.models.LargeFaceList; +import com.azure.ai.vision.face.models.LargeFaceListFace; +import com.azure.ai.vision.face.models.LargePersonGroup; +import com.azure.ai.vision.face.models.LargePersonGroupPerson; +import com.azure.ai.vision.face.models.LargePersonGroupPersonFace; +import com.azure.ai.vision.face.models.ListFaceResult; +import com.azure.ai.vision.face.models.ListGroupReferenceResult; +import com.azure.ai.vision.face.models.ListPersonResult; +import com.azure.ai.vision.face.models.PersonDirectoryFace; +import com.azure.ai.vision.face.models.PersonDirectoryPerson; +import com.azure.ai.vision.face.models.PersonGroup; +import com.azure.ai.vision.face.models.PersonGroupPerson; +import com.azure.ai.vision.face.models.PersonGroupPersonFace; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.CollectionFormat; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; + +/** + * Initializes a new instance of the synchronous FaceAdministrationClient type. + */ +@ServiceClient(builder = FaceAdministrationClientBuilder.class) +public final class FaceAdministrationClient { + @Generated + private final FaceAdministrationClientImpl serviceClient; + + /** + * Initializes an instance of FaceAdministrationClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceAdministrationClient(FaceAdministrationClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createFaceListWithResponse(faceListId, request, requestOptions); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteFaceListWithResponse(faceListId, requestOptions); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     faceListId: String (Required)
+     *     persistedFaces (Optional): [
+     *          (Optional){
+     *             persistedFaceId: String (Required)
+     *             userData: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face list is a list of faces, up to 1,000 faces along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + return this.serviceClient.getFaceListWithResponse(faceListId, requestOptions); + } + + /** + * Update information of a Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateFaceListWithResponse(faceListId, request, requestOptions); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getFaceListsWithResponse(requestOptions); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceListFaceFromUrlWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.addFaceListFaceFromUrlWithResponse(faceListId, request, requestOptions); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceListFaceWithResponse(String faceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addFaceListFaceWithResponse(faceListId, imageContent, requestOptions); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceListFaceWithResponse(String faceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteFaceListFaceWithResponse(faceListId, persistedFaceId, requestOptions); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createLargeFaceListWithResponse(largeFaceListId, request, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.deleteLargeFaceListWithResponse(largeFaceListId, requestOptions); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return large face list is a list of faces, up to 1,000,000 faces along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListWithResponse(largeFaceListId, requestOptions); + } + + /** + * Update information of a Large Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateLargeFaceListWithResponse(largeFaceListId, request, requestOptions); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListsWithResponse(requestOptions); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListTrainingStatusWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListTrainingStatusWithResponse(largeFaceListId, requestOptions); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargeFaceList(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainLargeFaceList(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargeFaceListFaceFromUrlWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.addLargeFaceListFaceFromUrlWithResponse(largeFaceListId, request, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargeFaceListFaceWithResponse(String largeFaceListId, BinaryData imageContent, + RequestOptions requestOptions) { + return this.serviceClient.addLargeFaceListFaceWithResponse(largeFaceListId, imageContent, requestOptions); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, request, + requestOptions); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListFacesWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + return this.serviceClient.getLargeFaceListFacesWithResponse(largeFaceListId, requestOptions); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createPersonGroupWithResponse(personGroupId, request, requestOptions); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupWithResponse(personGroupId, requestOptions); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     personGroupId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupWithResponse(personGroupId, requestOptions); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupWithResponse(personGroupId, request, requestOptions); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         personGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupsWithResponse(requestOptions); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupTrainingStatusWithResponse(String personGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupTrainingStatusWithResponse(personGroupId, requestOptions); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainPersonGroup(String personGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainPersonGroup(personGroupId, requestOptions); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonGroupPersonWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createPersonGroupPersonWithResponse(personGroupId, request, requestOptions); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupPersonWithResponse(personGroupId, personId, requestOptions); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified person group along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonWithResponse(personGroupId, personId, requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupPersonWithResponse(String personGroupId, String personId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupPersonWithResponse(personGroupId, personId, request, requestOptions); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonsWithResponse(String personGroupId, RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonsWithResponse(personGroupId, requestOptions); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addPersonGroupPersonFaceFromUrlWithResponse(String personGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.addPersonGroupPersonFaceFromUrlWithResponse(personGroupId, personId, request, + requestOptions); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.addPersonGroupPersonFaceWithResponse(personGroupId, personId, imageContent, + requestOptions); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.deletePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person group person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getPersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, + requestOptions); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, + request, requestOptions); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupsWithResponse(requestOptions); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupTrainingStatusWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargePersonGroup(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginTrainLargePersonGroup(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargePersonGroupPersonWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createLargePersonGroupPersonWithResponse(largePersonGroupId, request, requestOptions); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupPersonWithResponse(largePersonGroupId, personId, + requestOptions); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonWithResponse(largePersonGroupId, personId, requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupPersonWithResponse(largePersonGroupId, personId, request, + requestOptions); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonsWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonsWithResponse(largePersonGroupId, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargePersonGroupPersonFaceFromUrlWithResponse(String largePersonGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.addLargePersonGroupPersonFaceFromUrlWithResponse(largePersonGroupId, personId, + request, requestOptions); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.addLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, imageContent, + requestOptions); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.deleteLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, + persistedFaceId, requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, + persistedFaceId, requestOptions); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updateLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, + persistedFaceId, request, requestOptions); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreatePerson(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginCreatePerson(request, requestOptions); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePerson(String personId, RequestOptions requestOptions) { + return this.serviceClient.beginDeletePerson(personId, requestOptions); + } + + /** + * Retrieve a person's name and userData from Person Directory. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return person resource for person directory along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonWithResponse(String personId, RequestOptions requestOptions) { + return this.serviceClient.getPersonWithResponse(personId, requestOptions); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonWithResponse(String personId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonWithResponse(personId, request, requestOptions); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getPersonsWithResponse(requestOptions); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group of person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupReferencesWithResponse(String personId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupReferencesWithResponse(personId, requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceFromUrl(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginAddPersonFaceFromUrl(personId, recognitionModel, request, requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFace(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.beginAddPersonFace(personId, recognitionModel, imageContent, requestOptions); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePersonFace(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.beginDeletePersonFace(personId, recognitionModel, persistedFaceId, requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person directory person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonFaceWithResponse(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return this.serviceClient.getPersonFaceWithResponse(personId, recognitionModel, persistedFaceId, + requestOptions); + } + + /** + * Update a persisted face's userData field of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonFaceWithResponse(String personId, String recognitionModel, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.updatePersonFaceWithResponse(personId, recognitionModel, persistedFaceId, request, + requestOptions); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     persistedFaceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list face of person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonFacesWithResponse(String personId, String recognitionModel, + RequestOptions requestOptions) { + return this.serviceClient.getPersonFacesWithResponse(personId, recognitionModel, requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateDynamicPersonGroupWithPerson(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginCreateDynamicPersonGroupWithPerson(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.createDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDynamicPersonGroup(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.beginDeleteDynamicPersonGroup(dynamicPersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a container that references Person Directory "Create Person" along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupWithResponse(dynamicPersonGroupId, requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateDynamicPersonGroupWithPersonChanges( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.beginUpdateDynamicPersonGroupWithPersonChanges(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.updateDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         dynamicPersonGroupId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupsWithResponse(requestOptions); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group person along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupPersonsWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return this.serviceClient.getDynamicPersonGroupPersonsWithResponse(dynamicPersonGroupId, requestOptions); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createFaceList(String faceListId, String name, String userData, FaceRecognitionModel recognitionModel) { + // Generated convenience method for createFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateFaceListRequest requestObj + = new CreateFaceListRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + createFaceListWithResponse(faceListId, request, requestOptions).getValue(); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createFaceList(String faceListId, String name) { + // Generated convenience method for createFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateFaceListRequest requestObj = new CreateFaceListRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + createFaceListWithResponse(faceListId, request, requestOptions).getValue(); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteFaceList(String faceListId) { + // Generated convenience method for deleteFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteFaceListWithResponse(faceListId, requestOptions).getValue(); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face list is a list of faces, up to 1,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceList getFaceList(String faceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getFaceListWithResponse(faceListId, requestOptions).getValue().toObject(FaceList.class); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face list is a list of faces, up to 1,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceList getFaceList(String faceListId) { + // Generated convenience method for getFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceListWithResponse(faceListId, requestOptions).getValue().toObject(FaceList.class); + } + + /** + * Update information of a Face List, including name and userData. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFaceList(String faceListId, String name, String userData) { + // Generated convenience method for updateFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceListRequest requestObj = new UpdateFaceListRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateFaceListWithResponse(faceListId, request, requestOptions).getValue(); + } + + /** + * Update information of a Face List, including name and userData. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateFaceList(String faceListId) { + // Generated convenience method for updateFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateFaceListRequest requestObj = new UpdateFaceListRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateFaceListWithResponse(faceListId, request, requestOptions).getValue(); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + * + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getFaceLists(Boolean returnRecognitionModel) { + // Generated convenience method for getFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_FACE_LIST_ITEM); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getFaceLists() { + // Generated convenience method for getFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_FACE_LIST_ITEM); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addFaceListFaceFromUrl(String faceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceListFaceFromUrlRequest requestObj = new AddFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceListFaceFromUrlWithResponse(faceListId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addFaceListFaceFromUrl(String faceListId, String url) { + // Generated convenience method for addFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddFaceListFaceFromUrlRequest requestObj = new AddFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addFaceListFaceFromUrlWithResponse(faceListId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addFaceListFace(String faceListId, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addFaceListFaceWithResponse(faceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addFaceListFace(String faceListId, BinaryData imageContent) { + // Generated convenience method for addFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addFaceListFaceWithResponse(faceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteFaceListFace(String faceListId, String persistedFaceId) { + // Generated convenience method for deleteFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteFaceListFaceWithResponse(faceListId, persistedFaceId, requestOptions).getValue(); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createLargeFaceList(String largeFaceListId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargeFaceListRequest requestObj + = new CreateLargeFaceListRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + createLargeFaceListWithResponse(largeFaceListId, request, requestOptions).getValue(); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createLargeFaceList(String largeFaceListId, String name) { + // Generated convenience method for createLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargeFaceListRequest requestObj = new CreateLargeFaceListRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + createLargeFaceListWithResponse(largeFaceListId, request, requestOptions).getValue(); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLargeFaceList(String largeFaceListId) { + // Generated convenience method for deleteLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLargeFaceListWithResponse(largeFaceListId, requestOptions).getValue(); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceList getLargeFaceList(String largeFaceListId, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListWithResponse(largeFaceListId, requestOptions).getValue().toObject(LargeFaceList.class); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return large face list is a list of faces, up to 1,000,000 faces. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceList getLargeFaceList(String largeFaceListId) { + // Generated convenience method for getLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListWithResponse(largeFaceListId, requestOptions).getValue().toObject(LargeFaceList.class); + } + + /** + * Update information of a Large Face List, including name and userData. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargeFaceList(String largeFaceListId, String name, String userData) { + // Generated convenience method for updateLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListRequest requestObj = new UpdateLargeFaceListRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargeFaceListWithResponse(largeFaceListId, request, requestOptions).getValue(); + } + + /** + * Update information of a Large Face List, including name and userData. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargeFaceList(String largeFaceListId) { + // Generated convenience method for updateLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListRequest requestObj = new UpdateLargeFaceListRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargeFaceListWithResponse(largeFaceListId, request, requestOptions).getValue(); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargeFaceLists(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargeFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargeFaceLists() { + // Generated convenience method for getLargeFaceListsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceCollectionTrainingResult getLargeFaceListTrainingStatus(String largeFaceListId) { + // Generated convenience method for getLargeFaceListTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListTrainingStatusWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(FaceCollectionTrainingResult.class); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargeFaceList(String largeFaceListId) { + // Generated convenience method for beginTrainLargeFaceListWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainLargeFaceListWithModel(largeFaceListId, requestOptions); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargeFaceListFaceFromUrl(String largeFaceListId, String url, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargeFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargeFaceListFaceFromUrlRequest requestObj = new AddLargeFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargeFaceListFaceFromUrlWithResponse(largeFaceListId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargeFaceListFaceFromUrl(String largeFaceListId, String url) { + // Generated convenience method for addLargeFaceListFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargeFaceListFaceFromUrlRequest requestObj = new AddLargeFaceListFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addLargeFaceListFaceFromUrlWithResponse(largeFaceListId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargeFaceListFace(String largeFaceListId, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargeFaceListFaceWithResponse(largeFaceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargeFaceListFace(String largeFaceListId, BinaryData imageContent) { + // Generated convenience method for addLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addLargeFaceListFaceWithResponse(largeFaceListId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for deleteLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).getValue(); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large face list. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargeFaceListFace getLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for getLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, requestOptions).getValue() + .toObject(LargeFaceListFace.class); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargeFaceListFace(String largeFaceListId, String persistedFaceId, String userData) { + // Generated convenience method for updateLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListFaceRequest requestObj = new UpdateLargeFaceListFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, request, requestOptions).getValue(); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargeFaceListFace(String largeFaceListId, String persistedFaceId) { + // Generated convenience method for updateLargeFaceListFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargeFaceListFaceRequest requestObj = new UpdateLargeFaceListFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargeFaceListFaceWithResponse(largeFaceListId, persistedFaceId, request, requestOptions).getValue(); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargeFaceListFaces(String largeFaceListId, String start, Integer top) { + // Generated convenience method for getLargeFaceListFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLargeFaceListFacesWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargeFaceListFaces(String largeFaceListId) { + // Generated convenience method for getLargeFaceListFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargeFaceListFacesWithResponse(largeFaceListId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createPersonGroup(String personGroupId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupRequest requestObj + = new CreatePersonGroupRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + createPersonGroupWithResponse(personGroupId, request, requestOptions).getValue(); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createPersonGroup(String personGroupId, String name) { + // Generated convenience method for createPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupRequest requestObj = new CreatePersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + createPersonGroupWithResponse(personGroupId, request, requestOptions).getValue(); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePersonGroup(String personGroupId) { + // Generated convenience method for deletePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deletePersonGroupWithResponse(personGroupId, requestOptions).getValue(); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + * + * @param personGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonGroup getPersonGroup(String personGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getPersonGroupWithResponse(personGroupId, requestOptions).getValue().toObject(PersonGroup.class); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonGroup getPersonGroup(String personGroupId) { + // Generated convenience method for getPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupWithResponse(personGroupId, requestOptions).getValue().toObject(PersonGroup.class); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroup(String personGroupId, String name, String userData) { + // Generated convenience method for updatePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupRequest requestObj = new UpdatePersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupWithResponse(personGroupId, request, requestOptions).getValue(); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroup(String personGroupId) { + // Generated convenience method for updatePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupRequest requestObj = new UpdatePersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupWithResponse(personGroupId, request, requestOptions).getValue(); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersonGroups(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getPersonGroupsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_PERSON_GROUP); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersonGroups() { + // Generated convenience method for getPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_PERSON_GROUP); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceCollectionTrainingResult getPersonGroupTrainingStatus(String personGroupId) { + // Generated convenience method for getPersonGroupTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupTrainingStatusWithResponse(personGroupId, requestOptions).getValue() + .toObject(FaceCollectionTrainingResult.class); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainPersonGroup(String personGroupId) { + // Generated convenience method for beginTrainPersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainPersonGroupWithModel(personGroupId, requestOptions); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createPersonGroupPerson(String personGroupId, String name, String userData) { + // Generated convenience method for createPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupPersonRequest requestObj = new CreatePersonGroupPersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupPersonWithResponse(personGroupId, request, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + * + * @param personGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createPersonGroupPerson(String personGroupId, String name) { + // Generated convenience method for createPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreatePersonGroupPersonRequest requestObj = new CreatePersonGroupPersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createPersonGroupPersonWithResponse(personGroupId, request, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for deletePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + deletePersonGroupPersonWithResponse(personGroupId, personId, requestOptions).getValue(); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified person group. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonGroupPerson getPersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for getPersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonWithResponse(personGroupId, personId, requestOptions).getValue() + .toObject(PersonGroupPerson.class); + } + + /** + * Update name or userData of a person. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroupPerson(String personGroupId, String personId, String name, String userData) { + // Generated convenience method for updatePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonRequest requestObj + = new UpdatePersonGroupPersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupPersonWithResponse(personGroupId, personId, request, requestOptions).getValue(); + } + + /** + * Update name or userData of a person. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroupPerson(String personGroupId, String personId) { + // Generated convenience method for updatePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonRequest requestObj = new UpdatePersonGroupPersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupPersonWithResponse(personGroupId, personId, request, requestOptions).getValue(); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersonGroupPersons(String personGroupId, String start, Integer top) { + // Generated convenience method for getPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonGroupPersonsWithResponse(personGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersonGroupPersons(String personGroupId) { + // Generated convenience method for getPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonsWithResponse(personGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addPersonGroupPersonFaceFromUrl(String personGroupId, String personId, String url, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addPersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddPersonGroupPersonFaceFromUrlRequest requestObj = new AddPersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addPersonGroupPersonFaceFromUrlWithResponse(personGroupId, personId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addPersonGroupPersonFaceFromUrl(String personGroupId, String personId, String url) { + // Generated convenience method for addPersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddPersonGroupPersonFaceFromUrlRequest requestObj = new AddPersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addPersonGroupPersonFaceFromUrlWithResponse(personGroupId, personId, request, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addPersonGroupPersonFace(String personGroupId, String personId, BinaryData imageContent, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addPersonGroupPersonFaceWithResponse(personGroupId, personId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addPersonGroupPersonFace(String personGroupId, String personId, BinaryData imageContent) { + // Generated convenience method for addPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addPersonGroupPersonFaceWithResponse(personGroupId, personId, imageContent, requestOptions).getValue() + .toObject(AddFaceResult.class); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deletePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId) { + // Generated convenience method for deletePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deletePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, requestOptions).getValue(); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for person group person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonGroupPersonFace getPersonGroupPersonFace(String personGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for getPersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, requestOptions).getValue() + .toObject(PersonGroupPersonFace.class); + } + + /** + * Update a person persisted face's userData field. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId, + String userData) { + // Generated convenience method for updatePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonFaceRequest requestObj = new UpdatePersonGroupPersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, request, requestOptions) + .getValue(); + } + + /** + * Update a person persisted face's userData field. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonGroupPersonFace(String personGroupId, String personId, String persistedFaceId) { + // Generated convenience method for updatePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonGroupPersonFaceRequest requestObj = new UpdatePersonGroupPersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonGroupPersonFaceWithResponse(personGroupId, personId, persistedFaceId, request, requestOptions) + .getValue(); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param recognitionModel The 'recognitionModel' associated with this face list. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is + * 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared + * with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createLargePersonGroup(String largePersonGroupId, String name, String userData, + FaceRecognitionModel recognitionModel) { + // Generated convenience method for createLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupRequest requestObj + = new CreateLargePersonGroupRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData request = BinaryData.fromObject(requestObj); + createLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions).getValue(); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createLargePersonGroup(String largePersonGroupId, String name) { + // Generated convenience method for createLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupRequest requestObj = new CreateLargePersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + createLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions).getValue(); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for deleteLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLargePersonGroupWithResponse(largePersonGroupId, requestOptions).getValue(); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + * + * @param largePersonGroupId ID of the container. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 + * people. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroup getLargePersonGroup(String largePersonGroupId, Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(LargePersonGroup.class); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 + * people. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroup getLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(LargePersonGroup.class); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroup(String largePersonGroupId, String name, String userData) { + // Generated convenience method for updateLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupRequest requestObj + = new UpdateLargePersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions).getValue(); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for updateLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupRequest requestObj = new UpdateLargePersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupWithResponse(largePersonGroupId, request, requestOptions).getValue(); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargePersonGroups(String start, Integer top, Boolean returnRecognitionModel) { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + return getLargePersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargePersonGroups() { + // Generated convenience method for getLargePersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return training result of a container. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceCollectionTrainingResult getLargePersonGroupTrainingStatus(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupTrainingStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupTrainingStatusWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(FaceCollectionTrainingResult.class); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargePersonGroup(String largePersonGroupId) { + // Generated convenience method for beginTrainLargePersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginTrainLargePersonGroupWithModel(largePersonGroupId, requestOptions); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createLargePersonGroupPerson(String largePersonGroupId, String name, String userData) { + // Generated convenience method for createLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupPersonRequest requestObj + = new CreateLargePersonGroupPersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupPersonWithResponse(largePersonGroupId, request, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + * + * @param largePersonGroupId ID of the container. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of create person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreatePersonResult createLargePersonGroupPerson(String largePersonGroupId, String name) { + // Generated convenience method for createLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateLargePersonGroupPersonRequest requestObj = new CreateLargePersonGroupPersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return createLargePersonGroupPersonWithResponse(largePersonGroupId, request, requestOptions).getValue() + .toObject(CreatePersonResult.class); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for deleteLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLargePersonGroupPersonWithResponse(largePersonGroupId, personId, requestOptions).getValue(); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the person in a specified large person group. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroupPerson getLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for getLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonWithResponse(largePersonGroupId, personId, requestOptions).getValue() + .toObject(LargePersonGroupPerson.class); + } + + /** + * Update name or userData of a person. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroupPerson(String largePersonGroupId, String personId, String name, String userData) { + // Generated convenience method for updateLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonRequest requestObj + = new UpdateLargePersonGroupPersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupPersonWithResponse(largePersonGroupId, personId, request, requestOptions).getValue(); + } + + /** + * Update name or userData of a person. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroupPerson(String largePersonGroupId, String personId) { + // Generated convenience method for updateLargePersonGroupPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonRequest requestObj = new UpdateLargePersonGroupPersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupPersonWithResponse(largePersonGroupId, personId, request, requestOptions).getValue(); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largePersonGroupId ID of the container. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargePersonGroupPersons(String largePersonGroupId, String start, + Integer top) { + // Generated convenience method for getLargePersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLargePersonGroupPersonsWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param largePersonGroupId ID of the container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLargePersonGroupPersons(String largePersonGroupId) { + // Generated convenience method for getLargePersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonsWithResponse(largePersonGroupId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargePersonGroupPersonFaceFromUrl(String largePersonGroupId, String personId, String url, + List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargePersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargePersonGroupPersonFaceFromUrlRequest requestObj = new AddLargePersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargePersonGroupPersonFaceFromUrlWithResponse(largePersonGroupId, personId, request, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargePersonGroupPersonFaceFromUrl(String largePersonGroupId, String personId, String url) { + // Generated convenience method for addLargePersonGroupPersonFaceFromUrlWithResponse + RequestOptions requestOptions = new RequestOptions(); + AddLargePersonGroupPersonFaceFromUrlRequest requestObj = new AddLargePersonGroupPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return addLargePersonGroupPersonFaceFromUrlWithResponse(largePersonGroupId, personId, request, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargePersonGroupPersonFace(String largePersonGroupId, String personId, + BinaryData imageContent, List targetFace, FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for addLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return addLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for adding face. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AddFaceResult addLargePersonGroupPersonFace(String largePersonGroupId, String personId, + BinaryData imageContent) { + // Generated convenience method for addLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return addLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, imageContent, requestOptions) + .getValue() + .toObject(AddFaceResult.class); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLargePersonGroupPersonFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for deleteLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions) + .getValue(); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for large person group person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LargePersonGroupPersonFace getLargePersonGroupPersonFace(String largePersonGroupId, String personId, + String persistedFaceId) { + // Generated convenience method for getLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, requestOptions) + .getValue() + .toObject(LargePersonGroupPersonFace.class); + } + + /** + * Update a person persisted face's userData field. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroupPersonFace(String largePersonGroupId, String personId, String persistedFaceId, + String userData) { + // Generated convenience method for updateLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonFaceRequest requestObj + = new UpdateLargePersonGroupPersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, request, + requestOptions).getValue(); + } + + /** + * Update a person persisted face's userData field. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateLargePersonGroupPersonFace(String largePersonGroupId, String personId, String persistedFaceId) { + // Generated convenience method for updateLargePersonGroupPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateLargePersonGroupPersonFaceRequest requestObj = new UpdateLargePersonGroupPersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateLargePersonGroupPersonFaceWithResponse(largePersonGroupId, personId, persistedFaceId, request, + requestOptions).getValue(); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + * + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreatePerson(String name, String userData) { + // Generated convenience method for beginCreatePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest requestObj = new CreatePersonRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreatePersonWithModel(request, requestOptions); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + * + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreatePerson(String name) { + // Generated convenience method for beginCreatePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreatePersonRequest requestObj = new CreatePersonRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreatePersonWithModel(request, requestOptions); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePerson(String personId) { + // Generated convenience method for beginDeletePersonWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeletePersonWithModel(personId, requestOptions); + } + + /** + * Retrieve a person's name and userData from Person Directory. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return person resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonDirectoryPerson getPerson(String personId) { + // Generated convenience method for getPersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonWithResponse(personId, requestOptions).getValue().toObject(PersonDirectoryPerson.class); + } + + /** + * Update name or userData of a person. + * + * @param personId Person ID of the person. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePerson(String personId, String name, String userData) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest requestObj = new UpdatePersonRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonWithResponse(personId, request, requestOptions).getValue(); + } + + /** + * Update name or userData of a person. + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePerson(String personId) { + // Generated convenience method for updatePersonWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonRequest requestObj = new UpdatePersonRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonWithResponse(personId, request, requestOptions).getValue(); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersons(String start, Integer top) { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getPersonsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getPersons() { + // Generated convenience method for getPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonsWithResponse(requestOptions).getValue().toObject(TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personId Person ID of the person. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group of person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ListGroupReferenceResult getDynamicPersonGroupReferences(String personId, String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupReferencesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupReferencesWithResponse(personId, requestOptions).getValue() + .toObject(ListGroupReferenceResult.class); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param personId Person ID of the person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group of person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ListGroupReferenceResult getDynamicPersonGroupReferences(String personId) { + // Generated convenience method for getDynamicPersonGroupReferencesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupReferencesWithResponse(personId, requestOptions).getValue() + .toObject(ListGroupReferenceResult.class); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param url URL of input image. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceFromUrl(String personId, + FaceRecognitionModel recognitionModel, String url, List targetFace, FaceDetectionModel detectionModel, + String userData) { + // Generated convenience method for beginAddPersonFaceFromUrlWithModel + RequestOptions requestOptions = new RequestOptions(); + AddPersonFaceFromUrlRequest requestObj = new AddPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return serviceClient.beginAddPersonFaceFromUrlWithModel(personId, recognitionModel.toString(), request, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param url URL of input image. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceFromUrl(String personId, + FaceRecognitionModel recognitionModel, String url) { + // Generated convenience method for beginAddPersonFaceFromUrlWithModel + RequestOptions requestOptions = new RequestOptions(); + AddPersonFaceFromUrlRequest requestObj = new AddPersonFaceFromUrlRequest(url); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginAddPersonFaceFromUrlWithModel(personId, recognitionModel.toString(), request, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param imageContent The image to be analyzed. + * @param targetFace A face rectangle to specify the target face to be added to a person, in the format of + * 'targetFace=left,top,width,height'. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. + * @param userData User-provided data attached to the face. The size limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFace(String personId, + FaceRecognitionModel recognitionModel, BinaryData imageContent, List targetFace, + FaceDetectionModel detectionModel, String userData) { + // Generated convenience method for beginAddPersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + if (targetFace != null) { + requestOptions.addQueryParam("targetFace", + JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), + false); + } + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (userData != null) { + requestOptions.addQueryParam("userData", userData, false); + } + return serviceClient.beginAddPersonFaceWithModel(personId, recognitionModel.toString(), imageContent, + requestOptions); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param imageContent The image to be analyzed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFace(String personId, + FaceRecognitionModel recognitionModel, BinaryData imageContent) { + // Generated convenience method for beginAddPersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginAddPersonFaceWithModel(personId, recognitionModel.toString(), imageContent, + requestOptions); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePersonFace(String personId, + FaceRecognitionModel recognitionModel, String persistedFaceId) { + // Generated convenience method for beginDeletePersonFaceWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeletePersonFaceWithModel(personId, recognitionModel.toString(), persistedFaceId, + requestOptions); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return face resource for person directory person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PersonDirectoryFace getPersonFace(String personId, FaceRecognitionModel recognitionModel, + String persistedFaceId) { + // Generated convenience method for getPersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, requestOptions) + .getValue() + .toObject(PersonDirectoryFace.class); + } + + /** + * Update a persisted face's userData field of a person. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @param userData User-provided data attached to the face. The length limit is 1K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonFace(String personId, FaceRecognitionModel recognitionModel, String persistedFaceId, + String userData) { + // Generated convenience method for updatePersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonFaceRequest requestObj = new UpdatePersonFaceRequest().setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, request, requestOptions) + .getValue(); + } + + /** + * Update a persisted face's userData field of a person. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @param persistedFaceId Face ID of the face. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updatePersonFace(String personId, FaceRecognitionModel recognitionModel, String persistedFaceId) { + // Generated convenience method for updatePersonFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdatePersonFaceRequest requestObj = new UpdatePersonFaceRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updatePersonFaceWithResponse(personId, recognitionModel.toString(), persistedFaceId, request, requestOptions) + .getValue(); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list face of person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ListFaceResult getPersonFaces(String personId, FaceRecognitionModel recognitionModel) { + // Generated convenience method for getPersonFacesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getPersonFacesWithResponse(personId, recognitionModel.toString(), requestOptions).getValue() + .toObject(ListFaceResult.class); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateDynamicPersonGroupWithPerson( + String dynamicPersonGroupId, String name, List addPersonIds, String userData) { + // Generated convenience method for beginCreateDynamicPersonGroupWithPersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupWithPersonRequest requestObj + = new CreateDynamicPersonGroupWithPersonRequest(name, addPersonIds).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreateDynamicPersonGroupWithPersonWithModel(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginCreateDynamicPersonGroupWithPerson(String dynamicPersonGroupId, String name, List addPersonIds) { + // Generated convenience method for beginCreateDynamicPersonGroupWithPersonWithModel + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupWithPersonRequest requestObj + = new CreateDynamicPersonGroupWithPersonRequest(name, addPersonIds); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginCreateDynamicPersonGroupWithPersonWithModel(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createDynamicPersonGroup(String dynamicPersonGroupId, String name, String userData) { + // Generated convenience method for createDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupRequest requestObj = new CreateDynamicPersonGroupRequest(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + createDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions).getValue(); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void createDynamicPersonGroup(String dynamicPersonGroupId, String name) { + // Generated convenience method for createDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateDynamicPersonGroupRequest requestObj = new CreateDynamicPersonGroupRequest(name); + BinaryData request = BinaryData.fromObject(requestObj); + createDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions).getValue(); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for beginDeleteDynamicPersonGroupWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteDynamicPersonGroupWithModel(dynamicPersonGroupId, requestOptions); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a container that references Person Directory "Create Person". + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DynamicPersonGroup getDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for getDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupWithResponse(dynamicPersonGroupId, requestOptions).getValue() + .toObject(DynamicPersonGroup.class); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @param addPersonIds Array of personIds created by Person Directory "Create Person" to be added. + * @param removePersonIds Array of personIds created by Person Directory "Create Person" to be removed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateDynamicPersonGroupWithPersonChanges( + String dynamicPersonGroupId, String name, String userData, List addPersonIds, + List removePersonIds) { + // Generated convenience method for beginUpdateDynamicPersonGroupWithPersonChangesWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupWithPersonChangesRequest requestObj + = new UpdateDynamicPersonGroupWithPersonChangesRequest().setName(name) + .setUserData(userData) + .setAddPersonIds(addPersonIds) + .setRemovePersonIds(removePersonIds); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModel(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller + beginUpdateDynamicPersonGroupWithPersonChanges(String dynamicPersonGroupId) { + // Generated convenience method for beginUpdateDynamicPersonGroupWithPersonChangesWithModel + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupWithPersonChangesRequest requestObj + = new UpdateDynamicPersonGroupWithPersonChangesRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + return serviceClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModel(dynamicPersonGroupId, request, + requestOptions); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param name User defined name, maximum length is 128. + * @param userData Optional user defined data. Length should not exceed 16K. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateDynamicPersonGroup(String dynamicPersonGroupId, String name, String userData) { + // Generated convenience method for updateDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupRequest requestObj + = new UpdateDynamicPersonGroupRequest().setName(name).setUserData(userData); + BinaryData request = BinaryData.fromObject(requestObj); + updateDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions).getValue(); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void updateDynamicPersonGroup(String dynamicPersonGroupId) { + // Generated convenience method for updateDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateDynamicPersonGroupRequest requestObj = new UpdateDynamicPersonGroupRequest(); + BinaryData request = BinaryData.fromObject(requestObj); + updateDynamicPersonGroupWithResponse(dynamicPersonGroupId, request, requestOptions).getValue(); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getDynamicPersonGroups(String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getDynamicPersonGroups() { + // Generated convenience method for getDynamicPersonGroupsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ListPersonResult getDynamicPersonGroupPersons(String dynamicPersonGroupId, String start, Integer top) { + // Generated convenience method for getDynamicPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getDynamicPersonGroupPersonsWithResponse(dynamicPersonGroupId, requestOptions).getValue() + .toObject(ListPersonResult.class); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of list dynamic person group person. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ListPersonResult getDynamicPersonGroupPersons(String dynamicPersonGroupId) { + // Generated convenience method for getDynamicPersonGroupPersonsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDynamicPersonGroupPersonsWithResponse(dynamicPersonGroupId, requestOptions).getValue() + .toObject(ListPersonResult.class); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_LIST_ITEM + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_GROUP + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST_FACE + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_DIRECTORY_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_PERSON_GROUP_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_FACE_LIST + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LARGE_PERSON_GROUP_PERSON + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_DYNAMIC_PERSON_GROUP + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java new file mode 100644 index 0000000000000..7af2150861f78 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAdministrationClientBuilder.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the FaceAdministrationClient type. + */ +@ServiceClientBuilder(serviceClients = { FaceAdministrationClient.class, FaceAdministrationAsyncClient.class }) +public final class FaceAdministrationClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-vision-face.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceAdministrationClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private FaceServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder serviceVersion(FaceServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the FaceAdministrationClientBuilder. + */ + @Generated + public FaceAdministrationClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of FaceAdministrationClientImpl with the provided parameters. + * + * @return an instance of FaceAdministrationClientImpl. + */ + @Generated + private FaceAdministrationClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + FaceServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); + FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + localClientOptions.getHeaders() + .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of FaceAdministrationAsyncClient class. + * + * @return an instance of FaceAdministrationAsyncClient. + */ + @Generated + public FaceAdministrationAsyncClient buildAsyncClient() { + return new FaceAdministrationAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of FaceAdministrationClient class. + * + * @return an instance of FaceAdministrationClient. + */ + @Generated + public FaceAdministrationClient buildClient() { + return new FaceAdministrationClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(FaceAdministrationClientBuilder.class); +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java new file mode 100644 index 0000000000000..2b051c414cebd --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java @@ -0,0 +1,1889 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceClientImpl; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromFaceListRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarRequest; +import com.azure.ai.vision.face.implementation.models.GroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromPersonDirectoryRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromPersonDirectoryRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromPersonGroupRequest; +import com.azure.ai.vision.face.models.FaceFindSimilarResult; +import com.azure.ai.vision.face.models.FaceGroupingResult; +import com.azure.ai.vision.face.models.FaceIdentificationResult; +import com.azure.ai.vision.face.models.FaceVerificationResult; +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous FaceClient type. + */ +@ServiceClient(builder = FaceClientBuilder.class, isAsync = true) +public final class FaceAsyncClient { + @Generated + private final FaceClientImpl serviceClient; + + /** + * Initializes an instance of FaceAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceAsyncClient(FaceClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> detectFromUrlWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.detectFromUrlWithResponseAsync(request, requestOptions); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param imageContent The input image binary. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> detectWithResponse(BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.detectWithResponseAsync(imageContent, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponseAsync(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromFaceListWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromFaceListWithResponseAsync(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceListWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromLargeFaceListWithResponseAsync(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromPersonGroupWithResponseAsync(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     largePersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromLargePersonGroupWithResponseAsync(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromPersonDirectoryWithResponseAsync(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     dynamicPersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromDynamicPersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromDynamicPersonGroupWithResponseAsync(request, requestOptions); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId1: String (Required)
+     *     faceId2: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponseAsync(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromPersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromPersonGroupWithResponseAsync(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     largePersonGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponseAsync(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromPersonDirectoryWithResponseAsync(request, requestOptions); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for group face operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> groupWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponseAsync(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceIds An array of candidate faceIds. All of them are created by "Detect" and the faceIds will expire 24 + * hours after the detection call. The number of faceIds is limited to 1000. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilar(String faceId, List faceIds, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest requestObj + = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceIds An array of candidate faceIds. All of them are created by "Detect" and the faceIds will expire 24 + * hours after the detection call. The number of faceIds is limited to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilar(String faceId, List faceIds) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest requestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceListId An existing user-specified unique candidate Face List, created in "Create Face List". Face List + * contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromFaceList(String faceId, String faceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromFaceListRequest requestObj = new FindSimilarFromFaceListRequest(faceId, faceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromFaceListWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceListId An existing user-specified unique candidate Face List, created in "Create Face List". Face List + * contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromFaceList(String faceId, String faceListId) { + // Generated convenience method for findSimilarFromFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromFaceListRequest requestObj = new FindSimilarFromFaceListRequest(faceId, faceListId); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromFaceListWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceList(String faceId, String largeFaceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest requestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromLargeFaceListWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceList(String faceId, String largeFaceListId) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest requestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromLargeFaceListWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personGroupId personGroupId of the target Person Group, created by "Create Person Group". Parameter + * personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonGroup(List faceIds, String personGroupId, + Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonGroupRequest requestObj = new IdentifyFromPersonGroupRequest(faceIds, personGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personGroupId personGroupId of the target Person Group, created by "Create Person Group". Parameter + * personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonGroup(List faceIds, String personGroupId) { + // Generated convenience method for identifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonGroupRequest requestObj = new IdentifyFromPersonGroupRequest(faceIds, personGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId, Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest requestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromLargePersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest requestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromLargePersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personIds Array of personIds created in Person Directory "Create Person". The valid number of personIds is + * between [1,30]. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonDirectory(List faceIds, + List personIds, Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonDirectoryRequest requestObj = new IdentifyFromPersonDirectoryRequest(faceIds, personIds) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonDirectoryWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personIds Array of personIds created in Person Directory "Create Person". The valid number of personIds is + * between [1,30]. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonDirectory(List faceIds, + List personIds) { + // Generated convenience method for identifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonDirectoryRequest requestObj = new IdentifyFromPersonDirectoryRequest(faceIds, personIds); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonDirectoryWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param dynamicPersonGroupId DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to match + * against. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromDynamicPersonGroup(List faceIds, + String dynamicPersonGroupId, Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromDynamicPersonGroupRequest requestObj + = new IdentifyFromDynamicPersonGroupRequest(faceIds, dynamicPersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromDynamicPersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param dynamicPersonGroupId DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to match + * against. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromDynamicPersonGroup(List faceIds, + String dynamicPersonGroupId) { + // Generated convenience method for identifyFromDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromDynamicPersonGroupRequest requestObj + = new IdentifyFromDynamicPersonGroupRequest(faceIds, dynamicPersonGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromDynamicPersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT)); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + * + * @param faceId1 The faceId of one face, come from "Detect". + * @param faceId2 The faceId of another face, come from "Detect". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono verifyFaceToFace(String faceId1, String faceId2) { + // Generated convenience method for verifyFaceToFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFaceToFaceRequest requestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFaceToFaceWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + * + * @param faceId The faceId of the face, come from "Detect". + * @param personGroupId Using existing personGroupId and personId for fast loading a specified person. personGroupId + * is created in "Create Person Group". + * @param personId Specify a certain person in Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono verifyFromPersonGroup(String faceId, String personGroupId, String personId) { + // Generated convenience method for verifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromPersonGroupRequest requestObj = new VerifyFromPersonGroupRequest(faceId, personGroupId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromPersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + * + * @param faceId The faceId of the face, come from "Detect". + * @param largePersonGroupId Using existing largePersonGroupId and personId for fast loading a specified person. + * largePersonGroupId is created in "Create Large Person Group". + * @param personId Specify a certain person in Large Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono verifyFromLargePersonGroup(String faceId, String largePersonGroupId, + String personId) { + // Generated convenience method for verifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromLargePersonGroupRequest requestObj + = new VerifyFromLargePersonGroupRequest(faceId, largePersonGroupId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromLargePersonGroupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + * + * @param faceId The faceId of the face, come from "Detect". + * @param personId Specify a certain person in PersonDirectory Person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono verifyFromPersonDirectory(String faceId, String personId) { + // Generated convenience method for verifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromPersonDirectoryRequest requestObj = new VerifyFromPersonDirectoryRequest(faceId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromPersonDirectoryWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + * + * @param faceIds Array of candidate faceIds created by "Detect". The maximum is 1000 faces. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for group face operation on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono group(List faceIds) { + // Generated convenience method for groupWithResponse + RequestOptions requestOptions = new RequestOptions(); + GroupRequest requestObj = new GroupRequest(faceIds); + BinaryData request = BinaryData.fromObject(requestObj); + return groupWithResponse(request, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceGroupingResult.class)); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java new file mode 100644 index 0000000000000..3b92c52b13619 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java @@ -0,0 +1,1880 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceClientImpl; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromFaceListRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest; +import com.azure.ai.vision.face.implementation.models.FindSimilarRequest; +import com.azure.ai.vision.face.implementation.models.GroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromDynamicPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromPersonDirectoryRequest; +import com.azure.ai.vision.face.implementation.models.IdentifyFromPersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromPersonDirectoryRequest; +import com.azure.ai.vision.face.implementation.models.VerifyFromPersonGroupRequest; +import com.azure.ai.vision.face.models.FaceFindSimilarResult; +import com.azure.ai.vision.face.models.FaceGroupingResult; +import com.azure.ai.vision.face.models.FaceIdentificationResult; +import com.azure.ai.vision.face.models.FaceVerificationResult; +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; + +/** + * Initializes a new instance of the synchronous FaceClient type. + */ +@ServiceClient(builder = FaceClientBuilder.class) +public final class FaceClient { + @Generated + private final FaceClientImpl serviceClient; + + /** + * Initializes an instance of FaceClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceClient(FaceClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response detectFromUrlWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.detectFromUrlWithResponse(request, requestOptions); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param imageContent The input image binary. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response detectWithResponse(BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.detectWithResponse(imageContent, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponse(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarFromFaceListWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromFaceListWithResponse(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarFromLargeFaceListWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromLargeFaceListWithResponse(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromPersonGroupWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.identifyFromPersonGroupWithResponse(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     largePersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromLargePersonGroupWithResponse(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromPersonDirectoryWithResponse(request, requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     dynamicPersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromDynamicPersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromDynamicPersonGroupWithResponse(request, requestOptions); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId1: String (Required)
+     *     faceId2: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponse(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromPersonGroupWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.verifyFromPersonGroupWithResponse(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     largePersonGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponse(request, requestOptions); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromPersonDirectoryWithResponse(request, requestOptions); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for group face operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response groupWithResponse(BinaryData request, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponse(request, requestOptions); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceIds An array of candidate faceIds. All of them are created by "Detect" and the faceIds will expire 24 + * hours after the detection call. The number of faceIds is limited to 1000. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilar(String faceId, List faceIds, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest requestObj + = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceIds An array of candidate faceIds. All of them are created by "Detect" and the faceIds will expire 24 + * hours after the detection call. The number of faceIds is limited to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilar(String faceId, List faceIds) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest requestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceListId An existing user-specified unique candidate Face List, created in "Create Face List". Face List + * contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromFaceList(String faceId, String faceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromFaceListRequest requestObj = new FindSimilarFromFaceListRequest(faceId, faceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromFaceListWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param faceListId An existing user-specified unique candidate Face List, created in "Create Face List". Face List + * contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromFaceList(String faceId, String faceListId) { + // Generated convenience method for findSimilarFromFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromFaceListRequest requestObj = new FindSimilarFromFaceListRequest(faceId, faceListId); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromFaceListWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @param maxNumOfCandidatesReturned The number of top similar faces returned. The valid range is [1, 1000]. Default + * value is 20. + * @param mode Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromLargeFaceList(String faceId, String largeFaceListId, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest requestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromLargeFaceListWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + * + * @param faceId faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this + * faceId is not persisted and will expire 24 hours after the detection call. + * @param largeFaceListId An existing user-specified unique candidate Large Face List, created in "Create Large Face + * List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List findSimilarFromLargeFaceList(String faceId, String largeFaceListId) { + // Generated convenience method for findSimilarFromLargeFaceListWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarFromLargeFaceListRequest requestObj + = new FindSimilarFromLargeFaceListRequest(faceId, largeFaceListId); + BinaryData request = BinaryData.fromObject(requestObj); + return findSimilarFromLargeFaceListWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personGroupId personGroupId of the target Person Group, created by "Create Person Group". Parameter + * personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromPersonGroup(List faceIds, String personGroupId, + Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonGroupRequest requestObj = new IdentifyFromPersonGroupRequest(faceIds, personGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personGroupId personGroupId of the target Person Group, created by "Create Person Group". Parameter + * personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromPersonGroup(List faceIds, String personGroupId) { + // Generated convenience method for identifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonGroupRequest requestObj = new IdentifyFromPersonGroupRequest(faceIds, personGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromLargePersonGroup(List faceIds, String largePersonGroupId, + Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest requestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromLargePersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param largePersonGroupId largePersonGroupId of the target Large Person Group, created by "Create Large Person + * Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromLargePersonGroup(List faceIds, + String largePersonGroupId) { + // Generated convenience method for identifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromLargePersonGroupRequest requestObj + = new IdentifyFromLargePersonGroupRequest(faceIds, largePersonGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromLargePersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personIds Array of personIds created in Person Directory "Create Person". The valid number of personIds is + * between [1,30]. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromPersonDirectory(List faceIds, List personIds, + Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonDirectoryRequest requestObj = new IdentifyFromPersonDirectoryRequest(faceIds, personIds) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonDirectoryWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param personIds Array of personIds created in Person Directory "Create Person". The valid number of personIds is + * between [1,30]. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromPersonDirectory(List faceIds, List personIds) { + // Generated convenience method for identifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromPersonDirectoryRequest requestObj = new IdentifyFromPersonDirectoryRequest(faceIds, personIds); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromPersonDirectoryWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param dynamicPersonGroupId DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to match + * against. + * @param maxNumOfCandidatesReturned The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is + * 10. + * @param confidenceThreshold Customized identification confidence threshold, in the range of [0, 1]. Advanced user + * can tweak this value to override default internal threshold for better precision on their scenario data. Note + * there is no guarantee of this threshold value working on other data and after algorithm updates. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromDynamicPersonGroup(List faceIds, + String dynamicPersonGroupId, Integer maxNumOfCandidatesReturned, Double confidenceThreshold) { + // Generated convenience method for identifyFromDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromDynamicPersonGroupRequest requestObj + = new IdentifyFromDynamicPersonGroupRequest(faceIds, dynamicPersonGroupId) + .setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setConfidenceThreshold(confidenceThreshold); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromDynamicPersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + * + * @param faceIds Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * @param dynamicPersonGroupId DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to match + * against. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List identifyFromDynamicPersonGroup(List faceIds, + String dynamicPersonGroupId) { + // Generated convenience method for identifyFromDynamicPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + IdentifyFromDynamicPersonGroupRequest requestObj + = new IdentifyFromDynamicPersonGroupRequest(faceIds, dynamicPersonGroupId); + BinaryData request = BinaryData.fromObject(requestObj); + return identifyFromDynamicPersonGroupWithResponse(request, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + * + * @param faceId1 The faceId of one face, come from "Detect". + * @param faceId2 The faceId of another face, come from "Detect". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceVerificationResult verifyFaceToFace(String faceId1, String faceId2) { + // Generated convenience method for verifyFaceToFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFaceToFaceRequest requestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFaceToFaceWithResponse(request, requestOptions).getValue().toObject(FaceVerificationResult.class); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + * + * @param faceId The faceId of the face, come from "Detect". + * @param personGroupId Using existing personGroupId and personId for fast loading a specified person. personGroupId + * is created in "Create Person Group". + * @param personId Specify a certain person in Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceVerificationResult verifyFromPersonGroup(String faceId, String personGroupId, String personId) { + // Generated convenience method for verifyFromPersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromPersonGroupRequest requestObj = new VerifyFromPersonGroupRequest(faceId, personGroupId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromPersonGroupWithResponse(request, requestOptions).getValue() + .toObject(FaceVerificationResult.class); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + * + * @param faceId The faceId of the face, come from "Detect". + * @param largePersonGroupId Using existing largePersonGroupId and personId for fast loading a specified person. + * largePersonGroupId is created in "Create Large Person Group". + * @param personId Specify a certain person in Large Person Group. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceVerificationResult verifyFromLargePersonGroup(String faceId, String largePersonGroupId, + String personId) { + // Generated convenience method for verifyFromLargePersonGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromLargePersonGroupRequest requestObj + = new VerifyFromLargePersonGroupRequest(faceId, largePersonGroupId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromLargePersonGroupWithResponse(request, requestOptions).getValue() + .toObject(FaceVerificationResult.class); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + * + * @param faceId The faceId of the face, come from "Detect". + * @param personId Specify a certain person in PersonDirectory Person. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceVerificationResult verifyFromPersonDirectory(String faceId, String personId) { + // Generated convenience method for verifyFromPersonDirectoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFromPersonDirectoryRequest requestObj = new VerifyFromPersonDirectoryRequest(faceId, personId); + BinaryData request = BinaryData.fromObject(requestObj); + return verifyFromPersonDirectoryWithResponse(request, requestOptions).getValue() + .toObject(FaceVerificationResult.class); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + * + * @param faceIds Array of candidate faceIds created by "Detect". The maximum is 1000 faces. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response body for group face operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public FaceGroupingResult group(List faceIds) { + // Generated convenience method for groupWithResponse + RequestOptions requestOptions = new RequestOptions(); + GroupRequest requestObj = new GroupRequest(faceIds); + BinaryData request = BinaryData.fromObject(requestObj); + return groupWithResponse(request, requestOptions).getValue().toObject(FaceGroupingResult.class); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_IDENTIFICATION_RESULT + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java new file mode 100644 index 0000000000000..a694f703e190e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the FaceClient type. + */ +@ServiceClientBuilder(serviceClients = { FaceClient.class, FaceAsyncClient.class }) +public final class FaceClientBuilder implements HttpTrait, ConfigurationTrait, + TokenCredentialTrait, KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-vision-face.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the FaceClientBuilder. + */ + @Generated + public FaceClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private FaceServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the FaceClientBuilder. + */ + @Generated + public FaceClientBuilder serviceVersion(FaceServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the FaceClientBuilder. + */ + @Generated + public FaceClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of FaceClientImpl with the provided parameters. + * + * @return an instance of FaceClientImpl. + */ + @Generated + private FaceClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + FaceServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); + FaceClientImpl client = new FaceClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + localClientOptions.getHeaders() + .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of FaceAsyncClient class. + * + * @return an instance of FaceAsyncClient. + */ + @Generated + public FaceAsyncClient buildAsyncClient() { + return new FaceAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of FaceClient class. + * + * @return an instance of FaceClient. + */ + @Generated + public FaceClient buildClient() { + return new FaceClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(FaceClientBuilder.class); +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java new file mode 100644 index 0000000000000..b9f1c8c84e39a --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of FaceClient. + */ +public enum FaceServiceVersion implements ServiceVersion { + /** + * Enum value v1.1-preview.1. + */ + V1_1_PREVIEW_1("v1.1-preview.1"); + + private final String version; + + FaceServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link FaceServiceVersion}. + */ + public static FaceServiceVersion getLatest() { + return V1_1_PREVIEW_1; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java new file mode 100644 index 0000000000000..49085b804bc53 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java @@ -0,0 +1,1137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceSessionClientImpl; +import com.azure.ai.vision.face.implementation.MultipartFormDataHelper; +import com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionContent; +import com.azure.ai.vision.face.models.CreateLivenessSessionContent; +import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; +import com.azure.ai.vision.face.models.LivenessSession; +import com.azure.ai.vision.face.models.LivenessSessionAuditEntry; +import com.azure.ai.vision.face.models.LivenessSessionItem; +import com.azure.ai.vision.face.models.LivenessWithVerifySession; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous FaceSessionClient type. + */ +@ServiceClient(builder = FaceSessionClientBuilder.class, isAsync = true) +public final class FaceSessionAsyncClient { + @Generated + private final FaceSessionClientImpl serviceClient; + + /** + * Initializes an instance of FaceSessionAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceSessionAsyncClient(FaceSessionClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session creation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLivenessSessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + return this.serviceClient.createLivenessSessionWithResponseAsync(createLivenessSessionContent, requestOptions); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLivenessSessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessSessionWithResponseAsync(sessionId, requestOptions); + } + + /** + * Get session result of detectLiveness/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLiveness/singleModal call along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionResultWithResponseAsync(sessionId, requestOptions); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionsWithResponseAsync(requestOptions); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionAuditEntriesWithResponseAsync(sessionId, requestOptions); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createLivenessWithVerifySessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + return this.serviceClient.createLivenessWithVerifySessionWithResponseAsync(createLivenessSessionContent, + requestOptions); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createLivenessWithVerifySessionWithVerifyImageWithResponse( + BinaryData createLivenessWithVerifySessionContent, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation 'createLivenessWithVerifySessionWithVerifyImage' is 'multipart/form-data' + return this.serviceClient.createLivenessWithVerifySessionWithVerifyImageWithResponseAsync( + createLivenessWithVerifySessionContent, requestOptions); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLivenessWithVerifySessionWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessWithVerifySessionWithResponseAsync(sessionId, requestOptions); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionResultWithResponseAsync(sessionId, requestOptions); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionsWithResponseAsync(requestOptions); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionAuditEntriesWithResponseAsync(sessionId, requestOptions); + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + * + * @param createLivenessSessionContent Request for creating liveness session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session creation on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + createLivenessSession(CreateLivenessSessionContent createLivenessSessionContent) { + // Generated convenience method for createLivenessSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessSessionWithResponse(BinaryData.fromObject(createLivenessSessionContent), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessSessionResult.class)); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLivenessSession(String sessionId) { + // Generated convenience method for deleteLivenessSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLivenessSessionWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get session result of detectLiveness/singleModal call. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session result of detectLiveness/singleModal call on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLivenessSessionResult(String sessionId) { + // Generated convenience method for getLivenessSessionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionResultWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LivenessSession.class)); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessions(String start, Integer top) { + // Generated convenience method for getLivenessSessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessSessionsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM)); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessions() { + // Generated convenience method for getLivenessSessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM)); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionAuditEntries(String sessionId, String start, + Integer top) { + // Generated convenience method for getLivenessSessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessSessionAuditEntriesWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY)); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionAuditEntries(String sessionId) { + // Generated convenience method for getLivenessSessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionAuditEntriesWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY)); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * + * @param createLivenessSessionContent Request for creating liveness session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session with verify creation with verify image provided on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono + createLivenessWithVerifySession(CreateLivenessSessionContent createLivenessSessionContent) { + // Generated convenience method for createLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(createLivenessSessionContent), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessWithVerifySessionResult.class)); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session with verify creation with verify image provided on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createLivenessWithVerifySessionWithVerifyImage( + CreateLivenessWithVerifySessionContent createLivenessWithVerifySessionContent) { + // Generated convenience method for createLivenessWithVerifySessionWithVerifyImageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessWithVerifySessionWithVerifyImageWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeJsonField("Parameters", createLivenessWithVerifySessionContent.getParameters()) + .serializeFileField("VerifyImage", createLivenessWithVerifySessionContent.getVerifyImage().getContent(), + createLivenessWithVerifySessionContent.getVerifyImage().getContentType(), + createLivenessWithVerifySessionContent.getVerifyImage().getFilename()) + .end() + .getRequestBody(), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessWithVerifySessionResult.class)); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteLivenessWithVerifySession(String sessionId) { + // Generated convenience method for deleteLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteLivenessWithVerifySessionWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session result of detectLivenessWithVerify/singleModal call on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLivenessWithVerifySessionResult(String sessionId) { + // Generated convenience method for getLivenessWithVerifySessionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionResultWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LivenessWithVerifySession.class)); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessions(String start, Integer top) { + // Generated convenience method for getLivenessWithVerifySessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessWithVerifySessionsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM)); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessions() { + // Generated convenience method for getLivenessWithVerifySessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionsWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM)); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionAuditEntries(String sessionId, + String start, Integer top) { + // Generated convenience method for getLivenessWithVerifySessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessWithVerifySessionAuditEntriesWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY)); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionAuditEntries(String sessionId) { + // Generated convenience method for getLivenessWithVerifySessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionAuditEntriesWithResponse(sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY)); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java new file mode 100644 index 0000000000000..cf8f3e9033600 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java @@ -0,0 +1,1119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceSessionClientImpl; +import com.azure.ai.vision.face.implementation.MultipartFormDataHelper; +import com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionContent; +import com.azure.ai.vision.face.models.CreateLivenessSessionContent; +import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; +import com.azure.ai.vision.face.models.LivenessSession; +import com.azure.ai.vision.face.models.LivenessSessionAuditEntry; +import com.azure.ai.vision.face.models.LivenessSessionItem; +import com.azure.ai.vision.face.models.LivenessWithVerifySession; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.TypeReference; +import java.util.List; + +/** + * Initializes a new instance of the synchronous FaceSessionClient type. + */ +@ServiceClient(builder = FaceSessionClientBuilder.class) +public final class FaceSessionClient { + @Generated + private final FaceSessionClientImpl serviceClient; + + /** + * Initializes an instance of FaceSessionClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceSessionClient(FaceSessionClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session creation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLivenessSessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + return this.serviceClient.createLivenessSessionWithResponse(createLivenessSessionContent, requestOptions); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLivenessSessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessSessionWithResponse(sessionId, requestOptions); + } + + /** + * Get session result of detectLiveness/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLiveness/singleModal call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionResultWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionResultWithResponse(sessionId, requestOptions); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionsWithResponse(requestOptions); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionAuditEntriesWithResponse(sessionId, requestOptions); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response createLivenessWithVerifySessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + return this.serviceClient.createLivenessWithVerifySessionWithResponse(createLivenessSessionContent, + requestOptions); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response createLivenessWithVerifySessionWithVerifyImageWithResponse( + BinaryData createLivenessWithVerifySessionContent, RequestOptions requestOptions) { + // Protocol API requires serialization of parts with content-disposition and data, as operation 'createLivenessWithVerifySessionWithVerifyImage' is 'multipart/form-data' + return this.serviceClient.createLivenessWithVerifySessionWithVerifyImageWithResponse( + createLivenessWithVerifySessionContent, requestOptions); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLivenessWithVerifySessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessWithVerifySessionWithResponse(sessionId, requestOptions); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionResultWithResponse(sessionId, requestOptions); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionsWithResponse(RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionsWithResponse(requestOptions); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionAuditEntriesWithResponse(sessionId, requestOptions); + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + * + * @param createLivenessSessionContent Request for creating liveness session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session creation. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateLivenessSessionResult + createLivenessSession(CreateLivenessSessionContent createLivenessSessionContent) { + // Generated convenience method for createLivenessSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessSessionWithResponse(BinaryData.fromObject(createLivenessSessionContent), requestOptions) + .getValue() + .toObject(CreateLivenessSessionResult.class); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLivenessSession(String sessionId) { + // Generated convenience method for deleteLivenessSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLivenessSessionWithResponse(sessionId, requestOptions).getValue(); + } + + /** + * Get session result of detectLiveness/singleModal call. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session result of detectLiveness/singleModal call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LivenessSession getLivenessSessionResult(String sessionId) { + // Generated convenience method for getLivenessSessionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionResultWithResponse(sessionId, requestOptions).getValue() + .toObject(LivenessSession.class); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessSessions(String start, Integer top) { + // Generated convenience method for getLivenessSessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessSessionsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessSessions() { + // Generated convenience method for getLivenessSessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessSessionAuditEntries(String sessionId, String start, Integer top) { + // Generated convenience method for getLivenessSessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessSessionAuditEntriesWithResponse(sessionId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessSessionAuditEntries(String sessionId) { + // Generated convenience method for getLivenessSessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessSessionAuditEntriesWithResponse(sessionId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + * + * @param createLivenessSessionContent Request for creating liveness session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session with verify creation with verify image provided. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + CreateLivenessWithVerifySessionResult + createLivenessWithVerifySession(CreateLivenessSessionContent createLivenessSessionContent) { + // Generated convenience method for createLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(createLivenessSessionContent), + requestOptions).getValue().toObject(CreateLivenessWithVerifySessionResult.class); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of liveness session with verify creation with verify image provided. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + CreateLivenessWithVerifySessionResult createLivenessWithVerifySessionWithVerifyImage( + CreateLivenessWithVerifySessionContent createLivenessWithVerifySessionContent) { + // Generated convenience method for createLivenessWithVerifySessionWithVerifyImageWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createLivenessWithVerifySessionWithVerifyImageWithResponse(new MultipartFormDataHelper(requestOptions) + .serializeJsonField("Parameters", createLivenessWithVerifySessionContent.getParameters()) + .serializeFileField("VerifyImage", createLivenessWithVerifySessionContent.getVerifyImage().getContent(), + createLivenessWithVerifySessionContent.getVerifyImage().getContentType(), + createLivenessWithVerifySessionContent.getVerifyImage().getFilename()) + .end() + .getRequestBody(), requestOptions).getValue().toObject(CreateLivenessWithVerifySessionResult.class); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteLivenessWithVerifySession(String sessionId) { + // Generated convenience method for deleteLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteLivenessWithVerifySessionWithResponse(sessionId, requestOptions).getValue(); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session result of detectLivenessWithVerify/singleModal call. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LivenessWithVerifySession getLivenessWithVerifySessionResult(String sessionId) { + // Generated convenience method for getLivenessWithVerifySessionResultWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionResultWithResponse(sessionId, requestOptions).getValue() + .toObject(LivenessWithVerifySession.class); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + * + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessWithVerifySessions(String start, Integer top) { + // Generated convenience method for getLivenessWithVerifySessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessWithVerifySessionsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessWithVerifySessions() { + // Generated convenience method for getLivenessWithVerifySessionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionsWithResponse(requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @param start List resources greater than the "start". It contains no more than 64 characters. Default is empty. + * @param top The number of items to list, ranging in [1, 1000]. Default is 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessWithVerifySessionAuditEntries(String sessionId, String start, + Integer top) { + // Generated convenience method for getLivenessWithVerifySessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (start != null) { + requestOptions.addQueryParam("start", start, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return getLivenessWithVerifySessionAuditEntriesWithResponse(sessionId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY); + } + + /** + * Gets session requests and response body for the session. + * + * @param sessionId The unique ID to reference this session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return session requests and response body for the session. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public List getLivenessWithVerifySessionAuditEntries(String sessionId) { + // Generated convenience method for getLivenessWithVerifySessionAuditEntriesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLivenessWithVerifySessionAuditEntriesWithResponse(sessionId, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY); + } + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LIVENESS_SESSION_ITEM + = new TypeReference>() { + }; + + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_LIVENESS_SESSION_AUDIT_ENTRY + = new TypeReference>() { + }; +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java new file mode 100644 index 0000000000000..fd62681711432 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +import com.azure.ai.vision.face.implementation.FaceSessionClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the FaceSessionClient type. + */ +@ServiceClientBuilder(serviceClients = { FaceSessionClient.class, FaceSessionAsyncClient.class }) +public final class FaceSessionClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-vision-face.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the FaceSessionClientBuilder. + */ + @Generated + public FaceSessionClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public FaceSessionClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private FaceServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the FaceSessionClientBuilder. + */ + @Generated + public FaceSessionClientBuilder serviceVersion(FaceServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the FaceSessionClientBuilder. + */ + @Generated + public FaceSessionClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of FaceSessionClientImpl with the provided parameters. + * + * @return an instance of FaceSessionClientImpl. + */ + @Generated + private FaceSessionClientImpl buildInnerClient() { + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + FaceServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); + FaceSessionClientImpl client = new FaceSessionClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = new HttpHeaders(); + localClientOptions.getHeaders() + .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of FaceSessionAsyncClient class. + * + * @return an instance of FaceSessionAsyncClient. + */ + @Generated + public FaceSessionAsyncClient buildAsyncClient() { + return new FaceSessionAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of FaceSessionClient class. + * + * @return an instance of FaceSessionClient. + */ + @Generated + public FaceSessionClient buildClient() { + return new FaceSessionClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(FaceSessionClientBuilder.class); +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java new file mode 100644 index 0000000000000..0d16756891ac6 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java @@ -0,0 +1,9925 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.ai.vision.face.models.DynamicPersonGroup; +import com.azure.ai.vision.face.models.FaceCollectionTrainingResult; +import com.azure.ai.vision.face.models.FaceOperationResult; +import com.azure.ai.vision.face.models.PersonDirectoryFace; +import com.azure.ai.vision.face.models.PersonDirectoryPerson; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the FaceAdministrationClient type. + */ +public final class FaceAdministrationClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FaceAdministrationClientService service; + + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of FaceAdministrationClient client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceAdministrationClientImpl(String endpoint, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceAdministrationClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service + = RestProxy.create(FaceAdministrationClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for FaceAdministrationClient to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}/face/{apiVersion}") + @ServiceInterface(name = "FaceAdministrationCl") + public interface FaceAdministrationClientService { + @Put("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/facelists/{faceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/facelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFaceLists(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/facelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFaceListsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/facelists/{faceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addFaceListFaceFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/facelists/{faceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addFaceListFaceFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/facelists/{faceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Post("/facelists/{faceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Delete("/facelists/{faceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/facelists/{faceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("faceListId") String faceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceLists(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceListTrainingStatus(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListTrainingStatusSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trainLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addLargeFaceListFaceFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addLargeFaceListFaceFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addLargeFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Post("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addLargeFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("application/octet-stream") BinaryData imageContent, RequestOptions requestOptions, + Context context); + + @Delete("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLargeFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLargeFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateLargeFaceListFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Patch("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateLargeFaceListFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargeFaceListFaces(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largefacelists/{largeFaceListId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargeFaceListFacesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Put("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/persongroups/{personGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/persongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroups(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroupTrainingStatus(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupTrainingStatusSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trainPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createPersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createPersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Patch("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Patch("/persongroups/{personGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroupPersons(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupPersonsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addPersonGroupPersonFaceFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addPersonGroupPersonFaceFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addPersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/persongroups/{personGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addPersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Delete("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/persongroups/{personGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personGroupId") String personGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroups(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroupTrainingStatus(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/training") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupTrainingStatusSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> trainLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/train") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response trainLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLargePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLargePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLargePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLargePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, RequestOptions requestOptions, + Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateLargePersonGroupPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateLargePersonGroupPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroupPersons(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupPersonsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addLargePersonGroupPersonFaceFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addLargePersonGroupPersonFaceFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addLargePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addLargePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLargePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLargePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLargePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLargePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateLargePersonGroupPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateLargePersonGroupPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, + @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/persons") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/persons") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Delete("/persons/{personId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/persons/{personId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/persons/{personId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersons(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/dynamicPersonGroupReferences") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDynamicPersonGroupReferences(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/dynamicPersonGroupReferences") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDynamicPersonGroupReferencesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addPersonFaceFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addPersonFaceFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> addPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response addPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Delete("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deletePersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deletePersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Patch("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updatePersonFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Patch("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces/{persistedFaceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updatePersonFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, + @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getPersonFaces(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/persons/{personId}/recognitionModels/{recognitionModel}/persistedfaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getPersonFacesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("personId") String personId, + @PathParam("recognitionModel") String recognitionModel, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Put("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createDynamicPersonGroupWithPerson(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createDynamicPersonGroupWithPersonSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createDynamicPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Put("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createDynamicPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Delete("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDynamicPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDynamicPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDynamicPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDynamicPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateDynamicPersonGroupWithPersonChanges(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateDynamicPersonGroupWithPersonChangesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateDynamicPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Patch("/dynamicpersongroups/{dynamicPersonGroupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateDynamicPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDynamicPersonGroups(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDynamicPersonGroupsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups/{dynamicPersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDynamicPersonGroupPersons(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/dynamicpersongroups/{dynamicPersonGroupId}/persons") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getDynamicPersonGroupPersonsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("dynamicPersonGroupId") String dynamicPersonGroupId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createFaceListWithResponseAsync(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, accept, request, requestOptions, context)); + } + + /** + * Create an empty Face List with user-specified faceListId, name, an optional userData and recognitionModel. + * + * Up to 64 Face Lists are allowed in one subscription. + * + * Face List is a list of faces, up to 1,000 faces, and used by "Find Similar From Face List". + * + * After creation, user should use "Add Face List Face" to import the faces. No image will be stored. Only the + * extracted face feature(s) will be stored on server until "Delete Face List" is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * Please consider Large Face List when the face number is large. It can support up to 1,000,000 faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, accept, + request, requestOptions, Context.NONE); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceListWithResponseAsync(String faceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, accept, requestOptions, context)); + } + + /** + * Delete a specified Face List. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, accept, + requestOptions, Context.NONE); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     faceListId: String (Required)
+     *     persistedFaces (Optional): [
+     *          (Optional){
+     *             persistedFaceId: String (Required)
+     *             userData: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face list is a list of faces, up to 1,000 faces along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceListWithResponseAsync(String faceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, accept, requestOptions, context)); + } + + /** + * Retrieve a Face List's faceListId, name, userData, recognitionModel and faces in the Face List. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     faceListId: String (Required)
+     *     persistedFaces (Optional): [
+     *          (Optional){
+     *             persistedFaceId: String (Required)
+     *             userData: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face list is a list of faces, up to 1,000 faces along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceListWithResponse(String faceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, accept, + requestOptions, Context.NONE); + } + + /** + * Update information of a Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateFaceListWithResponseAsync(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, accept, request, requestOptions, context)); + } + + /** + * Update information of a Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateFaceListWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, accept, + request, requestOptions, Context.NONE); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFaceListsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getFaceLists(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List Face Lists' faceListId, name, userData and recognitionModel. + * + * To get face information inside Face List use "Get Face List". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFaceListsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFaceListsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceListFaceFromUrlWithResponseAsync(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.addFaceListFaceFromUrl(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, accept, request, requestOptions, context)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceListFaceFromUrlWithResponse(String faceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.addFaceListFaceFromUrlSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, + accept, request, requestOptions, Context.NONE); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addFaceListFaceWithResponseAsync(String faceListId, BinaryData imageContent, + RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addFaceListFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + faceListId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a specified Face List, up to 1,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Face List Face" or "Delete Face List" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addFaceListFaceWithResponse(String faceListId, BinaryData imageContent, + RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.addFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, + contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteFaceListFaceWithResponseAsync(String faceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteFaceListFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), faceListId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Delete a face from a Face List by specified faceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Face List are processed sequentially and to/from different Face Lists are in + * parallel. + * + * @param faceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteFaceListFaceWithResponse(String faceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), faceListId, + persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargeFaceListWithResponseAsync(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, request, requestOptions, context)); + } + + /** + * Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and + * recognitionModel. + * + * Large Face List is a list of faces, up to 1,000,000 faces, and used by "Find Similar From Large Face List". + * + * After creation, user should use Add Large Face List Face to import the faces and Train Large Face List to make it + * ready for "Find Similar". No image will be stored. Only the extracted face feature(s) will be stored on server + * until Delete Large Face List is called. + * + * "Find Similar" is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way + * face identification. But if the actual use is to identify person, please use Person Group / Large Person Group + * and "Identify". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 64 Large Face Lists. + * > * S0-tier subscription quota: 1,000,000 Large Face Lists. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, request, requestOptions, Context.NONE); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargeFaceListWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * Adding/deleting faces to/from a same Large Face List are processed sequentially and to/from different Large Face + * Lists are in parallel. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return large face list is a list of faces, up to 1,000,000 faces along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Retrieve a Large Face List's largeFaceListId, name, userData and recognitionModel. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return large face list is a list of faces, up to 1,000,000 faces along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), largeFaceListId, + accept, requestOptions, Context.NONE); + } + + /** + * Update information of a Large Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargeFaceListWithResponseAsync(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, request, requestOptions, context)); + } + + /** + * Update information of a Large Face List, including name and userData. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargeFaceListWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, request, requestOptions, Context.NONE); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceLists(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List Large Face Lists' information of largeFaceListId, name, userData and recognitionModel. + * + * To get face information inside largeFaceList use "Get Large Face List Face". + * + * Large Face Lists are stored in alphabetical order of largeFaceListId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largeFaceListId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListTrainingStatusWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceListTrainingStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * To check the Large Face List training status completed or still ongoing. Large Face List training is an + * asynchronous operation triggered by "Train Large Face List". + * + * Training time depends on the number of face entries in a Large Face List. It could be in seconds, or up to half + * an hour for 1,000,000 faces. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListTrainingStatusWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListTrainingStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainLargeFaceListWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trainLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainLargeFaceListWithResponse(String largeFaceListId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargeFaceListAsync(String largeFaceListId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainLargeFaceListWithResponseAsync(largeFaceListId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargeFaceList(String largeFaceListId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainLargeFaceListWithResponse(largeFaceListId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargeFaceListWithModelAsync(String largeFaceListId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainLargeFaceListWithResponseAsync(largeFaceListId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Submit a Large Face List training task. + * + * + * Training is a crucial step that only a trained Large Face List can be used by "Find Similar From Large Face + * List". + * + * The training task is an asynchronous task. Training time depends on the number of face entries in a Large Face + * List. It could be in seconds, or up to half an hour for 1,000,000 faces. To check training completion, please use + * "Get Large Face List Training Status". + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargeFaceListWithModel(String largeFaceListId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainLargeFaceListWithResponse(largeFaceListId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargeFaceListFaceFromUrlWithResponseAsync(String largeFaceListId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.addLargeFaceListFaceFromUrl(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, request, requestOptions, context)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargeFaceListFaceFromUrlWithResponse(String largeFaceListId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.addLargeFaceListFaceFromUrlSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, request, requestOptions, Context.NONE); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargeFaceListFaceWithResponseAsync(String largeFaceListId, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.addLargeFaceListFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a specified Large Face List, up to 1,000,000 faces. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Face List Face" or "Delete Large Face List" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 faces per Large Face List. + * > * S0-tier subscription quota: 1,000,000 faces per Large Face List. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargeFaceListFaceWithResponse(String largeFaceListId, BinaryData imageContent, + RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.addLargeFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargeFaceListFaceWithResponseAsync(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLargeFaceListFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Delete a face from a Large Face List by specified largeFaceListId and persistedFaceId. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLargeFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFaceWithResponseAsync(String largeFaceListId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceListFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Retrieve persisted face in Large Face List by largeFaceListId and persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large face list along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargeFaceListFaceWithResponseAsync(String largeFaceListId, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.updateLargeFaceListFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, request, requestOptions, context)); + } + + /** + * Update a specified face's userData field in a Large Face List by its persistedFaceId. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargeFaceListFaceWithResponse(String largeFaceListId, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateLargeFaceListFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, persistedFaceId, accept, request, requestOptions, Context.NONE); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargeFaceListFacesWithResponseAsync(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargeFaceListFaces(this.getEndpoint(), + this.getServiceVersion().getVersion(), largeFaceListId, accept, requestOptions, context)); + } + + /** + * List faces' persistedFaceId and userData in a specified Large Face List. + * + * Faces are stored in alphabetical order of persistedFaceId created in "Add Large Face List Face". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         persistedFaceId: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargeFaceListFacesWithResponse(String largeFaceListId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargeFaceListFacesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largeFaceListId, accept, requestOptions, Context.NONE); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonGroupWithResponseAsync(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, request, requestOptions, context)); + } + + /** + * Create a new Person Group with specified personGroupId, name, user-provided userData and recognitionModel. + * + * A Person Group is a container holding the uploaded person data, including face recognition features. + * + * After creation, use "Create Person Group Person" to add persons into the group, and then call "Train Person + * Group" to get this group ready for "Identify From Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Person Group Person" or "Delete Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Person Group will use the recognition model that's + * already associated with the collection. Existing face feature(s) in a Person Group can't be updated to features + * extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Person Groups. Each holds up to 1,000 persons. + * > * S0-tier subscription quota: 1,000,000 Person Groups. Each holds up to 10,000 persons. + * > * to handle larger scale face identification problem, please consider using Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personGroupId, + accept, request, requestOptions, Context.NONE); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupWithResponseAsync(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deletePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, requestOptions, context)); + } + + /** + * Delete an existing Person Group with specified personGroupId. Persisted data in this Person Group will be + * deleted. + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personGroupId, + accept, requestOptions, Context.NONE); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     personGroupId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupWithResponseAsync(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, requestOptions, context)); + } + + /** + * Retrieve Person Group name, userData and recognitionModel. To get person information under this personGroup, use + * "Get Person Group Persons". + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     personGroupId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 10,000 persons + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personGroupId, + accept, requestOptions, Context.NONE); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupWithResponseAsync(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updatePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, request, requestOptions, context)); + } + + /** + * Update an existing Person Group's name and userData. The properties keep unchanged if they are not in request + * body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updatePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personGroupId, + accept, request, requestOptions, Context.NONE); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         personGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonGroups(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List Person Groups' personGroupId, name, userData and recognitionModel. + * + * Person Groups are stored in alphabetical order of personGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         personGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupTrainingStatusWithResponseAsync(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonGroupTrainingStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, requestOptions, context)); + } + + /** + * To check Person Group training status completed or still ongoing. Person Group training is an asynchronous + * operation triggered by "Train Person Group" API. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupTrainingStatusWithResponse(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupTrainingStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainPersonGroupWithResponseAsync(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trainPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, requestOptions, context)); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainPersonGroupWithResponse(String personGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personGroupId, + accept, requestOptions, Context.NONE); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainPersonGroupAsync(String personGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainPersonGroupWithResponseAsync(personGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainPersonGroup(String personGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainPersonGroupWithResponse(personGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainPersonGroupWithModelAsync(String personGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainPersonGroupWithResponseAsync(personGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Submit a Person Group training task. Training is a crucial step that only a trained Person Group can be used by + * "Identify From Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Person Group. It could be several seconds to minutes. To check training status, please use "Get Person Group + * Training Status". + * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainPersonGroupWithModel(String personGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainPersonGroupWithResponse(personGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createPersonGroupPersonWithResponseAsync(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createPersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, request, requestOptions, context)); + } + + /** + * Create a new person in a specified Person Group. To add face to this person, please call "Add Person Group Person + * Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Person Groups. + * > * S0-tier subscription quota: + * > * 10,000 persons per Person Group. + * > * 1,000,000 Person Groups. + * > * 100,000,000 persons in all Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createPersonGroupPersonWithResponse(String personGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createPersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupPersonWithResponseAsync(String personGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deletePersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, personId, accept, requestOptions, context)); + } + + /** + * Delete an existing person from a Person Group. The persistedFaceId, userData, person name and face feature(s) in + * the person entry will all be deleted. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonWithResponseAsync(String personGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, personId, accept, requestOptions, context)); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified person group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonWithResponse(String personGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, accept, requestOptions, Context.NONE); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupPersonWithResponseAsync(String personGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updatePersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, personId, accept, request, requestOptions, context)); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupPersonWithResponse(String personGroupId, String personId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updatePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, accept, request, requestOptions, Context.NONE); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonsWithResponseAsync(String personGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonGroupPersons(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, accept, requestOptions, context)); + } + + /** + * List all persons' information in the specified Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param personGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonsWithResponse(String personGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupPersonsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addPersonGroupPersonFaceFromUrlWithResponseAsync(String personGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.addPersonGroupPersonFaceFromUrl(this.getEndpoint(), + this.getServiceVersion().getVersion(), personGroupId, personId, accept, request, requestOptions, context)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addPersonGroupPersonFaceFromUrlWithResponse(String personGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.addPersonGroupPersonFaceFromUrlSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, accept, request, requestOptions, Context.NONE); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addPersonGroupPersonFaceWithResponseAsync(String personGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.addPersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a person into a Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Person Group Person Face", "Delete Person Group Person" or + * "Delete Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.addPersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deletePersonGroupPersonFaceWithResponseAsync(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.deletePersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Delete a face from a person in a Person Group by specified personGroupId, personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deletePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonGroupPersonFaceWithResponseAsync(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getPersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person group person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonGroupPersonFaceWithResponseAsync(String personGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.updatePersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, request, requestOptions, context)); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonGroupPersonFaceWithResponse(String personGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updatePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personGroupId, personId, persistedFaceId, accept, request, requestOptions, Context.NONE); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargePersonGroupWithResponseAsync(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and + * recognitionModel. + * + * A Large Person Group is a container holding the uploaded person data, including the face recognition features. It + * can hold up to 1,000,000 entities. + * + * After creation, use "Create Large Person Group Person" to add person into the group, and call "Train Large Person + * Group" to get this group ready for "Identify From Large Person Group". + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * "Delete Large Person Group Person" or "Delete Large Person Group" is called. + * + * 'recognitionModel' should be specified to associate with this Large Person Group. The default value for + * 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need + * in this parameter. New faces that are added to an existing Large Person Group will use the recognition model + * that's already associated with the collection. Existing face feature(s) in a Large Person Group can't be updated + * to features extracted by another version of recognition model. + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: 1,000 Large Person Groups. + * > * S0-tier subscription quota: 1,000,000 Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Delete an existing Large Person Group with specified personGroupId. Persisted data in this Large Person Group + * will be deleted. + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Retrieve the information of a Large Person Group, including its name, userData and recognitionModel. This API + * returns Large Person Group information only, use "Get Large Person Group Persons" instead to retrieve person + * information under the Large Person Group. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *     largePersonGroupId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupWithResponseAsync(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Update an existing Large Person Group's name and userData. The properties keep unchanged if they are not in + * request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroups(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List all existing Large Person Groups' largePersonGroupId, name, userData and recognitionModel. + * + * Large Person Groups are stored in alphabetical order of largePersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         largePersonGroupId: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupTrainingStatusWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroupTrainingStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * To check Large Person Group training status completed or still ongoing. Large Person Group training is an + * asynchronous operation triggered by "Train Large Person Group" API. + * + * Training time depends on the number of person entries, and their faces in a Large Person Group. It could be in + * seconds, or up to half an hour for 1,000,000 persons. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     lastSuccessfulTrainingDateTime: OffsetDateTime (Required)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return training result of a container along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupTrainingStatusWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupTrainingStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> trainLargePersonGroupWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.trainLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response trainLargePersonGroupWithResponse(String largePersonGroupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.trainLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginTrainLargePersonGroupAsync(String largePersonGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainLargePersonGroupWithResponseAsync(largePersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargePersonGroup(String largePersonGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainLargePersonGroupWithResponse(largePersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginTrainLargePersonGroupWithModelAsync(String largePersonGroupId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.trainLargePersonGroupWithResponseAsync(largePersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Submit a Large Person Group training task. Training is a crucial step that only a trained Large Person Group can + * be used by "Identify From Large Person Group". + * + * The training task is an asynchronous task. Training time depends on the number of person entries, and their faces + * in a Large Person Group. It could be in several seconds, or up to half a hour for 1,000,000 persons. To check + * training status, please use "Get Large Person Group Training Status". + * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginTrainLargePersonGroupWithModel(String largePersonGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.trainLargePersonGroupWithResponse(largePersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceCollectionTrainingResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLargePersonGroupPersonWithResponseAsync(String largePersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createLargePersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Create a new person in a specified Large Person Group. To add face to this person, please call "Add Large Person + * Group Person Face". + * + * > [!NOTE] + * > + * > * + * > * Free-tier subscription quota: + * > * 1,000 persons in all Large Person Groups. + * > * S0-tier subscription quota: + * > * 1,000,000 persons per Large Person Group. + * > * 1,000,000 Large Person Groups. + * > * 1,000,000,000 persons in all Large Person Groups. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of create person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLargePersonGroupPersonWithResponse(String largePersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createLargePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupPersonWithResponseAsync(String largePersonGroupId, + String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLargePersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, accept, requestOptions, context)); + } + + /** + * Delete an existing person from a Large Person Group. The persistedFaceId, userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLargePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonWithResponseAsync(String largePersonGroupId, + String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroupPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, accept, requestOptions, context)); + } + + /** + * Retrieve a person's name and userData, and the persisted faceIds representing the registered person face + * feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     persistedFaceIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the person in a specified large person group along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, requestOptions, Context.NONE); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupPersonWithResponseAsync(String largePersonGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.updateLargePersonGroupPerson(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, request, requestOptions, context)); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupPersonWithResponse(String largePersonGroupId, String personId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateLargePersonGroupPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, accept, request, requestOptions, Context.NONE); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonsWithResponseAsync(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLargePersonGroupPersons(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, accept, requestOptions, context)); + } + + /** + * List all persons' information in the specified Large Person Group, including personId, name, userData and + * persistedFaceIds of registered person faces. + * + * Persons are stored in alphabetical order of personId created in "Create Large Person Group Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *         persistedFaceIds (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonsWithResponse(String largePersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupPersonsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargePersonGroupPersonFaceFromUrlWithResponseAsync(String largePersonGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.addLargePersonGroupPersonFaceFromUrl(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, accept, request, requestOptions, + context)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargePersonGroupPersonFaceFromUrlWithResponse(String largePersonGroupId, + String personId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.addLargePersonGroupPersonFaceFromUrlSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, accept, request, requestOptions, + Context.NONE); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> addLargePersonGroupPersonFaceWithResponseAsync(String largePersonGroupId, + String personId, BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.addLargePersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a person into a Large Person Group for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until "Delete Large Person Group Person Face", "Delete Large Person + * Group Person" or "Delete Large Person Group" is called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for adding face along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response addLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.addLargePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLargePersonGroupPersonFaceWithResponseAsync(String largePersonGroupId, + String personId, String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLargePersonGroupPersonFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, persistedFaceId, accept, + requestOptions, context)); + } + + /** + * Delete a face from a person in a Large Person Group by specified largePersonGroupId, personId and + * persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLargePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLargePersonGroupPersonFaceWithResponseAsync(String largePersonGroupId, + String personId, String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getLargePersonGroupPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Retrieve person face information. The persisted person face is specified by its largePersonGroupId, personId and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for large person group person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLargePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateLargePersonGroupPersonFaceWithResponseAsync(String largePersonGroupId, + String personId, String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateLargePersonGroupPersonFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), largePersonGroupId, personId, persistedFaceId, accept, request, + requestOptions, context)); + } + + /** + * Update a person persisted face's userData field. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param largePersonGroupId ID of the container. + * @param personId ID of the person. + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateLargePersonGroupPersonFaceWithResponse(String largePersonGroupId, String personId, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateLargePersonGroupPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + largePersonGroupId, personId, persistedFaceId, accept, request, requestOptions, Context.NONE); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createPersonWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createPersonWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreatePersonAsync(BinaryData request, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createPersonWithResponseAsync(request, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreatePerson(BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createPersonWithResponse(request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreatePersonWithModelAsync(BinaryData request, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createPersonWithResponseAsync(request, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryPerson.class)); + } + + /** + * Creates a new person in a Person Directory. To add face to this person, please call Person Directory "Add Person + * Face". + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreatePersonWithModel(BinaryData request, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createPersonWithResponse(request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryPerson.class)); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deletePersonWithResponseAsync(String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deletePerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personId, accept, requestOptions, context)); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deletePersonWithResponse(String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, accept, + requestOptions, Context.NONE); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonAsync(String personId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deletePersonWithResponseAsync(personId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePerson(String personId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deletePersonWithResponse(personId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonWithModelAsync(String personId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deletePersonWithResponseAsync(personId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete an existing person from Person Directory. The persistedFaceId(s), userData, person name and face + * feature(s) in the person entry will all be deleted. + * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePersonWithModel(String personId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deletePersonWithResponse(personId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Retrieve a person's name and userData from Person Directory. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return person resource for person directory along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonWithResponseAsync(String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personId, accept, requestOptions, context)); + } + + /** + * Retrieve a person's name and userData from Person Directory. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return person resource for person directory along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonWithResponse(String personId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, accept, + requestOptions, Context.NONE); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonWithResponseAsync(String personId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updatePerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), personId, accept, request, requestOptions, context)); + } + + /** + * Update name or userData of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonWithResponse(String personId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updatePersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, accept, + request, requestOptions, Context.NONE); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersons(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List all persons' information in Person Directory, including personId, name, and userData. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         personId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, requestOptions, + Context.NONE); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group of person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupReferencesWithResponseAsync(String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDynamicPersonGroupReferences(this.getEndpoint(), + this.getServiceVersion().getVersion(), personId, accept, requestOptions, context)); + } + + /** + * List all Dynamic Person Groups a person has been referenced by in Person Directory. + * + * Dynamic Person Groups are stored in alphabetical order of Dynamic Person Group ID created in Person Directory + * "Create Dynamic Person Group". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group of person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupReferencesWithResponse(String personId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDynamicPersonGroupReferencesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + personId, accept, requestOptions, Context.NONE); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addPersonFaceFromUrlWithResponseAsync(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.addPersonFaceFromUrl(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, accept, request, requestOptions, context)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addPersonFaceFromUrlWithResponse(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.addPersonFaceFromUrlSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, accept, request, requestOptions, Context.NONE); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceFromUrlAsync(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.addPersonFaceFromUrlWithResponseAsync(personId, recognitionModel, request, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceFromUrl(String personId, String recognitionModel, + BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.addPersonFaceFromUrlWithResponse(personId, recognitionModel, request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceFromUrlWithModelAsync(String personId, + String recognitionModel, BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.addPersonFaceFromUrlWithResponseAsync(personId, recognitionModel, request, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryFace.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceFromUrlWithModel(String personId, + String recognitionModel, BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.addPersonFaceFromUrlWithResponse(personId, recognitionModel, request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryFace.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> addPersonFaceWithResponseAsync(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personId, recognitionModel, contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return long running operation resource for person directory along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response addPersonFaceWithResponse(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.addPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, contentType, accept, imageContent, requestOptions, Context.NONE); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceAsync(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.addPersonFaceWithResponseAsync(personId, recognitionModel, imageContent, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFace(String personId, String recognitionModel, + BinaryData imageContent, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.addPersonFaceWithResponse(personId, recognitionModel, imageContent, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginAddPersonFaceWithModelAsync(String personId, + String recognitionModel, BinaryData imageContent, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.addPersonFaceWithResponseAsync(personId, recognitionModel, imageContent, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryFace.class)); + } + + /** + * Add a face to a person (see Person Directory "Create Person") for face identification or verification. + * + * To deal with an image containing multiple faces, input face can be specified as an image with a targetFace + * rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted + * face feature(s) will be stored on server until Person Directory "Delete Person Face" or "Delete Person" is + * called. + * + * Note that persistedFaceId is different from faceId generated by "Detect". + * > + * * + * * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, + * clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * * Each person entry can hold up to 248 faces. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the + * provided "targetFace" rectangle is not returned from "Detect", there's no guarantee to detect and add the face + * successfully. + * * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause + * failures. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * + * * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * * This is a long running operation. Use Response Header "Operation-Location" to determine when the AddFace + * operation has successfully propagated for future requests to "Identify". For further information about + * Operation-Locations see "Get Face Operation Status". + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
targetFaceList<Integer>NoA face rectangle to specify the target face to + * be added to a person, in the format of 'targetFace=left,top,width,height'. In the form of "," separated + * string.
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
userDataStringNoUser-provided data attached to the face. The size limit is + * 1K.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     operationId: String (Required)
+     *     status: String(notStarted/running/succeeded/failed) (Required)
+     *     createdTime: OffsetDateTime (Required)
+     *     lastActionTime: OffsetDateTime (Optional)
+     *     finishedTime: OffsetDateTime (Optional)
+     *     message: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param imageContent The image to be analyzed. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long running operation resource for person directory. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginAddPersonFaceWithModel(String personId, + String recognitionModel, BinaryData imageContent, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.addPersonFaceWithResponse(personId, recognitionModel, imageContent, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(PersonDirectoryFace.class)); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deletePersonFaceWithResponseAsync(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.deletePersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personId, recognitionModel, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deletePersonFaceWithResponse(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deletePersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonFaceAsync(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deletePersonFaceWithResponseAsync(personId, recognitionModel, persistedFaceId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePersonFace(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deletePersonFaceWithResponse(personId, recognitionModel, persistedFaceId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeletePersonFaceWithModelAsync(String personId, + String recognitionModel, String persistedFaceId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deletePersonFaceWithResponseAsync(personId, recognitionModel, persistedFaceId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete a face from a person in Person Directory by specified personId and persistedFaceId. + * + * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from + * different persons are processed in parallel. + * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeletePersonFaceWithModel(String personId, + String recognitionModel, String persistedFaceId, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deletePersonFaceWithResponse(personId, recognitionModel, persistedFaceId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person directory person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonFaceWithResponseAsync(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getPersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personId, recognitionModel, persistedFaceId, accept, requestOptions, context)); + } + + /** + * Retrieve person face information. The persisted person face is specified by its personId. recognitionModel, and + * persistedFaceId. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     persistedFaceId: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return face resource for person directory person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonFaceWithResponse(String personId, String recognitionModel, + String persistedFaceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, persistedFaceId, accept, requestOptions, Context.NONE); + } + + /** + * Update a persisted face's userData field of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updatePersonFaceWithResponseAsync(String personId, String recognitionModel, + String persistedFaceId, BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updatePersonFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + personId, recognitionModel, persistedFaceId, accept, request, requestOptions, context)); + } + + /** + * Update a persisted face's userData field of a person. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param persistedFaceId Face ID of the face. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updatePersonFaceWithResponse(String personId, String recognitionModel, String persistedFaceId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updatePersonFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, persistedFaceId, accept, request, requestOptions, Context.NONE); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     persistedFaceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list face of person along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getPersonFacesWithResponseAsync(String personId, String recognitionModel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getPersonFaces(this.getEndpoint(), + this.getServiceVersion().getVersion(), personId, recognitionModel, accept, requestOptions, context)); + } + + /** + * Retrieve a person's persistedFaceIds representing the registered person face feature(s). + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personId: String (Required)
+     *     persistedFaceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param personId Person ID of the person. + * @param recognitionModel The 'recognitionModel' associated with faces. Allowed values: "recognition_01", + * "recognition_02", "recognition_03", "recognition_04". + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list face of person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPersonFacesWithResponse(String personId, String recognitionModel, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getPersonFacesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), personId, + recognitionModel, accept, requestOptions, Context.NONE); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createDynamicPersonGroupWithPersonWithResponseAsync(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createDynamicPersonGroupWithPerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createDynamicPersonGroupWithPersonWithResponse(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createDynamicPersonGroupWithPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateDynamicPersonGroupWithPersonAsync(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createDynamicPersonGroupWithPersonWithResponseAsync(dynamicPersonGroupId, request, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateDynamicPersonGroupWithPerson(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createDynamicPersonGroupWithPersonWithResponse(dynamicPersonGroupId, request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateDynamicPersonGroupWithPersonWithModelAsync( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createDynamicPersonGroupWithPersonWithResponseAsync(dynamicPersonGroupId, request, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(DynamicPersonGroup.class)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     *     addPersonIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateDynamicPersonGroupWithPersonWithModel( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createDynamicPersonGroupWithPersonWithResponse(dynamicPersonGroupId, request, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), + TypeReference.createInstance(DynamicPersonGroup.class)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDynamicPersonGroupWithResponseAsync(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createDynamicPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Creates a new Dynamic Person Group with specified dynamicPersonGroupId, name, and user-provided userData. + * + * A Dynamic Person Group is a container that references Person Directory "Create Person". After creation, use + * Person Directory "Update Dynamic Person Group" to add/remove persons to/from the Dynamic Person Group. + * + * Dynamic Person Group and user data will be stored on server until Person Directory "Delete Dynamic Person Group" + * is called. Use "Identify From Dynamic Person Group" with the dynamicPersonGroupId parameter to identify against + * persons. + * + * No image will be stored. Only the person's extracted face feature(s) and userData will be stored on server until + * Person Directory "Delete Person" or "Delete Person Face" is called. + * + * 'recognitionModel' does not need to be specified with Dynamic Person Groups. Dynamic Person Groups are references + * to Person Directory "Create Person" and therefore work with most all 'recognitionModels'. The faceId's provided + * during "Identify" determine the 'recognitionModel' used. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createDynamicPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteDynamicPersonGroupWithResponseAsync(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDynamicPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, requestOptions, context)); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteDynamicPersonGroupWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteDynamicPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteDynamicPersonGroupAsync(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDynamicPersonGroupWithResponseAsync(dynamicPersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDynamicPersonGroup(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDynamicPersonGroupWithResponse(dynamicPersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux + beginDeleteDynamicPersonGroupWithModelAsync(String dynamicPersonGroupId, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteDynamicPersonGroupWithResponseAsync(dynamicPersonGroupId, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Deletes an existing Dynamic Person Group with specified dynamicPersonGroupId. + * + * Deleting this Dynamic Person Group only delete the references to persons data. To delete actual person see Person + * Directory "Delete Person". + * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteDynamicPersonGroupWithModel(String dynamicPersonGroupId, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteDynamicPersonGroupWithResponse(dynamicPersonGroupId, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a container that references Person Directory "Create Person" along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupWithResponseAsync(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDynamicPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, requestOptions, context)); + } + + /** + * Retrieve the information of a Dynamic Person Group, including its name and userData. + * + * This API returns Dynamic Person Group information only, use Person Directory "Get Dynamic Person Group Persons" + * instead to retrieve person information under the Dynamic Person Group. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     dynamicPersonGroupId: String (Required)
+     *     name: String (Required)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a container that references Person Directory "Create Person" along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDynamicPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, requestOptions, Context.NONE); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateDynamicPersonGroupWithPersonChangesWithResponseAsync(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateDynamicPersonGroupWithPersonChanges(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateDynamicPersonGroupWithPersonChangesWithResponse(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateDynamicPersonGroupWithPersonChangesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateDynamicPersonGroupWithPersonChangesAsync( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.updateDynamicPersonGroupWithPersonChangesWithResponseAsync(dynamicPersonGroupId, request, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateDynamicPersonGroupWithPersonChanges( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.updateDynamicPersonGroupWithPersonChangesWithResponse(dynamicPersonGroupId, request, + requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateDynamicPersonGroupWithPersonChangesWithModelAsync( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.updateDynamicPersonGroupWithPersonChangesWithResponseAsync(dynamicPersonGroupId, request, + requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     *     addPersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     *     removePersonIds (Optional): [
+     *         String (Optional)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateDynamicPersonGroupWithPersonChangesWithModel( + String dynamicPersonGroupId, BinaryData request, RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.updateDynamicPersonGroupWithPersonChangesWithResponse(dynamicPersonGroupId, request, + requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.getEndpoint()) + .replace("{apiVersion}", this.getServiceVersion().getVersion())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceOperationResult.class), TypeReference.createInstance(Void.class)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateDynamicPersonGroupWithResponseAsync(String dynamicPersonGroupId, + BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateDynamicPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, request, requestOptions, context)); + } + + /** + * Update the name or userData of an existing Dynamic Person Group, and manage its members by adding or removing + * persons. + * + * The properties keep unchanged if they are not in request body. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Optional)
+     *     userData: String (Optional)
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateDynamicPersonGroupWithResponse(String dynamicPersonGroupId, BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.updateDynamicPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, request, requestOptions, Context.NONE); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         dynamicPersonGroupId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDynamicPersonGroups(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * List all existing Dynamic Person Groups by dynamicPersonGroupId along with name and userData. + * + * Dynamic Person Groups are stored in alphabetical order of dynamicPersonGroupId. + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         dynamicPersonGroupId: String (Required)
+     *         name: String (Required)
+     *         userData: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDynamicPersonGroupsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group person along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDynamicPersonGroupPersonsWithResponseAsync(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getDynamicPersonGroupPersons(this.getEndpoint(), + this.getServiceVersion().getVersion(), dynamicPersonGroupId, accept, requestOptions, context)); + } + + /** + * List all persons in the specified Dynamic Person Group. + * + * Persons are stored in alphabetical order of personId created in Person Directory "Create Person". + * > + * * + * * "start" parameter (string, optional) specifies an ID value from which returned entries will have larger IDs + * based on string comparison. Setting "start" to an empty value indicates that entries should be returned starting + * from the first item. + * * "top" parameter (int, optional) determines the maximum number of entries to be returned, with a limit of up to + * 1000 entries per call. To retrieve additional entries beyond this limit, specify "start" with the personId of the + * last entry returned in the current call. + * + * > [!TIP] + * > + * > * For example, there are total 5 items with their IDs: "itemId1", ..., "itemId5". + * > * "start=&top=" will return all 5 items. + * > * "start=&top=2" will return "itemId1", "itemId2". + * > * "start=itemId2&top=3" will return "itemId3", "itemId4", "itemId5". + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param dynamicPersonGroupId ID of the dynamic person group. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of list dynamic person group person along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDynamicPersonGroupPersonsWithResponse(String dynamicPersonGroupId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getDynamicPersonGroupPersonsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + dynamicPersonGroupId, accept, requestOptions, Context.NONE); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java new file mode 100644 index 0000000000000..aa84a731ad451 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceClientImpl.java @@ -0,0 +1,2483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the FaceClient type. + */ +public final class FaceClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FaceClientService service; + + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of FaceClient client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceClientImpl(String endpoint, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceClientImpl(HttpPipeline httpPipeline, String endpoint, FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(FaceClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for FaceClient to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}/face/{apiVersion}") + @ServiceInterface(name = "FaceClient") + public interface FaceClientService { + @Post("/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detectFromUrl(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectFromUrlSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData request, + RequestOptions requestOptions, Context context); + + @Post("/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> detect(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/detect") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response detectSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, @BodyParam("application/octet-stream") BinaryData imageContent, + RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> findSimilar(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response findSimilarSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> findSimilarFromFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response findSimilarFromFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> findSimilarFromLargeFaceList(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/findsimilars") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response findSimilarFromLargeFaceListSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> identifyFromPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response identifyFromPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> identifyFromLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response identifyFromLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> identifyFromPersonDirectory(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response identifyFromPersonDirectorySync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> identifyFromDynamicPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/identify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response identifyFromDynamicPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> verifyFaceToFace(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response verifyFaceToFaceSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> verifyFromPersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response verifyFromPersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> verifyFromLargePersonGroup(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response verifyFromLargePersonGroupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> verifyFromPersonDirectory(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/verify") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response verifyFromPersonDirectorySync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/group") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> group(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + + @Post("/group") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response groupSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData request, RequestOptions requestOptions, Context context); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectFromUrlWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detectFromUrl(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, request, requestOptions, context)); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     url: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectFromUrlWithResponse(BinaryData request, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.detectFromUrlSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + request, requestOptions, Context.NONE); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param imageContent The input image binary. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> detectWithResponseAsync(BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.detect(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, imageContent, requestOptions, context)); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * > [!IMPORTANT] + * > To mitigate potential misuse that can subject people to stereotyping, discrimination, or unfair denial of + * services, we are retiring Face API attributes that predict emotion, gender, age, smile, facial hair, hair, and + * makeup. Read more about this decision + * https://azure.microsoft.com/blog/responsible-ai-investments-and-safeguards-for-facial-recognition/. + * + * * + * * No image will be stored. Only the extracted face feature(s) will be stored on server. The faceId is an + * identifier of the face feature and will be used in "Identify", "Verify", and "Find Similar". The stored face + * features will expire and be deleted at the time specified by faceIdTimeToLive after the original detection call. + * * Optional parameters include faceId, landmarks, and attributes. Attributes include headPose, glasses, occlusion, + * accessories, blur, exposure, noise, mask, and qualityForRecognition. Some of the results returned for specific + * attributes may not be highly accurate. + * * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. + * * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with + * dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. + * * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. + * * For optimal results when querying "Identify", "Verify", and "Find Similar" ('returnFaceId' is true), please use + * faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). + * * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer + * to https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-detection-model + * * 'detection_02': Face attributes and landmarks are disabled if you choose this detection model. + * * 'detection_03': Face attributes (mask and headPose only) and landmarks are supported if you choose this + * detection model. + * * Different 'recognitionModel' values are provided. If follow-up operations like "Verify", "Identify", "Find + * Similar" are needed, please specify the recognition model with 'recognitionModel' parameter. The default value + * for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need + * in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. + * More details, please refer to + * https://learn.microsoft.com/azure/ai-services/computer-vision/how-to/specify-recognition-model. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
detectionModelStringNoThe 'detectionModel' associated with the detected + * faceIds. Supported 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default + * value is 'detection_01'. Allowed values: "detection_01", "detection_02", "detection_03".
recognitionModelStringNoThe 'recognitionModel' associated with the detected + * faceIds. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02', 'recognition_03' or + * 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is + * improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared + * with 'recognition_01' and 'recognition_02'. Allowed values: "recognition_01", "recognition_02", "recognition_03", + * "recognition_04".
returnFaceIdBooleanNoReturn faceIds of the detected faces or not. The default + * value is true.
returnFaceAttributesList<String>NoAnalyze and return the one or more + * specified face attributes in the comma-separated string like 'returnFaceAttributes=headPose,glasses'. Face + * attribute analysis has additional computational and time cost. In the form of "," separated string.
returnFaceLandmarksBooleanNoReturn face landmarks of the detected faces or + * not. The default value is false.
returnRecognitionModelBooleanNoReturn 'recognitionModel' or not. The default + * value is false. This is only applicable when returnFaceId = true.
faceIdTimeToLiveIntegerNoThe number of seconds for the face ID being cached. + * Supported range from 60 seconds up to 86400 seconds. The default value is 86400 (24 hours).
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
{@code
+     * BinaryData
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Optional)
+     *         recognitionModel: String(recognition_01/recognition_02/recognition_03/recognition_04) (Optional)
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         faceLandmarks (Optional): {
+     *             pupilLeft (Required): {
+     *                 x: double (Required)
+     *                 y: double (Required)
+     *             }
+     *             pupilRight (Required): (recursive schema, see pupilRight above)
+     *             noseTip (Required): (recursive schema, see noseTip above)
+     *             mouthLeft (Required): (recursive schema, see mouthLeft above)
+     *             mouthRight (Required): (recursive schema, see mouthRight above)
+     *             eyebrowLeftOuter (Required): (recursive schema, see eyebrowLeftOuter above)
+     *             eyebrowLeftInner (Required): (recursive schema, see eyebrowLeftInner above)
+     *             eyeLeftOuter (Required): (recursive schema, see eyeLeftOuter above)
+     *             eyeLeftTop (Required): (recursive schema, see eyeLeftTop above)
+     *             eyeLeftBottom (Required): (recursive schema, see eyeLeftBottom above)
+     *             eyeLeftInner (Required): (recursive schema, see eyeLeftInner above)
+     *             eyebrowRightInner (Required): (recursive schema, see eyebrowRightInner above)
+     *             eyebrowRightOuter (Required): (recursive schema, see eyebrowRightOuter above)
+     *             eyeRightInner (Required): (recursive schema, see eyeRightInner above)
+     *             eyeRightTop (Required): (recursive schema, see eyeRightTop above)
+     *             eyeRightBottom (Required): (recursive schema, see eyeRightBottom above)
+     *             eyeRightOuter (Required): (recursive schema, see eyeRightOuter above)
+     *             noseRootLeft (Required): (recursive schema, see noseRootLeft above)
+     *             noseRootRight (Required): (recursive schema, see noseRootRight above)
+     *             noseLeftAlarTop (Required): (recursive schema, see noseLeftAlarTop above)
+     *             noseRightAlarTop (Required): (recursive schema, see noseRightAlarTop above)
+     *             noseLeftAlarOutTip (Required): (recursive schema, see noseLeftAlarOutTip above)
+     *             noseRightAlarOutTip (Required): (recursive schema, see noseRightAlarOutTip above)
+     *             upperLipTop (Required): (recursive schema, see upperLipTop above)
+     *             upperLipBottom (Required): (recursive schema, see upperLipBottom above)
+     *             underLipTop (Required): (recursive schema, see underLipTop above)
+     *             underLipBottom (Required): (recursive schema, see underLipBottom above)
+     *         }
+     *         faceAttributes (Optional): {
+     *             age: Double (Optional)
+     *             smile: Double (Optional)
+     *             facialHair (Optional): {
+     *                 moustache: double (Required)
+     *                 beard: double (Required)
+     *                 sideburns: double (Required)
+     *             }
+     *             glasses: String(noGlasses/readingGlasses/sunglasses/swimmingGoggles) (Optional)
+     *             headPose (Optional): {
+     *                 pitch: double (Required)
+     *                 roll: double (Required)
+     *                 yaw: double (Required)
+     *             }
+     *             hair (Optional): {
+     *                 bald: double (Required)
+     *                 invisible: boolean (Required)
+     *                 hairColor (Required): [
+     *                      (Required){
+     *                         color: String(unknown/white/gray/blond/brown/red/black/other) (Required)
+     *                         confidence: double (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             occlusion (Optional): {
+     *                 foreheadOccluded: boolean (Required)
+     *                 eyeOccluded: boolean (Required)
+     *                 mouthOccluded: boolean (Required)
+     *             }
+     *             accessories (Optional): [
+     *                  (Optional){
+     *                     type: String(headwear/glasses/mask) (Required)
+     *                     confidence: double (Required)
+     *                 }
+     *             ]
+     *             blur (Optional): {
+     *                 blurLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             exposure (Optional): {
+     *                 exposureLevel: String(underExposure/goodExposure/overExposure) (Required)
+     *                 value: double (Required)
+     *             }
+     *             noise (Optional): {
+     *                 noiseLevel: String(low/medium/high) (Required)
+     *                 value: double (Required)
+     *             }
+     *             mask (Optional): {
+     *                 noseAndMouthCovered: boolean (Required)
+     *                 type: String(faceMask/noMask/otherMaskOrOcclusion/uncertain) (Required)
+     *             }
+     *             qualityForRecognition: String(low/medium/high) (Optional)
+     *         }
+     *     }
+     * ]
+     * }
+ * + * @param imageContent The input image binary. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response detectWithResponse(BinaryData imageContent, RequestOptions requestOptions) { + final String contentType = "application/octet-stream"; + final String accept = "application/json"; + return service.detectSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + imageContent, requestOptions, Context.NONE); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.findSimilar(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target faceId array. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.findSimilarSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromFaceListWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.findSimilarFromFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Face List. A 'faceListId' is created by + * Create Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarFromFaceListWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.findSimilarFromFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> findSimilarFromLargeFaceListWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.findSimilarFromLargeFaceList(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Given query face's faceId, to search the similar-looking faces from a Large Face List. A 'largeFaceListId' is + * created by Create Large Face List. + * + * Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. + * + * Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it + * tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find + * a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. + * "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is + * low. It can be used in the cases like searching celebrity-looking faces. + * + * The 'recognitionModel' associated with the query faceId should be the same as the 'recognitionModel' used by the + * target Large Face List. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     largeFaceListId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         confidence: double (Required)
+     *         faceId: String (Optional)
+     *         persistedFaceId: String (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response findSimilarFromLargeFaceListWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.findSimilarFromLargeFaceListSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, request, requestOptions, Context.NONE); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonGroupWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.identifyFromPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Group (given by personGroupId), and return candidate person(s) for that face ranked by + * similarity confidence. The Person Group should be trained to make it ready for identification. See more in "Train + * Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromPersonGroupWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.identifyFromPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     largePersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromLargePersonGroupWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.identifyFromLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Large Person Group (given by largePersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. The Large Person Group should be trained to make it ready for identification. + * See more in "Train Large Person Group". + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * Try "Find Similar" when you need to find similar faces from a Face List/Large Face List instead of a + * Person Group/Large Person Group. + * > * The 'recognitionModel' associated with the query faces' faceIds should be the same as the + * 'recognitionModel' used by the target Person Group or Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     largePersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.identifyFromLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, request, requestOptions, Context.NONE); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromPersonDirectoryWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.identifyFromPersonDirectory(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a person directory + * personIds array. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Person Directory Persons (given by personIds), and return candidate person(s) for that face ranked + * by similarity confidence. + * Passing personIds with an array with one element "*" can perform the operation over entire person directory. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     personIds (Required): [
+     *         String (Required)
+     *     ]
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.identifyFromPersonDirectorySync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, request, requestOptions, Context.NONE); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     dynamicPersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> identifyFromDynamicPersonGroupWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.identifyFromDynamicPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Dynamic Person + * Group. + * + * For each face in the faceIds array, Face Identify will compute similarities between the query face and all the + * faces in the Dynamic Person Group (given by dynamicPersonGroupId), and return candidate person(s) for that face + * ranked by similarity confidence. + * > [!NOTE] + * > + * > * + * > * The algorithm allows more than one face to be identified independently at the same request, but no more + * than 10 faces. + * > * Each person could have more than one face, but no more than 248 faces. + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no + * person is identified, the returned candidates will be an empty array. + * > * The Identify operation can only match faces obtained with the same recognition model, that is associated + * with the query faces. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     *     dynamicPersonGroupId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     confidenceThreshold: Double (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         faceId: String (Required)
+     *         candidates (Required): [
+     *              (Required){
+     *                 personId: String (Required)
+     *                 confidence: double (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response identifyFromDynamicPersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.identifyFromDynamicPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, request, requestOptions, Context.NONE); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId1: String (Required)
+     *     faceId2: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFaceToFaceWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verifyFaceToFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Verify whether two faces belong to a same person. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the both faces should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId1: String (Required)
+     *     faceId2: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFaceToFaceWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.verifyFaceToFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromPersonGroupWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verifyFromPersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Verify whether a face belongs to a person in a Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromPersonGroupWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.verifyFromPersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     largePersonGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromLargePersonGroupWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verifyFromLargePersonGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The 'recognitionModel' associated with the query face should be the same as the 'recognitionModel' used by + * the Large Person Group. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     largePersonGroupId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromLargePersonGroupWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.verifyFromLargePersonGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> verifyFromPersonDirectoryWithResponseAsync(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.verifyFromPersonDirectory(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, request, requestOptions, context)); + } + + /** + * Verify whether a face belongs to a person in Person Directory. + * + * > [!NOTE] + * > + * > * + * > * Higher face image quality means better identification precision. Please consider high-quality faces: + * frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. + * > * For the scenarios that are sensitive to accuracy please make your own judgment. + * > * The Verify operation can only match faces obtained with the same recognition model, that is associated + * with the query face. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceId: String (Required)
+     *     personId: String (Required)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return verify result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response verifyFromPersonDirectoryWithResponse(BinaryData request, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.verifyFromPersonDirectorySync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + request, requestOptions, Context.NONE); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for group face operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> groupWithResponseAsync(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.group(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, request, requestOptions, context)); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * > + * * + * * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have + * similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice + * that faces belonging to a same person might be split into several groups in the result. + * * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original + * faces. The messyGroup will not appear in the result if all faces found their counterparts. + * * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try "Verify Face To Face" when you + * only have 2 candidate faces. + * * The 'recognitionModel' associated with the query faces' faceIds should be the same. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+ * + * @param request The request parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response body for group face operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response groupWithResponse(BinaryData request, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.groupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, request, + requestOptions, Context.NONE); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java new file mode 100644 index 0000000000000..624cd30d6f2d4 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java @@ -0,0 +1,1668 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.ai.vision.face.FaceServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the FaceSessionClient type. + */ +public final class FaceSessionClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final FaceSessionClientService service; + + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public FaceServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of FaceSessionClient client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceSessionClientImpl(String endpoint, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceSessionClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceSessionClientImpl(HttpPipeline httpPipeline, String endpoint, FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of FaceSessionClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param serviceVersion Service version. + */ + public FaceSessionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(FaceSessionClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for FaceSessionClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}/face/{apiVersion}") + @ServiceInterface(name = "FaceSessionClient") + public interface FaceSessionClientService { + @Post("/detectLiveness/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLivenessSession(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createLivenessSessionContent, RequestOptions requestOptions, + Context context); + + @Post("/detectLiveness/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLivenessSessionSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createLivenessSessionContent, RequestOptions requestOptions, + Context context); + + @Delete("/detectLiveness/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLivenessSession(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/detectLiveness/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLivenessSessionSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessSessionResult(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessSessionResultSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessSessions(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessSessionsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions/{sessionId}/audit") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessSessionAuditEntries(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLiveness/singleModal/sessions/{sessionId}/audit") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessSessionAuditEntriesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLivenessWithVerifySession(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createLivenessSessionContent, RequestOptions requestOptions, + Context context); + + @Post("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLivenessWithVerifySessionSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData createLivenessSessionContent, RequestOptions requestOptions, + Context context); + + // @Multipart not supported by RestProxy + @Post("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createLivenessWithVerifySessionWithVerifyImage( + @HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData createLivenessWithVerifySessionContent, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createLivenessWithVerifySessionWithVerifyImageSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("accept") String accept, + @BodyParam("multipart/form-data") BinaryData createLivenessWithVerifySessionContent, + RequestOptions requestOptions, Context context); + + @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteLivenessWithVerifySession(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteLivenessWithVerifySessionSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessWithVerifySessionResult(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessWithVerifySessionResultSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessWithVerifySessions(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessWithVerifySessionsSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @HeaderParam("accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getLivenessWithVerifySessionAuditEntries(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}/audit") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getLivenessWithVerifySessionAuditEntriesSync(@HostParam("endpoint") String endpoint, + @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, + @HeaderParam("accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session creation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLivenessSessionWithResponseAsync(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createLivenessSession(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, createLivenessSessionContent, requestOptions, context)); + } + + /** + * Create a new detect liveness session. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLiveness/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > Client access can be revoked by deleting the session using the Delete Liveness Session operation. To + * retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your + * resource, use the List Liveness Session Audit Entries. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session creation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLivenessSessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createLivenessSessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + createLivenessSessionContent, requestOptions, Context.NONE); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLivenessSessionWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLivenessSession(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLivenessSessionWithResponse(String sessionId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLivenessSessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), sessionId, + accept, requestOptions, Context.NONE); + } + + /** + * Get session result of detectLiveness/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLiveness/singleModal call along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionResultWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessSessionResult(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Get session result of detectLiveness/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLiveness/singleModal call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionResultWithResponse(String sessionId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessSessionResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + sessionId, accept, requestOptions, Context.NONE); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessSessions(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Lists sessions for /detectLiveness/SingleModal. + * + * List sessions from the last sessionId greater than the 'start'. + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessSessionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessSessionAuditEntriesWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessSessionAuditEntries(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessSessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessSessionAuditEntriesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + sessionId, accept, requestOptions, Context.NONE); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLivenessWithVerifySessionWithResponseAsync( + BinaryData createLivenessSessionContent, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createLivenessWithVerifySession(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, createLivenessSessionContent, requestOptions, context)); + } + + /** + * Create a new liveness session with verify. Client device submits VerifyImage during the + * /detectLivenessWithVerify/singleModal call. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Alternative Option: Client device submits VerifyImage during the /detectLivenessWithVerify/singleModal call. + * > [!NOTE] + * > Extra measures should be taken to validate that the client is sending the expected VerifyImage. + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     livenessOperationMode: String(Passive) (Required)
+     *     sendResultsToClient: Boolean (Optional)
+     *     deviceCorrelationIdSetInClient: Boolean (Optional)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessSessionContent Request for creating liveness session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLivenessWithVerifySessionWithResponse(BinaryData createLivenessSessionContent, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.createLivenessWithVerifySessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, createLivenessSessionContent, requestOptions, Context.NONE); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createLivenessWithVerifySessionWithVerifyImageWithResponseAsync( + BinaryData createLivenessWithVerifySessionContent, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createLivenessWithVerifySessionWithVerifyImage(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, createLivenessWithVerifySessionContent, + requestOptions, context)); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * A session is best for client device scenarios where developers want to authorize a client device to perform only + * a liveness detection without granting full access to their resource. Created sessions have a limited life span + * and only authorize clients to perform the desired action before access is expired. + * + * Permissions includes... + * > + * * + * * Ability to call /detectLivenessWithVerify/singleModal for up to 3 retries. + * * A token lifetime of 10 minutes. + * + * > [!NOTE] + * > + * > * + * > * Client access can be revoked by deleting the session using the Delete Liveness With Verify Session + * operation. + * > * To retrieve a result, use the Get Liveness With Verify Session. + * > * To audit the individual requests that a client has made to your resource, use the List Liveness With + * Verify Session Audit Entries. + * + * Recommended Option: VerifyImage is provided during session creation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     verifyImage (Optional): {
+     *         faceRectangle (Required): {
+     *             top: int (Required)
+     *             left: int (Required)
+     *             width: int (Required)
+     *             height: int (Required)
+     *         }
+     *         qualityForRecognition: String(low/medium/high) (Required)
+     *     }
+     * }
+     * }
+ * + * @param createLivenessWithVerifySessionContent Request of liveness with verify session creation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return response of liveness session with verify creation with verify image provided along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createLivenessWithVerifySessionWithVerifyImageWithResponse( + BinaryData createLivenessWithVerifySessionContent, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.createLivenessWithVerifySessionWithVerifyImageSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, createLivenessWithVerifySessionContent, + requestOptions, Context.NONE); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteLivenessWithVerifySessionWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteLivenessWithVerifySession(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Delete all session related information for matching the specified session id. + * + * > [!NOTE] + * > Deleting a session deactivates the Session Auth Token by blocking future API calls made with that Auth + * Token. While this can be used to remove any access for that token, those requests will still count towards + * overall resource rate limits. It's best to leverage TokenTTL to limit length of tokens in the case that it is + * misused. + * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteLivenessWithVerifySessionWithResponse(String sessionId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.deleteLivenessWithVerifySessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + sessionId, accept, requestOptions, Context.NONE); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionResultWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessWithVerifySessionResult(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Get session result of detectLivenessWithVerify/singleModal call. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     id: String (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     sessionStartDateTime: OffsetDateTime (Optional)
+     *     sessionExpired: boolean (Required)
+     *     deviceCorrelationId: String (Optional)
+     *     authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     status: String(NotStarted/Started/ResultAvailable) (Required)
+     *     result (Optional): {
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * }
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session result of detectLivenessWithVerify/singleModal call along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessWithVerifySessionResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + sessionId, accept, requestOptions, Context.NONE); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionsWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessWithVerifySessions(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Lists sessions for /detectLivenessWithVerify/SingleModal. + * + * List sessions from the last sessionId greater than the "start". + * + * The result should be ordered by sessionId in ascending order. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: String (Required)
+     *         createdDateTime: OffsetDateTime (Required)
+     *         sessionStartDateTime: OffsetDateTime (Optional)
+     *         sessionExpired: boolean (Required)
+     *         deviceCorrelationId: String (Optional)
+     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     *     }
+     * ]
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionsWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessWithVerifySessionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLivenessWithVerifySessionAuditEntriesWithResponseAsync(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getLivenessWithVerifySessionAuditEntries(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); + } + + /** + * Gets session requests and response body for the session. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
startStringNoList resources greater than the "start". It contains no more than + * 64 characters. Default is empty.
topIntegerNoThe number of items to list, ranging in [1, 1000]. Default is + * 1000.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
{@code
+     * [
+     *      (Required){
+     *         id: long (Required)
+     *         sessionId: String (Required)
+     *         requestId: String (Required)
+     *         clientRequestId: String (Required)
+     *         receivedDateTime: OffsetDateTime (Required)
+     *         request (Required): {
+     *             url: String (Required)
+     *             method: String (Required)
+     *             contentLength: Long (Optional)
+     *             contentType: String (Required)
+     *             userAgent: String (Optional)
+     *         }
+     *         response (Required): {
+     *             body (Required): {
+     *                 livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                 target (Optional): {
+     *                     faceRectangle (Required): {
+     *                         top: int (Required)
+     *                         left: int (Required)
+     *                         width: int (Required)
+     *                         height: int (Required)
+     *                     }
+     *                     fileName: String (Required)
+     *                     timeOffsetWithinFile: int (Required)
+     *                     imageType: String(Color/Infrared/Depth) (Required)
+     *                 }
+     *                 modelVersionUsed: String(2020-02-15-preview.01/2021-11-12-preview.03/2022-10-15-preview.04/2023-03-02-preview.05) (Optional)
+     *                 verifyResult (Optional): {
+     *                     verifyImage (Required): {
+     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                     }
+     *                     matchConfidence: double (Required)
+     *                     isIdentical: boolean (Required)
+     *                 }
+     *                  (Optional): {
+     *                     String: Object (Required)
+     *                 }
+     *             }
+     *             statusCode: int (Required)
+     *             latencyInMilliseconds: long (Required)
+     *         }
+     *         digest: String (Required)
+     *     }
+     * ]
+     * }
+ * + * @param sessionId The unique ID to reference this session. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return session requests and response body for the session along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLivenessWithVerifySessionAuditEntriesWithResponse(String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getLivenessWithVerifySessionAuditEntriesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, Context.NONE); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/MultipartFormDataHelper.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/MultipartFormDataHelper.java new file mode 100644 index 0000000000000..afa7b734cb08c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/MultipartFormDataHelper.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.UUID; + +// DO NOT modify this helper class + +public final class MultipartFormDataHelper { + /** + * Line separator for the multipart HTTP request. + */ + private static final String CRLF = "\r\n"; + + private static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + + /** + * Value to be used as part of the divider for the multipart requests. + */ + private final String boundary; + + /** + * The actual part separator in the request. This is obtained by prepending "--" to the "boundary". + */ + private final String partSeparator; + + /** + * The marker for the ending of a multipart request. This is obtained by post-pending "--" to the "partSeparator". + */ + private final String endMarker; + + /** + * Charset used for encoding the multipart HTTP request. + */ + private final Charset encoderCharset = StandardCharsets.UTF_8; + + private InputStream requestDataStream = new ByteArrayInputStream(new byte[0]); + private long requestLength = 0; + + private RequestOptions requestOptions; + private BinaryData requestBody; + + /** + * Default constructor used in the code. The boundary is a random value. + * + * @param requestOptions the RequestOptions to update + */ + public MultipartFormDataHelper(RequestOptions requestOptions) { + this(requestOptions, UUID.randomUUID().toString().substring(0, 16)); + } + + private MultipartFormDataHelper(RequestOptions requestOptions, String boundary) { + this.requestOptions = requestOptions; + this.boundary = boundary; + this.partSeparator = "--" + boundary; + this.endMarker = this.partSeparator + "--"; + } + + /** + * Gets the multipart HTTP request body. + * + * @return the BinaryData of the multipart HTTP request body + */ + public BinaryData getRequestBody() { + return requestBody; + } + + // text/plain + /** + * Formats a text/plain field for a multipart HTTP request. + * + * @param fieldName the field name + * @param value the value of the text/plain field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeTextField(String fieldName, String value) { + if (value != null) { + String serialized = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + + "\"" + CRLF + CRLF + value + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + // application/json + /** + * Formats a application/json field for a multipart HTTP request. + * + * @param fieldName the field name + * @param jsonObject the object of the application/json field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeJsonField(String fieldName, Object jsonObject) { + if (jsonObject != null) { + String serialized + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + CRLF + + "Content-Type: application/json" + CRLF + CRLF + BinaryData.fromObject(jsonObject) + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + /** + * Formats a file field for a multipart HTTP request. + * + * @param fieldName the field name + * @param file the BinaryData of the file + * @param contentType the content-type of the file + * @param filename the filename + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileField(String fieldName, BinaryData file, String contentType, + String filename) { + if (file != null) { + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + writeFileField(fieldName, file, contentType, filename); + } + return this; + } + + /** + * Formats a file field (potentially multiple files) for a multipart HTTP request. + * + * @param fieldName the field name + * @param files the List of BinaryData of the files + * @param contentTypes the List of content-type of the files + * @param filenames the List of filenames + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileFields(String fieldName, List files, + List contentTypes, List filenames) { + if (files != null) { + for (int i = 0; i < files.size(); ++i) { + BinaryData file = files.get(i); + String contentType = contentTypes.get(i); + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + String filename = filenames.get(i); + writeFileField(fieldName, file, contentType, filename); + } + } + return this; + } + + /** + * Ends the serialization of the multipart HTTP request. + * + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper end() { + byte[] data = endMarker.getBytes(encoderCharset); + appendBytes(data); + + requestBody = BinaryData.fromStream(requestDataStream, requestLength); + + requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "multipart/form-data; boundary=" + this.boundary) + .setHeader(HttpHeaderName.CONTENT_LENGTH, String.valueOf(requestLength)); + + return this; + } + + private void writeFileField(String fieldName, BinaryData file, String contentType, String filename) { + String contentDispositionFilename = ""; + if (!CoreUtils.isNullOrEmpty(filename)) { + contentDispositionFilename = "; filename=\"" + escapeName(filename) + "\""; + } + + // Multipart preamble + String fileFieldPreamble + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + + contentDispositionFilename + CRLF + "Content-Type: " + contentType + CRLF + CRLF; + byte[] data = fileFieldPreamble.getBytes(encoderCharset); + appendBytes(data); + + // Writing the file into the request as a byte stream + requestLength += file.getLength(); + requestDataStream = new SequenceInputStream(requestDataStream, file.toStream()); + + // CRLF + data = CRLF.getBytes(encoderCharset); + appendBytes(data); + } + + private void appendBytes(byte[] bytes) { + requestLength += bytes.length; + requestDataStream = new SequenceInputStream(requestDataStream, new ByteArrayInputStream(bytes)); + } + + private static String escapeName(String name) { + return name.replace("\n", "%0A").replace("\r", "%0D").replace("\"", "%22"); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceListFaceFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceListFaceFromUrlRequest.java new file mode 100644 index 0000000000000..e8b555bb75f7a --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceListFaceFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddFaceListFaceFromUrlRequest model. + */ +@Immutable +public final class AddFaceListFaceFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of AddFaceListFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public AddFaceListFaceFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargeFaceListFaceFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargeFaceListFaceFromUrlRequest.java new file mode 100644 index 0000000000000..09ab59ef9e170 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargeFaceListFaceFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddLargeFaceListFaceFromUrlRequest model. + */ +@Immutable +public final class AddLargeFaceListFaceFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of AddLargeFaceListFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public AddLargeFaceListFaceFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargePersonGroupPersonFaceFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargePersonGroupPersonFaceFromUrlRequest.java new file mode 100644 index 0000000000000..7477407651997 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddLargePersonGroupPersonFaceFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddLargePersonGroupPersonFaceFromUrlRequest model. + */ +@Immutable +public final class AddLargePersonGroupPersonFaceFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of AddLargePersonGroupPersonFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public AddLargePersonGroupPersonFaceFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonFaceFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonFaceFromUrlRequest.java new file mode 100644 index 0000000000000..29e9105eeac1a --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonFaceFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddPersonFaceFromUrlRequest model. + */ +@Immutable +public final class AddPersonFaceFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of AddPersonFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public AddPersonFaceFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonGroupPersonFaceFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonGroupPersonFaceFromUrlRequest.java new file mode 100644 index 0000000000000..ea6fc4436add0 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddPersonGroupPersonFaceFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AddPersonGroupPersonFaceFromUrlRequest model. + */ +@Immutable +public final class AddPersonGroupPersonFaceFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of AddPersonGroupPersonFaceFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public AddPersonGroupPersonFaceFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupRequest.java new file mode 100644 index 0000000000000..f2cbf8934da03 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupRequest.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateDynamicPersonGroupRequest model. + */ +@Fluent +public final class CreateDynamicPersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of CreateDynamicPersonGroupRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreateDynamicPersonGroupRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateDynamicPersonGroupRequest object itself. + */ + @Generated + public CreateDynamicPersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupWithPersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupWithPersonRequest.java new file mode 100644 index 0000000000000..85b579bf8e4a0 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateDynamicPersonGroupWithPersonRequest.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The CreateDynamicPersonGroupWithPersonRequest model. + */ +@Fluent +public final class CreateDynamicPersonGroupWithPersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Array of personIds created by Person Directory "Create Person" to be added. + */ + @Generated + @JsonProperty(value = "addPersonIds") + private final List addPersonIds; + + /** + * Creates an instance of CreateDynamicPersonGroupWithPersonRequest class. + * + * @param name the name value to set. + * @param addPersonIds the addPersonIds value to set. + */ + @Generated + @JsonCreator + public CreateDynamicPersonGroupWithPersonRequest(@JsonProperty(value = "name") String name, + @JsonProperty(value = "addPersonIds") List addPersonIds) { + this.name = name; + this.addPersonIds = addPersonIds; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateDynamicPersonGroupWithPersonRequest object itself. + */ + @Generated + public CreateDynamicPersonGroupWithPersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the addPersonIds property: Array of personIds created by Person Directory "Create Person" to be added. + * + * @return the addPersonIds value. + */ + @Generated + public List getAddPersonIds() { + return this.addPersonIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateFaceListRequest.java new file mode 100644 index 0000000000000..6ded60c13421b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateFaceListRequest.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateFaceListRequest model. + */ +@Fluent +public final class CreateFaceListRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreateFaceListRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreateFaceListRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateFaceListRequest object itself. + */ + @Generated + public CreateFaceListRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreateFaceListRequest object itself. + */ + @Generated + public CreateFaceListRequest setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargeFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargeFaceListRequest.java new file mode 100644 index 0000000000000..c9e3ce8a16732 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargeFaceListRequest.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateLargeFaceListRequest model. + */ +@Fluent +public final class CreateLargeFaceListRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreateLargeFaceListRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreateLargeFaceListRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateLargeFaceListRequest object itself. + */ + @Generated + public CreateLargeFaceListRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreateLargeFaceListRequest object itself. + */ + @Generated + public CreateLargeFaceListRequest setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupPersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupPersonRequest.java new file mode 100644 index 0000000000000..e86ba9ecc6117 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupPersonRequest.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateLargePersonGroupPersonRequest model. + */ +@Fluent +public final class CreateLargePersonGroupPersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of CreateLargePersonGroupPersonRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreateLargePersonGroupPersonRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateLargePersonGroupPersonRequest object itself. + */ + @Generated + public CreateLargePersonGroupPersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupRequest.java new file mode 100644 index 0000000000000..9c88547efb436 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLargePersonGroupRequest.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateLargePersonGroupRequest model. + */ +@Fluent +public final class CreateLargePersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreateLargePersonGroupRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreateLargePersonGroupRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreateLargePersonGroupRequest object itself. + */ + @Generated + public CreateLargePersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreateLargePersonGroupRequest object itself. + */ + @Generated + public CreateLargePersonGroupRequest setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java new file mode 100644 index 0000000000000..4293a535bffe5 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.CreateLivenessSessionContent; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** + * Request of liveness with verify session creation. + */ +@Immutable +public final class CreateLivenessWithVerifySessionContent { + /* + * The parameters for creating session. + */ + @Generated + private final CreateLivenessSessionContent parameters; + + /* + * The image stream for verify. Content-Disposition header field for this part must have filename. + */ + @Generated + private final VerifyImageFileDetails verifyImage; + + /** + * Creates an instance of CreateLivenessWithVerifySessionContent class. + * + * @param parameters the parameters value to set. + * @param verifyImage the verifyImage value to set. + */ + @Generated + public CreateLivenessWithVerifySessionContent(CreateLivenessSessionContent parameters, + VerifyImageFileDetails verifyImage) { + this.parameters = parameters; + this.verifyImage = verifyImage; + } + + /** + * Get the parameters property: The parameters for creating session. + * + * @return the parameters value. + */ + @Generated + public CreateLivenessSessionContent getParameters() { + return this.parameters; + } + + /** + * Get the verifyImage property: The image stream for verify. Content-Disposition header field for this part must + * have filename. + * + * @return the verifyImage value. + */ + @Generated + public VerifyImageFileDetails getVerifyImage() { + return this.verifyImage; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupPersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupPersonRequest.java new file mode 100644 index 0000000000000..acd6d3bda4cf8 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupPersonRequest.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreatePersonGroupPersonRequest model. + */ +@Fluent +public final class CreatePersonGroupPersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of CreatePersonGroupPersonRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreatePersonGroupPersonRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreatePersonGroupPersonRequest object itself. + */ + @Generated + public CreatePersonGroupPersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupRequest.java new file mode 100644 index 0000000000000..539f8b9c9403b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonGroupRequest.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FaceRecognitionModel; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreatePersonGroupRequest model. + */ +@Fluent +public final class CreatePersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /** + * Creates an instance of CreatePersonGroupRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreatePersonGroupRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreatePersonGroupRequest object itself. + */ + @Generated + public CreatePersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Set the recognitionModel property: The 'recognitionModel' associated with this face list. Supported + * 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The + * default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces + * wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' + * and 'recognition_02'. + * + * @param recognitionModel the recognitionModel value to set. + * @return the CreatePersonGroupRequest object itself. + */ + @Generated + public CreatePersonGroupRequest setRecognitionModel(FaceRecognitionModel recognitionModel) { + this.recognitionModel = recognitionModel; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonRequest.java new file mode 100644 index 0000000000000..e4d2236e136ae --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreatePersonRequest.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreatePersonRequest model. + */ +@Fluent +public final class CreatePersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of CreatePersonRequest class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + public CreatePersonRequest(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the CreatePersonRequest object itself. + */ + @Generated + public CreatePersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlRequest.java new file mode 100644 index 0000000000000..b5a8bb01d6094 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlRequest.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DetectFromUrlRequest model. + */ +@Immutable +public final class DetectFromUrlRequest { + /* + * URL of input image. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /** + * Creates an instance of DetectFromUrlRequest class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public DetectFromUrlRequest(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromFaceListRequest.java new file mode 100644 index 0000000000000..79f3524e03f3c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromFaceListRequest.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The FindSimilarFromFaceListRequest model. + */ +@Fluent +public final class FindSimilarFromFaceListRequest { + /* + * faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call. + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * The number of top similar faces returned. The valid range is [1, 1000]. Default value is 20. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + */ + @Generated + @JsonProperty(value = "mode") + private FindSimilarMatchMode mode; + + /* + * An existing user-specified unique candidate Face List, created in "Create Face List". Face List contains a set of persistedFaceIds which are persisted and will never expire. + */ + @Generated + @JsonProperty(value = "faceListId") + private final String faceListId; + + /** + * Creates an instance of FindSimilarFromFaceListRequest class. + * + * @param faceId the faceId value to set. + * @param faceListId the faceListId value to set. + */ + @Generated + @JsonCreator + public FindSimilarFromFaceListRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "faceListId") String faceListId) { + this.faceId = faceId; + this.faceListId = faceListId; + } + + /** + * Get the faceId property: faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note + * that this faceId is not persisted and will expire 24 hours after the detection call. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the FindSimilarFromFaceListRequest object itself. + */ + @Generated + public FindSimilarFromFaceListRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @return the mode value. + */ + @Generated + public FindSimilarMatchMode getMode() { + return this.mode; + } + + /** + * Set the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @param mode the mode value to set. + * @return the FindSimilarFromFaceListRequest object itself. + */ + @Generated + public FindSimilarFromFaceListRequest setMode(FindSimilarMatchMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the faceListId property: An existing user-specified unique candidate Face List, created in "Create Face + * List". Face List contains a set of persistedFaceIds which are persisted and will never expire. + * + * @return the faceListId value. + */ + @Generated + public String getFaceListId() { + return this.faceListId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java new file mode 100644 index 0000000000000..ccebf5d558db1 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarFromLargeFaceListRequest.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The FindSimilarFromLargeFaceListRequest model. + */ +@Fluent +public final class FindSimilarFromLargeFaceListRequest { + /* + * faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call. + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * The number of top similar faces returned. The valid range is [1, 1000]. Default value is 20. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + */ + @Generated + @JsonProperty(value = "mode") + private FindSimilarMatchMode mode; + + /* + * An existing user-specified unique candidate Large Face List, created in "Create Large Face List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + */ + @Generated + @JsonProperty(value = "largeFaceListId") + private final String largeFaceListId; + + /** + * Creates an instance of FindSimilarFromLargeFaceListRequest class. + * + * @param faceId the faceId value to set. + * @param largeFaceListId the largeFaceListId value to set. + */ + @Generated + @JsonCreator + public FindSimilarFromLargeFaceListRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "largeFaceListId") String largeFaceListId) { + this.faceId = faceId; + this.largeFaceListId = largeFaceListId; + } + + /** + * Get the faceId property: faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note + * that this faceId is not persisted and will expire 24 hours after the detection call. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the FindSimilarFromLargeFaceListRequest object itself. + */ + @Generated + public FindSimilarFromLargeFaceListRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @return the mode value. + */ + @Generated + public FindSimilarMatchMode getMode() { + return this.mode; + } + + /** + * Set the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @param mode the mode value to set. + * @return the FindSimilarFromLargeFaceListRequest object itself. + */ + @Generated + public FindSimilarFromLargeFaceListRequest setMode(FindSimilarMatchMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the largeFaceListId property: An existing user-specified unique candidate Large Face List, created in "Create + * Large Face List". Large Face List contains a set of persistedFaceIds which are persisted and will never expire. + * + * @return the largeFaceListId value. + */ + @Generated + public String getLargeFaceListId() { + return this.largeFaceListId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarRequest.java new file mode 100644 index 0000000000000..d6d45daedc21d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/FindSimilarRequest.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.ai.vision.face.models.FindSimilarMatchMode; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The FindSimilarRequest model. + */ +@Fluent +public final class FindSimilarRequest { + /* + * faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call. + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * The number of top similar faces returned. The valid range is [1, 1000]. Default value is 20. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is 'matchPerson'. + */ + @Generated + @JsonProperty(value = "mode") + private FindSimilarMatchMode mode; + + /* + * An array of candidate faceIds. All of them are created by "Detect" and the faceIds will expire 24 hours after the detection call. The number of faceIds is limited to 1000. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /** + * Creates an instance of FindSimilarRequest class. + * + * @param faceId the faceId value to set. + * @param faceIds the faceIds value to set. + */ + @Generated + @JsonCreator + public FindSimilarRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "faceIds") List faceIds) { + this.faceId = faceId; + this.faceIds = faceIds; + } + + /** + * Get the faceId property: faceId of the query face. User needs to call "Detect" first to get a valid faceId. Note + * that this faceId is not persisted and will expire 24 hours after the detection call. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The number of top similar faces returned. The valid range is [1, + * 1000]. Default value is 20. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the FindSimilarRequest object itself. + */ + @Generated + public FindSimilarRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @return the mode value. + */ + @Generated + public FindSimilarMatchMode getMode() { + return this.mode; + } + + /** + * Set the mode property: Similar face searching mode. It can be 'matchPerson' or 'matchFace'. Default value is + * 'matchPerson'. + * + * @param mode the mode value to set. + * @return the FindSimilarRequest object itself. + */ + @Generated + public FindSimilarRequest setMode(FindSimilarMatchMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the faceIds property: An array of candidate faceIds. All of them are created by "Detect" and the faceIds will + * expire 24 hours after the detection call. The number of faceIds is limited to 1000. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/GroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/GroupRequest.java new file mode 100644 index 0000000000000..c0a6342b084bf --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/GroupRequest.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The GroupRequest model. + */ +@Immutable +public final class GroupRequest { + /* + * Array of candidate faceIds created by "Detect". The maximum is 1000 faces. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /** + * Creates an instance of GroupRequest class. + * + * @param faceIds the faceIds value to set. + */ + @Generated + @JsonCreator + public GroupRequest(@JsonProperty(value = "faceIds") List faceIds) { + this.faceIds = faceIds; + } + + /** + * Get the faceIds property: Array of candidate faceIds created by "Detect". The maximum is 1000 faces. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromDynamicPersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromDynamicPersonGroupRequest.java new file mode 100644 index 0000000000000..ec41338822d0e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromDynamicPersonGroupRequest.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The IdentifyFromDynamicPersonGroupRequest model. + */ +@Fluent +public final class IdentifyFromDynamicPersonGroupRequest { + /* + * Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid number of faceIds is between [1, 10]. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /* + * DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to match against. + */ + @Generated + @JsonProperty(value = "dynamicPersonGroupId") + private final String dynamicPersonGroupId; + + /* + * The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to override default internal threshold for better precision on their scenario data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + */ + @Generated + @JsonProperty(value = "confidenceThreshold") + private Double confidenceThreshold; + + /** + * Creates an instance of IdentifyFromDynamicPersonGroupRequest class. + * + * @param faceIds the faceIds value to set. + * @param dynamicPersonGroupId the dynamicPersonGroupId value to set. + */ + @Generated + @JsonCreator + public IdentifyFromDynamicPersonGroupRequest(@JsonProperty(value = "faceIds") List faceIds, + @JsonProperty(value = "dynamicPersonGroupId") String dynamicPersonGroupId) { + this.faceIds = faceIds; + this.dynamicPersonGroupId = dynamicPersonGroupId; + } + + /** + * Get the faceIds property: Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } + + /** + * Get the dynamicPersonGroupId property: DynamicPersonGroupId of the target PersonDirectory DynamicPersonGroup to + * match against. + * + * @return the dynamicPersonGroupId value. + */ + @Generated + public String getDynamicPersonGroupId() { + return this.dynamicPersonGroupId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the IdentifyFromDynamicPersonGroupRequest object itself. + */ + @Generated + public IdentifyFromDynamicPersonGroupRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the IdentifyFromDynamicPersonGroupRequest object itself. + */ + @Generated + public IdentifyFromDynamicPersonGroupRequest setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java new file mode 100644 index 0000000000000..c875dd69b88d3 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromLargePersonGroupRequest.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The IdentifyFromLargePersonGroupRequest model. + */ +@Fluent +public final class IdentifyFromLargePersonGroupRequest { + /* + * Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid number of faceIds is between [1, 10]. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /* + * largePersonGroupId of the target Large Person Group, created by "Create Large Person Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + */ + @Generated + @JsonProperty(value = "largePersonGroupId") + private final String largePersonGroupId; + + /* + * The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to override default internal threshold for better precision on their scenario data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + */ + @Generated + @JsonProperty(value = "confidenceThreshold") + private Double confidenceThreshold; + + /** + * Creates an instance of IdentifyFromLargePersonGroupRequest class. + * + * @param faceIds the faceIds value to set. + * @param largePersonGroupId the largePersonGroupId value to set. + */ + @Generated + @JsonCreator + public IdentifyFromLargePersonGroupRequest(@JsonProperty(value = "faceIds") List faceIds, + @JsonProperty(value = "largePersonGroupId") String largePersonGroupId) { + this.faceIds = faceIds; + this.largePersonGroupId = largePersonGroupId; + } + + /** + * Get the faceIds property: Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } + + /** + * Get the largePersonGroupId property: largePersonGroupId of the target Large Person Group, created by "Create + * Large Person Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the IdentifyFromLargePersonGroupRequest object itself. + */ + @Generated + public IdentifyFromLargePersonGroupRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the IdentifyFromLargePersonGroupRequest object itself. + */ + @Generated + public IdentifyFromLargePersonGroupRequest setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonDirectoryRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonDirectoryRequest.java new file mode 100644 index 0000000000000..f2b60c723c3c3 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonDirectoryRequest.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The IdentifyFromPersonDirectoryRequest model. + */ +@Fluent +public final class IdentifyFromPersonDirectoryRequest { + /* + * Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid number of faceIds is between [1, 10]. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /* + * Array of personIds created in Person Directory "Create Person". The valid number of personIds is between [1,30]. + */ + @Generated + @JsonProperty(value = "personIds") + private final List personIds; + + /* + * The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to override default internal threshold for better precision on their scenario data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + */ + @Generated + @JsonProperty(value = "confidenceThreshold") + private Double confidenceThreshold; + + /** + * Creates an instance of IdentifyFromPersonDirectoryRequest class. + * + * @param faceIds the faceIds value to set. + * @param personIds the personIds value to set. + */ + @Generated + @JsonCreator + public IdentifyFromPersonDirectoryRequest(@JsonProperty(value = "faceIds") List faceIds, + @JsonProperty(value = "personIds") List personIds) { + this.faceIds = faceIds; + this.personIds = personIds; + } + + /** + * Get the faceIds property: Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } + + /** + * Get the personIds property: Array of personIds created in Person Directory "Create Person". The valid number of + * personIds is between [1,30]. + * + * @return the personIds value. + */ + @Generated + public List getPersonIds() { + return this.personIds; + } + + /** + * Get the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the IdentifyFromPersonDirectoryRequest object itself. + */ + @Generated + public IdentifyFromPersonDirectoryRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the IdentifyFromPersonDirectoryRequest object itself. + */ + @Generated + public IdentifyFromPersonDirectoryRequest setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonGroupRequest.java new file mode 100644 index 0000000000000..55811c3123b7f --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/IdentifyFromPersonGroupRequest.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The IdentifyFromPersonGroupRequest model. + */ +@Fluent +public final class IdentifyFromPersonGroupRequest { + /* + * Array of query faces faceIds, created by the "Detect". Each of the faces are identified independently. The valid number of faceIds is between [1, 10]. + */ + @Generated + @JsonProperty(value = "faceIds") + private final List faceIds; + + /* + * personGroupId of the target Person Group, created by "Create Person Group". Parameter personGroupId and largePersonGroupId should not be provided at the same time. + */ + @Generated + @JsonProperty(value = "personGroupId") + private final String personGroupId; + + /* + * The range of maxNumOfCandidatesReturned is between 1 and 100. Default value is 10. + */ + @Generated + @JsonProperty(value = "maxNumOfCandidatesReturned") + private Integer maxNumOfCandidatesReturned; + + /* + * Customized identification confidence threshold, in the range of [0, 1]. Advanced user can tweak this value to override default internal threshold for better precision on their scenario data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + */ + @Generated + @JsonProperty(value = "confidenceThreshold") + private Double confidenceThreshold; + + /** + * Creates an instance of IdentifyFromPersonGroupRequest class. + * + * @param faceIds the faceIds value to set. + * @param personGroupId the personGroupId value to set. + */ + @Generated + @JsonCreator + public IdentifyFromPersonGroupRequest(@JsonProperty(value = "faceIds") List faceIds, + @JsonProperty(value = "personGroupId") String personGroupId) { + this.faceIds = faceIds; + this.personGroupId = personGroupId; + } + + /** + * Get the faceIds property: Array of query faces faceIds, created by the "Detect". Each of the faces are identified + * independently. The valid number of faceIds is between [1, 10]. + * + * @return the faceIds value. + */ + @Generated + public List getFaceIds() { + return this.faceIds; + } + + /** + * Get the personGroupId property: personGroupId of the target Person Group, created by "Create Person Group". + * Parameter personGroupId and largePersonGroupId should not be provided at the same time. + * + * @return the personGroupId value. + */ + @Generated + public String getPersonGroupId() { + return this.personGroupId; + } + + /** + * Get the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @return the maxNumOfCandidatesReturned value. + */ + @Generated + public Integer getMaxNumOfCandidatesReturned() { + return this.maxNumOfCandidatesReturned; + } + + /** + * Set the maxNumOfCandidatesReturned property: The range of maxNumOfCandidatesReturned is between 1 and 100. + * Default value is 10. + * + * @param maxNumOfCandidatesReturned the maxNumOfCandidatesReturned value to set. + * @return the IdentifyFromPersonGroupRequest object itself. + */ + @Generated + public IdentifyFromPersonGroupRequest setMaxNumOfCandidatesReturned(Integer maxNumOfCandidatesReturned) { + this.maxNumOfCandidatesReturned = maxNumOfCandidatesReturned; + return this; + } + + /** + * Get the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @return the confidenceThreshold value. + */ + @Generated + public Double getConfidenceThreshold() { + return this.confidenceThreshold; + } + + /** + * Set the confidenceThreshold property: Customized identification confidence threshold, in the range of [0, 1]. + * Advanced user can tweak this value to override default internal threshold for better precision on their scenario + * data. Note there is no guarantee of this threshold value working on other data and after algorithm updates. + * + * @param confidenceThreshold the confidenceThreshold value to set. + * @return the IdentifyFromPersonGroupRequest object itself. + */ + @Generated + public IdentifyFromPersonGroupRequest setConfidenceThreshold(Double confidenceThreshold) { + this.confidenceThreshold = confidenceThreshold; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupRequest.java new file mode 100644 index 0000000000000..3fe31593521b4 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateDynamicPersonGroupRequest model. + */ +@Fluent +public final class UpdateDynamicPersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateDynamicPersonGroupRequest class. + */ + @Generated + public UpdateDynamicPersonGroupRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateDynamicPersonGroupRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateDynamicPersonGroupRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupWithPersonChangesRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupWithPersonChangesRequest.java new file mode 100644 index 0000000000000..3666d2ebe805d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateDynamicPersonGroupWithPersonChangesRequest.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The UpdateDynamicPersonGroupWithPersonChangesRequest model. + */ +@Fluent +public final class UpdateDynamicPersonGroupWithPersonChangesRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Array of personIds created by Person Directory "Create Person" to be added. + */ + @Generated + @JsonProperty(value = "addPersonIds") + private List addPersonIds; + + /* + * Array of personIds created by Person Directory "Create Person" to be removed. + */ + @Generated + @JsonProperty(value = "removePersonIds") + private List removePersonIds; + + /** + * Creates an instance of UpdateDynamicPersonGroupWithPersonChangesRequest class. + */ + @Generated + public UpdateDynamicPersonGroupWithPersonChangesRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateDynamicPersonGroupWithPersonChangesRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupWithPersonChangesRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateDynamicPersonGroupWithPersonChangesRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupWithPersonChangesRequest setUserData(String userData) { + this.userData = userData; + return this; + } + + /** + * Get the addPersonIds property: Array of personIds created by Person Directory "Create Person" to be added. + * + * @return the addPersonIds value. + */ + @Generated + public List getAddPersonIds() { + return this.addPersonIds; + } + + /** + * Set the addPersonIds property: Array of personIds created by Person Directory "Create Person" to be added. + * + * @param addPersonIds the addPersonIds value to set. + * @return the UpdateDynamicPersonGroupWithPersonChangesRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupWithPersonChangesRequest setAddPersonIds(List addPersonIds) { + this.addPersonIds = addPersonIds; + return this; + } + + /** + * Get the removePersonIds property: Array of personIds created by Person Directory "Create Person" to be removed. + * + * @return the removePersonIds value. + */ + @Generated + public List getRemovePersonIds() { + return this.removePersonIds; + } + + /** + * Set the removePersonIds property: Array of personIds created by Person Directory "Create Person" to be removed. + * + * @param removePersonIds the removePersonIds value to set. + * @return the UpdateDynamicPersonGroupWithPersonChangesRequest object itself. + */ + @Generated + public UpdateDynamicPersonGroupWithPersonChangesRequest setRemovePersonIds(List removePersonIds) { + this.removePersonIds = removePersonIds; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceListRequest.java new file mode 100644 index 0000000000000..8638a45deaa3f --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateFaceListRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateFaceListRequest model. + */ +@Fluent +public final class UpdateFaceListRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateFaceListRequest class. + */ + @Generated + public UpdateFaceListRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateFaceListRequest object itself. + */ + @Generated + public UpdateFaceListRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateFaceListRequest object itself. + */ + @Generated + public UpdateFaceListRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListFaceRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListFaceRequest.java new file mode 100644 index 0000000000000..c7a5c5ed4e74f --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListFaceRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateLargeFaceListFaceRequest model. + */ +@Fluent +public final class UpdateLargeFaceListFaceRequest { + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateLargeFaceListFaceRequest class. + */ + @Generated + public UpdateLargeFaceListFaceRequest() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdateLargeFaceListFaceRequest object itself. + */ + @Generated + public UpdateLargeFaceListFaceRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListRequest.java new file mode 100644 index 0000000000000..fb170768bb227 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargeFaceListRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateLargeFaceListRequest model. + */ +@Fluent +public final class UpdateLargeFaceListRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateLargeFaceListRequest class. + */ + @Generated + public UpdateLargeFaceListRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateLargeFaceListRequest object itself. + */ + @Generated + public UpdateLargeFaceListRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateLargeFaceListRequest object itself. + */ + @Generated + public UpdateLargeFaceListRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonFaceRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonFaceRequest.java new file mode 100644 index 0000000000000..fdb8d3fd6db2b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonFaceRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateLargePersonGroupPersonFaceRequest model. + */ +@Fluent +public final class UpdateLargePersonGroupPersonFaceRequest { + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateLargePersonGroupPersonFaceRequest class. + */ + @Generated + public UpdateLargePersonGroupPersonFaceRequest() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdateLargePersonGroupPersonFaceRequest object itself. + */ + @Generated + public UpdateLargePersonGroupPersonFaceRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonRequest.java new file mode 100644 index 0000000000000..c836cedd63a13 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupPersonRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateLargePersonGroupPersonRequest model. + */ +@Fluent +public final class UpdateLargePersonGroupPersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateLargePersonGroupPersonRequest class. + */ + @Generated + public UpdateLargePersonGroupPersonRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateLargePersonGroupPersonRequest object itself. + */ + @Generated + public UpdateLargePersonGroupPersonRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateLargePersonGroupPersonRequest object itself. + */ + @Generated + public UpdateLargePersonGroupPersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupRequest.java new file mode 100644 index 0000000000000..fcd372c9d8b28 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdateLargePersonGroupRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateLargePersonGroupRequest model. + */ +@Fluent +public final class UpdateLargePersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdateLargePersonGroupRequest class. + */ + @Generated + public UpdateLargePersonGroupRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdateLargePersonGroupRequest object itself. + */ + @Generated + public UpdateLargePersonGroupRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdateLargePersonGroupRequest object itself. + */ + @Generated + public UpdateLargePersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonFaceRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonFaceRequest.java new file mode 100644 index 0000000000000..fd45b2f1b7c01 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonFaceRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdatePersonFaceRequest model. + */ +@Fluent +public final class UpdatePersonFaceRequest { + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdatePersonFaceRequest class. + */ + @Generated + public UpdatePersonFaceRequest() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdatePersonFaceRequest object itself. + */ + @Generated + public UpdatePersonFaceRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonFaceRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonFaceRequest.java new file mode 100644 index 0000000000000..80baeca54c3bc --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonFaceRequest.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdatePersonGroupPersonFaceRequest model. + */ +@Fluent +public final class UpdatePersonGroupPersonFaceRequest { + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdatePersonGroupPersonFaceRequest class. + */ + @Generated + public UpdatePersonGroupPersonFaceRequest() { + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @param userData the userData value to set. + * @return the UpdatePersonGroupPersonFaceRequest object itself. + */ + @Generated + public UpdatePersonGroupPersonFaceRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonRequest.java new file mode 100644 index 0000000000000..d99e878cf1849 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupPersonRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdatePersonGroupPersonRequest model. + */ +@Fluent +public final class UpdatePersonGroupPersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdatePersonGroupPersonRequest class. + */ + @Generated + public UpdatePersonGroupPersonRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdatePersonGroupPersonRequest object itself. + */ + @Generated + public UpdatePersonGroupPersonRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdatePersonGroupPersonRequest object itself. + */ + @Generated + public UpdatePersonGroupPersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupRequest.java new file mode 100644 index 0000000000000..1aa9789bca2ff --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonGroupRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdatePersonGroupRequest model. + */ +@Fluent +public final class UpdatePersonGroupRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdatePersonGroupRequest class. + */ + @Generated + public UpdatePersonGroupRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdatePersonGroupRequest object itself. + */ + @Generated + public UpdatePersonGroupRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdatePersonGroupRequest object itself. + */ + @Generated + public UpdatePersonGroupRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java new file mode 100644 index 0000000000000..c29f61674dec0 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/UpdatePersonRequest.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdatePersonRequest model. + */ +@Fluent +public final class UpdatePersonRequest { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of UpdatePersonRequest class. + */ + @Generated + public UpdatePersonRequest() { + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: User defined name, maximum length is 128. + * + * @param name the name value to set. + * @return the UpdatePersonRequest object itself. + */ + @Generated + public UpdatePersonRequest setName(String name) { + this.name = name; + return this; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Set the userData property: Optional user defined data. Length should not exceed 16K. + * + * @param userData the userData value to set. + * @return the UpdatePersonRequest object itself. + */ + @Generated + public UpdatePersonRequest setUserData(String userData) { + this.userData = userData; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFaceToFaceRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFaceToFaceRequest.java new file mode 100644 index 0000000000000..6679ec9671e79 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFaceToFaceRequest.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VerifyFaceToFaceRequest model. + */ +@Immutable +public final class VerifyFaceToFaceRequest { + /* + * The faceId of one face, come from "Detect". + */ + @Generated + @JsonProperty(value = "faceId1") + private final String faceId1; + + /* + * The faceId of another face, come from "Detect". + */ + @Generated + @JsonProperty(value = "faceId2") + private final String faceId2; + + /** + * Creates an instance of VerifyFaceToFaceRequest class. + * + * @param faceId1 the faceId1 value to set. + * @param faceId2 the faceId2 value to set. + */ + @Generated + @JsonCreator + public VerifyFaceToFaceRequest(@JsonProperty(value = "faceId1") String faceId1, + @JsonProperty(value = "faceId2") String faceId2) { + this.faceId1 = faceId1; + this.faceId2 = faceId2; + } + + /** + * Get the faceId1 property: The faceId of one face, come from "Detect". + * + * @return the faceId1 value. + */ + @Generated + public String getFaceId1() { + return this.faceId1; + } + + /** + * Get the faceId2 property: The faceId of another face, come from "Detect". + * + * @return the faceId2 value. + */ + @Generated + public String getFaceId2() { + return this.faceId2; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java new file mode 100644 index 0000000000000..7ee14e9f16fe1 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromLargePersonGroupRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VerifyFromLargePersonGroupRequest model. + */ +@Immutable +public final class VerifyFromLargePersonGroupRequest { + /* + * The faceId of the face, come from "Detect". + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * Using existing largePersonGroupId and personId for fast loading a specified person. largePersonGroupId is created in "Create Large Person Group". + */ + @Generated + @JsonProperty(value = "largePersonGroupId") + private final String largePersonGroupId; + + /* + * Specify a certain person in Large Person Group. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /** + * Creates an instance of VerifyFromLargePersonGroupRequest class. + * + * @param faceId the faceId value to set. + * @param largePersonGroupId the largePersonGroupId value to set. + * @param personId the personId value to set. + */ + @Generated + @JsonCreator + public VerifyFromLargePersonGroupRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "largePersonGroupId") String largePersonGroupId, + @JsonProperty(value = "personId") String personId) { + this.faceId = faceId; + this.largePersonGroupId = largePersonGroupId; + this.personId = personId; + } + + /** + * Get the faceId property: The faceId of the face, come from "Detect". + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the largePersonGroupId property: Using existing largePersonGroupId and personId for fast loading a specified + * person. largePersonGroupId is created in "Create Large Person Group". + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * Get the personId property: Specify a certain person in Large Person Group. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonDirectoryRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonDirectoryRequest.java new file mode 100644 index 0000000000000..fce21185d90bc --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonDirectoryRequest.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VerifyFromPersonDirectoryRequest model. + */ +@Immutable +public final class VerifyFromPersonDirectoryRequest { + /* + * The faceId of the face, come from "Detect". + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * Specify a certain person in PersonDirectory Person. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /** + * Creates an instance of VerifyFromPersonDirectoryRequest class. + * + * @param faceId the faceId value to set. + * @param personId the personId value to set. + */ + @Generated + @JsonCreator + public VerifyFromPersonDirectoryRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "personId") String personId) { + this.faceId = faceId; + this.personId = personId; + } + + /** + * Get the faceId property: The faceId of the face, come from "Detect". + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the personId property: Specify a certain person in PersonDirectory Person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonGroupRequest.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonGroupRequest.java new file mode 100644 index 0000000000000..fef1a4429451b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyFromPersonGroupRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The VerifyFromPersonGroupRequest model. + */ +@Immutable +public final class VerifyFromPersonGroupRequest { + /* + * The faceId of the face, come from "Detect". + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * Using existing personGroupId and personId for fast loading a specified person. personGroupId is created in "Create Person Group". + */ + @Generated + @JsonProperty(value = "personGroupId") + private final String personGroupId; + + /* + * Specify a certain person in Person Group. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /** + * Creates an instance of VerifyFromPersonGroupRequest class. + * + * @param faceId the faceId value to set. + * @param personGroupId the personGroupId value to set. + * @param personId the personId value to set. + */ + @Generated + @JsonCreator + public VerifyFromPersonGroupRequest(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "personGroupId") String personGroupId, + @JsonProperty(value = "personId") String personId) { + this.faceId = faceId; + this.personGroupId = personGroupId; + this.personId = personId; + } + + /** + * Get the faceId property: The faceId of the face, come from "Detect". + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the personGroupId property: Using existing personGroupId and personId for fast loading a specified person. + * personGroupId is created in "Create Person Group". + * + * @return the personGroupId value. + */ + @Generated + public String getPersonGroupId() { + return this.personGroupId; + } + + /** + * Get the personId property: Specify a certain person in Person Group. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java new file mode 100644 index 0000000000000..b99d94bc5d9dc --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; + +/** + * The file details for the "VerifyImage" field. + */ +@Fluent +public final class VerifyImageFileDetails { + /* + * The content of the file. + */ + @Generated + private final BinaryData content; + + /* + * The filename of the file. + */ + @Generated + private String filename; + + /* + * The content-type of the file. + */ + @Generated + private String contentType = "application/octet-stream"; + + /** + * Creates an instance of VerifyImageFileDetails class. + * + * @param content the content value to set. + */ + @Generated + public VerifyImageFileDetails(BinaryData content) { + this.content = content; + } + + /** + * Get the content property: The content of the file. + * + * @return the content value. + */ + @Generated + public BinaryData getContent() { + return this.content; + } + + /** + * Get the filename property: The filename of the file. + * + * @return the filename value. + */ + @Generated + public String getFilename() { + return this.filename; + } + + /** + * Set the filename property: The filename of the file. + * + * @param filename the filename value to set. + * @return the VerifyImageFileDetails object itself. + */ + @Generated + public VerifyImageFileDetails setFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Get the contentType property: The content-type of the file. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content-type of the file. + * + * @param contentType the contentType value to set. + * @return the VerifyImageFileDetails object itself. + */ + @Generated + public VerifyImageFileDetails setContentType(String contentType) { + this.contentType = contentType; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/package-info.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/package-info.java new file mode 100644 index 0000000000000..c30e2a2eb56f2 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Face. + * + */ +package com.azure.ai.vision.face.implementation.models; diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/package-info.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/package-info.java new file mode 100644 index 0000000000000..ec430c61cde26 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the implementations for Face. + * + */ +package com.azure.ai.vision.face.implementation; diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryItem.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryItem.java new file mode 100644 index 0000000000000..9a2d8f5b23a85 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryItem.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Accessory item and corresponding confidence level. + */ +@Immutable +public final class AccessoryItem { + /* + * Type of the accessory. + */ + @Generated + @JsonProperty(value = "type") + private final AccessoryType type; + + /* + * Confidence level of the accessory type. Range between [0,1]. + */ + @Generated + @JsonProperty(value = "confidence") + private final double confidence; + + /** + * Creates an instance of AccessoryItem class. + * + * @param type the type value to set. + * @param confidence the confidence value to set. + */ + @Generated + @JsonCreator + private AccessoryItem(@JsonProperty(value = "type") AccessoryType type, + @JsonProperty(value = "confidence") double confidence) { + this.type = type; + this.confidence = confidence; + } + + /** + * Get the type property: Type of the accessory. + * + * @return the type value. + */ + @Generated + public AccessoryType getType() { + return this.type; + } + + /** + * Get the confidence property: Confidence level of the accessory type. Range between [0,1]. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryType.java new file mode 100644 index 0000000000000..a93985bad9849 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AccessoryType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of the accessory. + */ +public final class AccessoryType extends ExpandableStringEnum { + /** + * Head wear. + */ + @Generated + public static final AccessoryType HEADWEAR = fromString("headwear"); + + /** + * Glasses. + */ + @Generated + public static final AccessoryType GLASSES = fromString("glasses"); + + /** + * Mask. + */ + @Generated + public static final AccessoryType MASK = fromString("mask"); + + /** + * Creates a new instance of AccessoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AccessoryType() { + } + + /** + * Creates or finds a AccessoryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessoryType. + */ + @Generated + @JsonCreator + public static AccessoryType fromString(String name) { + return fromString(name, AccessoryType.class); + } + + /** + * Gets known AccessoryType values. + * + * @return known AccessoryType values. + */ + @Generated + public static Collection values() { + return values(AccessoryType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java new file mode 100644 index 0000000000000..27c8894f5504e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AddFaceResult.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response body for adding face. + */ +@Immutable +public final class AddFaceResult { + /* + * Persisted Face ID of the added face, which is persisted and will not expire. Different from faceId which is created in "Detect" and will expire in 24 hours after the detection call. + */ + @Generated + @JsonProperty(value = "persistedFaceId") + private final String persistedFaceId; + + /** + * Creates an instance of AddFaceResult class. + * + * @param persistedFaceId the persistedFaceId value to set. + */ + @Generated + @JsonCreator + private AddFaceResult(@JsonProperty(value = "persistedFaceId") String persistedFaceId) { + this.persistedFaceId = persistedFaceId; + } + + /** + * Get the persistedFaceId property: Persisted Face ID of the added face, which is persisted and will not expire. + * Different from faceId which is created in "Detect" and will expire in 24 hours after the detection call. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java new file mode 100644 index 0000000000000..e6d7486ebe74d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Audit entry for a response in the session. + */ +@Immutable +public final class AuditLivenessResponseInfo { + /* + * The response body. The schema of this field will depend on the request.url and request.method used by the client. + */ + @Generated + @JsonProperty(value = "body") + private final LivenessResponseBody body; + + /* + * The HTTP status code returned to the client. + */ + @Generated + @JsonProperty(value = "statusCode") + private final int statusCode; + + /* + * The server measured latency for this request in milliseconds. + */ + @Generated + @JsonProperty(value = "latencyInMilliseconds") + private final long latencyInMilliseconds; + + /** + * Creates an instance of AuditLivenessResponseInfo class. + * + * @param body the body value to set. + * @param statusCode the statusCode value to set. + * @param latencyInMilliseconds the latencyInMilliseconds value to set. + */ + @Generated + @JsonCreator + private AuditLivenessResponseInfo(@JsonProperty(value = "body") LivenessResponseBody body, + @JsonProperty(value = "statusCode") int statusCode, + @JsonProperty(value = "latencyInMilliseconds") long latencyInMilliseconds) { + this.body = body; + this.statusCode = statusCode; + this.latencyInMilliseconds = latencyInMilliseconds; + } + + /** + * Get the body property: The response body. The schema of this field will depend on the request.url and + * request.method used by the client. + * + * @return the body value. + */ + @Generated + public LivenessResponseBody getBody() { + return this.body; + } + + /** + * Get the statusCode property: The HTTP status code returned to the client. + * + * @return the statusCode value. + */ + @Generated + public int getStatusCode() { + return this.statusCode; + } + + /** + * Get the latencyInMilliseconds property: The server measured latency for this request in milliseconds. + * + * @return the latencyInMilliseconds value. + */ + @Generated + public long getLatencyInMilliseconds() { + return this.latencyInMilliseconds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java new file mode 100644 index 0000000000000..b0678dfdc1238 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Audit entry for a request in the session. + */ +@Immutable +public final class AuditRequestInfo { + /* + * The relative URL and query of the liveness request. + */ + @Generated + @JsonProperty(value = "url") + private final String url; + + /* + * The HTTP method of the request (i.e., GET, POST, DELETE). + */ + @Generated + @JsonProperty(value = "method") + private final String method; + + /* + * The length of the request body in bytes. + */ + @Generated + @JsonProperty(value = "contentLength") + private Long contentLength; + + /* + * The content type of the request. + */ + @Generated + @JsonProperty(value = "contentType") + private final String contentType; + + /* + * The user agent used to submit the request. + */ + @Generated + @JsonProperty(value = "userAgent") + private String userAgent; + + /** + * Creates an instance of AuditRequestInfo class. + * + * @param url the url value to set. + * @param method the method value to set. + * @param contentType the contentType value to set. + */ + @Generated + @JsonCreator + private AuditRequestInfo(@JsonProperty(value = "url") String url, @JsonProperty(value = "method") String method, + @JsonProperty(value = "contentType") String contentType) { + this.url = url; + this.method = method; + this.contentType = contentType; + } + + /** + * Get the url property: The relative URL and query of the liveness request. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the method property: The HTTP method of the request (i.e., GET, POST, DELETE). + * + * @return the method value. + */ + @Generated + public String getMethod() { + return this.method; + } + + /** + * Get the contentLength property: The length of the request body in bytes. + * + * @return the contentLength value. + */ + @Generated + public Long getContentLength() { + return this.contentLength; + } + + /** + * Get the contentType property: The content type of the request. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Get the userAgent property: The user agent used to submit the request. + * + * @return the userAgent value. + */ + @Generated + public String getUserAgent() { + return this.userAgent; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurLevel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurLevel.java new file mode 100644 index 0000000000000..e5022385feb0d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurLevel.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates level of blurriness. + */ +public final class BlurLevel extends ExpandableStringEnum { + /** + * Low blur level. + */ + @Generated + public static final BlurLevel LOW = fromString("low"); + + /** + * Medium blur level. + */ + @Generated + public static final BlurLevel MEDIUM = fromString("medium"); + + /** + * High blur level. + */ + @Generated + public static final BlurLevel HIGH = fromString("high"); + + /** + * Creates a new instance of BlurLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public BlurLevel() { + } + + /** + * Creates or finds a BlurLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding BlurLevel. + */ + @Generated + @JsonCreator + public static BlurLevel fromString(String name) { + return fromString(name, BlurLevel.class); + } + + /** + * Gets known BlurLevel values. + * + * @return known BlurLevel values. + */ + @Generated + public static Collection values() { + return values(BlurLevel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurProperties.java new file mode 100644 index 0000000000000..42f1295d992c8 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/BlurProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing any presence of blur within the image. + */ +@Immutable +public final class BlurProperties { + /* + * An enum value indicating level of blurriness. + */ + @Generated + @JsonProperty(value = "blurLevel") + private final BlurLevel blurLevel; + + /* + * A number indicating level of blurriness ranging from 0 to 1. + */ + @Generated + @JsonProperty(value = "value") + private final double value; + + /** + * Creates an instance of BlurProperties class. + * + * @param blurLevel the blurLevel value to set. + * @param value the value value to set. + */ + @Generated + @JsonCreator + private BlurProperties(@JsonProperty(value = "blurLevel") BlurLevel blurLevel, + @JsonProperty(value = "value") double value) { + this.blurLevel = blurLevel; + this.value = value; + } + + /** + * Get the blurLevel property: An enum value indicating level of blurriness. + * + * @return the blurLevel value. + */ + @Generated + public BlurLevel getBlurLevel() { + return this.blurLevel; + } + + /** + * Get the value property: A number indicating level of blurriness ranging from 0 to 1. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java new file mode 100644 index 0000000000000..df102d8754e43 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Request for creating liveness session. + */ +@Fluent +public final class CreateLivenessSessionContent { + /* + * Type of liveness mode the client should follow. + */ + @Generated + @JsonProperty(value = "livenessOperationMode") + private final LivenessOperationMode livenessOperationMode; + + /* + * Whether or not to allow a '200 - Success' response body to be sent to the client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' empty body response. Regardless of selection, calling Session GetResult will always contain a response body enabling business logic to be implemented. + */ + @Generated + @JsonProperty(value = "sendResultsToClient") + private Boolean sendResultsToClient; + + /* + * Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body. + */ + @Generated + @JsonProperty(value = "deviceCorrelationIdSetInClient") + private Boolean deviceCorrelationIdSetInClient; + + /* + * Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. + */ + @Generated + @JsonProperty(value = "deviceCorrelationId") + private String deviceCorrelationId; + + /* + * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + */ + @Generated + @JsonProperty(value = "authTokenTimeToLiveInSeconds") + private Integer authTokenTimeToLiveInSeconds; + + /** + * Creates an instance of CreateLivenessSessionContent class. + * + * @param livenessOperationMode the livenessOperationMode value to set. + */ + @Generated + @JsonCreator + public CreateLivenessSessionContent( + @JsonProperty(value = "livenessOperationMode") LivenessOperationMode livenessOperationMode) { + this.livenessOperationMode = livenessOperationMode; + } + + /** + * Get the livenessOperationMode property: Type of liveness mode the client should follow. + * + * @return the livenessOperationMode value. + */ + @Generated + public LivenessOperationMode getLivenessOperationMode() { + return this.livenessOperationMode; + } + + /** + * Get the sendResultsToClient property: Whether or not to allow a '200 - Success' response body to be sent to the + * client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' + * empty body response. Regardless of selection, calling Session GetResult will always contain a response body + * enabling business logic to be implemented. + * + * @return the sendResultsToClient value. + */ + @Generated + public Boolean isSendResultsToClient() { + return this.sendResultsToClient; + } + + /** + * Set the sendResultsToClient property: Whether or not to allow a '200 - Success' response body to be sent to the + * client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' + * empty body response. Regardless of selection, calling Session GetResult will always contain a response body + * enabling business logic to be implemented. + * + * @param sendResultsToClient the sendResultsToClient value to set. + * @return the CreateLivenessSessionContent object itself. + */ + @Generated + public CreateLivenessSessionContent setSendResultsToClient(Boolean sendResultsToClient) { + this.sendResultsToClient = sendResultsToClient; + return this; + } + + /** + * Get the deviceCorrelationIdSetInClient property: Whether or not to allow client to set their own + * 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request + * body. + * + * @return the deviceCorrelationIdSetInClient value. + */ + @Generated + public Boolean isDeviceCorrelationIdSetInClient() { + return this.deviceCorrelationIdSetInClient; + } + + /** + * Set the deviceCorrelationIdSetInClient property: Whether or not to allow client to set their own + * 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request + * body. + * + * @param deviceCorrelationIdSetInClient the deviceCorrelationIdSetInClient value to set. + * @return the CreateLivenessSessionContent object itself. + */ + @Generated + public CreateLivenessSessionContent setDeviceCorrelationIdSetInClient(Boolean deviceCorrelationIdSetInClient) { + this.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; + return this; + } + + /** + * Get the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and + * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be + * null. + * + * @return the deviceCorrelationId value. + */ + @Generated + public String getDeviceCorrelationId() { + return this.deviceCorrelationId; + } + + /** + * Set the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and + * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be + * null. + * + * @param deviceCorrelationId the deviceCorrelationId value to set. + * @return the CreateLivenessSessionContent object itself. + */ + @Generated + public CreateLivenessSessionContent setDeviceCorrelationId(String deviceCorrelationId) { + this.deviceCorrelationId = deviceCorrelationId; + return this; + } + + /** + * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. + * + * @return the authTokenTimeToLiveInSeconds value. + */ + @Generated + public Integer getAuthTokenTimeToLiveInSeconds() { + return this.authTokenTimeToLiveInSeconds; + } + + /** + * Set the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. + * + * @param authTokenTimeToLiveInSeconds the authTokenTimeToLiveInSeconds value to set. + * @return the CreateLivenessSessionContent object itself. + */ + @Generated + public CreateLivenessSessionContent setAuthTokenTimeToLiveInSeconds(Integer authTokenTimeToLiveInSeconds) { + this.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; + return this; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java new file mode 100644 index 0000000000000..088896c3b5a82 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response of liveness session creation. + */ +@Immutable +public final class CreateLivenessSessionResult { + /* + * The unique session ID of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding Session DELETE operation. + */ + @Generated + @JsonProperty(value = "sessionId") + private final String sessionId; + + /* + * Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable. + */ + @Generated + @JsonProperty(value = "authToken") + private final String authToken; + + /** + * Creates an instance of CreateLivenessSessionResult class. + * + * @param sessionId the sessionId value to set. + * @param authToken the authToken value to set. + */ + @Generated + @JsonCreator + private CreateLivenessSessionResult(@JsonProperty(value = "sessionId") String sessionId, + @JsonProperty(value = "authToken") String authToken) { + this.sessionId = sessionId; + this.authToken = authToken; + } + + /** + * Get the sessionId property: The unique session ID of the created session. It will expire 48 hours after it was + * created or may be deleted sooner using the corresponding Session DELETE operation. + * + * @return the sessionId value. + */ + @Generated + public String getSessionId() { + return this.sessionId; + } + + /** + * Get the authToken property: Bearer token to provide authentication for the Vision SDK running on a client + * application. This Bearer token has limited permissions to perform only the required action and expires after the + * TTL time. It is also auditable. + * + * @return the authToken value. + */ + @Generated + public String getAuthToken() { + return this.authToken; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java new file mode 100644 index 0000000000000..ed88c77cd8970 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response of liveness session with verify creation with verify image provided. + */ +@Immutable +public final class CreateLivenessWithVerifySessionResult { + /* + * The unique session ID of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding Session DELETE operation. + */ + @Generated + @JsonProperty(value = "sessionId") + private final String sessionId; + + /* + * Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable. + */ + @Generated + @JsonProperty(value = "authToken") + private final String authToken; + + /* + * The detail of face for verification. + */ + @Generated + @JsonProperty(value = "verifyImage") + private LivenessWithVerifyImage verifyImage; + + /** + * Creates an instance of CreateLivenessWithVerifySessionResult class. + * + * @param sessionId the sessionId value to set. + * @param authToken the authToken value to set. + */ + @Generated + @JsonCreator + private CreateLivenessWithVerifySessionResult(@JsonProperty(value = "sessionId") String sessionId, + @JsonProperty(value = "authToken") String authToken) { + this.sessionId = sessionId; + this.authToken = authToken; + } + + /** + * Get the sessionId property: The unique session ID of the created session. It will expire 48 hours after it was + * created or may be deleted sooner using the corresponding Session DELETE operation. + * + * @return the sessionId value. + */ + @Generated + public String getSessionId() { + return this.sessionId; + } + + /** + * Get the authToken property: Bearer token to provide authentication for the Vision SDK running on a client + * application. This Bearer token has limited permissions to perform only the required action and expires after the + * TTL time. It is also auditable. + * + * @return the authToken value. + */ + @Generated + public String getAuthToken() { + return this.authToken; + } + + /** + * Get the verifyImage property: The detail of face for verification. + * + * @return the verifyImage value. + */ + @Generated + public LivenessWithVerifyImage getVerifyImage() { + return this.verifyImage; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.java new file mode 100644 index 0000000000000..c0dd520c85073 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreatePersonResult.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response of create person. + */ +@Immutable +public final class CreatePersonResult { + /* + * Person ID of the person. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /** + * Creates an instance of CreatePersonResult class. + * + * @param personId the personId value to set. + */ + @Generated + @JsonCreator + private CreatePersonResult(@JsonProperty(value = "personId") String personId) { + this.personId = personId; + } + + /** + * Get the personId property: Person ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DynamicPersonGroup.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DynamicPersonGroup.java new file mode 100644 index 0000000000000..f45d0a1e61bbf --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DynamicPersonGroup.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container that references Person Directory "Create Person". + */ +@Immutable +public final class DynamicPersonGroup { + /* + * ID of the dynamic person group. + */ + @Generated + @JsonProperty(value = "dynamicPersonGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String dynamicPersonGroupId; + + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of DynamicPersonGroup class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private DynamicPersonGroup(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the dynamicPersonGroupId property: ID of the dynamic person group. + * + * @return the dynamicPersonGroupId value. + */ + @Generated + public String getDynamicPersonGroupId() { + return this.dynamicPersonGroupId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureLevel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureLevel.java new file mode 100644 index 0000000000000..da620002574a4 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureLevel.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates level of exposure. + */ +public final class ExposureLevel extends ExpandableStringEnum { + /** + * Low exposure level. + */ + @Generated + public static final ExposureLevel UNDER_EXPOSURE = fromString("underExposure"); + + /** + * Good exposure level. + */ + @Generated + public static final ExposureLevel GOOD_EXPOSURE = fromString("goodExposure"); + + /** + * High exposure level. + */ + @Generated + public static final ExposureLevel OVER_EXPOSURE = fromString("overExposure"); + + /** + * Creates a new instance of ExposureLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ExposureLevel() { + } + + /** + * Creates or finds a ExposureLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExposureLevel. + */ + @Generated + @JsonCreator + public static ExposureLevel fromString(String name) { + return fromString(name, ExposureLevel.class); + } + + /** + * Gets known ExposureLevel values. + * + * @return known ExposureLevel values. + */ + @Generated + public static Collection values() { + return values(ExposureLevel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureProperties.java new file mode 100644 index 0000000000000..be4a10efa2e96 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ExposureProperties.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing exposure level of the image. + */ +@Immutable +public final class ExposureProperties { + /* + * An enum value indicating level of exposure. + */ + @Generated + @JsonProperty(value = "exposureLevel") + private final ExposureLevel exposureLevel; + + /* + * A number indicating level of exposure level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. + */ + @Generated + @JsonProperty(value = "value") + private final double value; + + /** + * Creates an instance of ExposureProperties class. + * + * @param exposureLevel the exposureLevel value to set. + * @param value the value value to set. + */ + @Generated + @JsonCreator + private ExposureProperties(@JsonProperty(value = "exposureLevel") ExposureLevel exposureLevel, + @JsonProperty(value = "value") double value) { + this.exposureLevel = exposureLevel; + this.value = value; + } + + /** + * Get the exposureLevel property: An enum value indicating level of exposure. + * + * @return the exposureLevel value. + */ + @Generated + public ExposureLevel getExposureLevel() { + return this.exposureLevel; + } + + /** + * Get the value property: A number indicating level of exposure level ranging from 0 to 1. [0, 0.25) is under + * exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributeType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributeType.java new file mode 100644 index 0000000000000..458399b343fca --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributeType.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Available options for detect face with attribute. + */ +public final class FaceAttributeType extends ExpandableStringEnum { + /** + * 3-D roll/yaw/pitch angles for face direction. + */ + @Generated + public static final FaceAttributeType HEAD_POSE = fromString("headPose"); + + /** + * Glasses type. Values include 'NoGlasses', 'ReadingGlasses', 'Sunglasses', 'SwimmingGoggles'. + */ + @Generated + public static final FaceAttributeType GLASSES = fromString("glasses"); + + /** + * Whether each facial area is occluded, including forehead, eyes and mouth. + */ + @Generated + public static final FaceAttributeType OCCLUSION = fromString("occlusion"); + + /** + * Accessories around face, including 'headwear', 'glasses' and 'mask'. Empty array means no accessories detected. + * Note this is after a face is detected. Large mask could result in no face to be detected. + */ + @Generated + public static final FaceAttributeType ACCESSORIES = fromString("accessories"); + + /** + * Face is blurry or not. Level returns 'Low', 'Medium' or 'High'. Value returns a number between [0,1], the larger + * the blurrier. + */ + @Generated + public static final FaceAttributeType BLUR = fromString("blur"); + + /** + * Face exposure level. Level returns 'GoodExposure', 'OverExposure' or 'UnderExposure'. + */ + @Generated + public static final FaceAttributeType EXPOSURE = fromString("exposure"); + + /** + * Noise level of face pixels. Level returns 'Low', 'Medium' and 'High'. Value returns a number between [0,1], the + * larger the noisier. + */ + @Generated + public static final FaceAttributeType NOISE = fromString("noise"); + + /** + * Whether each face is wearing a mask. Mask type returns 'noMask', 'faceMask', 'otherMaskOrOcclusion', or + * 'uncertain'. Value returns a boolean 'noseAndMouthCovered' indicating whether nose and mouth are covered. + */ + @Generated + public static final FaceAttributeType MASK = fromString("mask"); + + /** + * The overall image quality regarding whether the image being used in the detection is of sufficient quality to + * attempt face recognition on. The value is an informal rating of low, medium, or high. Only 'high' quality images + * are recommended for person enrollment and quality at or above 'medium' is recommended for identification + * scenarios. The attribute is only available when using any combinations of detection models detection_01 or + * detection_03, and recognition models recognition_03 or recognition_04. + */ + @Generated + public static final FaceAttributeType QUALITY_FOR_RECOGNITION = fromString("qualityForRecognition"); + + /** + * Age in years. + */ + @Generated + public static final FaceAttributeType AGE = fromString("age"); + + /** + * Smile intensity, a number between [0,1]. + */ + @Generated + public static final FaceAttributeType SMILE = fromString("smile"); + + /** + * Properties describing facial hair attributes. + */ + @Generated + public static final FaceAttributeType FACIAL_HAIR = fromString("facialHair"); + + /** + * Properties describing hair attributes. + */ + @Generated + public static final FaceAttributeType HAIR = fromString("hair"); + + /** + * Creates a new instance of FaceAttributeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceAttributeType() { + } + + /** + * Creates or finds a FaceAttributeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceAttributeType. + */ + @Generated + @JsonCreator + public static FaceAttributeType fromString(String name) { + return fromString(name, FaceAttributeType.class); + } + + /** + * Gets known FaceAttributeType values. + * + * @return known FaceAttributeType values. + */ + @Generated + public static Collection values() { + return values(FaceAttributeType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributes.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributes.java new file mode 100644 index 0000000000000..3e1f80e61e9d3 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceAttributes.java @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Face attributes for the detected face. + */ +@Immutable +public final class FaceAttributes { + /* + * Age in years. + */ + @Generated + @JsonProperty(value = "age") + private Double age; + + /* + * Smile intensity, a number between [0,1]. + */ + @Generated + @JsonProperty(value = "smile") + private Double smile; + + /* + * Properties describing facial hair attributes. + */ + @Generated + @JsonProperty(value = "facialHair") + private FacialHair facialHair; + + /* + * Glasses type if any of the face. + */ + @Generated + @JsonProperty(value = "glasses") + private GlassesType glasses; + + /* + * 3-D roll/yaw/pitch angles for face direction. + */ + @Generated + @JsonProperty(value = "headPose") + private HeadPose headPose; + + /* + * Properties describing hair attributes. + */ + @Generated + @JsonProperty(value = "hair") + private HairProperties hair; + + /* + * Properties describing occlusions on a given face. + */ + @Generated + @JsonProperty(value = "occlusion") + private OcclusionProperties occlusion; + + /* + * Properties describing any accessories on a given face. + */ + @Generated + @JsonProperty(value = "accessories") + private List accessories; + + /* + * Properties describing any presence of blur within the image. + */ + @Generated + @JsonProperty(value = "blur") + private BlurProperties blur; + + /* + * Properties describing exposure level of the image. + */ + @Generated + @JsonProperty(value = "exposure") + private ExposureProperties exposure; + + /* + * Properties describing noise level of the image. + */ + @Generated + @JsonProperty(value = "noise") + private NoiseProperties noise; + + /* + * Properties describing the presence of a mask on a given face. + */ + @Generated + @JsonProperty(value = "mask") + private MaskProperties mask; + + /* + * Properties describing the overall image quality regarding whether the image being used in the detection is of sufficient quality to attempt face recognition on. + */ + @Generated + @JsonProperty(value = "qualityForRecognition") + private QualityForRecognition qualityForRecognition; + + /** + * Creates an instance of FaceAttributes class. + */ + @Generated + private FaceAttributes() { + } + + /** + * Get the age property: Age in years. + * + * @return the age value. + */ + @Generated + public Double getAge() { + return this.age; + } + + /** + * Get the smile property: Smile intensity, a number between [0,1]. + * + * @return the smile value. + */ + @Generated + public Double getSmile() { + return this.smile; + } + + /** + * Get the facialHair property: Properties describing facial hair attributes. + * + * @return the facialHair value. + */ + @Generated + public FacialHair getFacialHair() { + return this.facialHair; + } + + /** + * Get the glasses property: Glasses type if any of the face. + * + * @return the glasses value. + */ + @Generated + public GlassesType getGlasses() { + return this.glasses; + } + + /** + * Get the headPose property: 3-D roll/yaw/pitch angles for face direction. + * + * @return the headPose value. + */ + @Generated + public HeadPose getHeadPose() { + return this.headPose; + } + + /** + * Get the hair property: Properties describing hair attributes. + * + * @return the hair value. + */ + @Generated + public HairProperties getHair() { + return this.hair; + } + + /** + * Get the occlusion property: Properties describing occlusions on a given face. + * + * @return the occlusion value. + */ + @Generated + public OcclusionProperties getOcclusion() { + return this.occlusion; + } + + /** + * Get the accessories property: Properties describing any accessories on a given face. + * + * @return the accessories value. + */ + @Generated + public List getAccessories() { + return this.accessories; + } + + /** + * Get the blur property: Properties describing any presence of blur within the image. + * + * @return the blur value. + */ + @Generated + public BlurProperties getBlur() { + return this.blur; + } + + /** + * Get the exposure property: Properties describing exposure level of the image. + * + * @return the exposure value. + */ + @Generated + public ExposureProperties getExposure() { + return this.exposure; + } + + /** + * Get the noise property: Properties describing noise level of the image. + * + * @return the noise value. + */ + @Generated + public NoiseProperties getNoise() { + return this.noise; + } + + /** + * Get the mask property: Properties describing the presence of a mask on a given face. + * + * @return the mask value. + */ + @Generated + public MaskProperties getMask() { + return this.mask; + } + + /** + * Get the qualityForRecognition property: Properties describing the overall image quality regarding whether the + * image being used in the detection is of sufficient quality to attempt face recognition on. + * + * @return the qualityForRecognition value. + */ + @Generated + public QualityForRecognition getQualityForRecognition() { + return this.qualityForRecognition; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceCollectionTrainingResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceCollectionTrainingResult.java new file mode 100644 index 0000000000000..d046dbe63cfeb --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceCollectionTrainingResult.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Training result of a container. + */ +@Immutable +public final class FaceCollectionTrainingResult { + /* + * Training status of the container. + */ + @Generated + @JsonProperty(value = "status") + private final FaceOperationStatus status; + + /* + * A combined UTC date and time string that describes the created time of the person group, large person group or large face list. + */ + @Generated + @JsonProperty(value = "createdDateTime") + private final OffsetDateTime createdDateTime; + + /* + * A combined UTC date and time string that describes the last modify time of the person group, large person group or large face list, could be null value when the group is not successfully trained. + */ + @Generated + @JsonProperty(value = "lastActionDateTime") + private final OffsetDateTime lastActionDateTime; + + /* + * A combined UTC date and time string that describes the last successful training time of the person group, large person group or large face list. + */ + @Generated + @JsonProperty(value = "lastSuccessfulTrainingDateTime") + private final OffsetDateTime lastSuccessfulTrainingDateTime; + + /* + * Show failure message when training failed (omitted when training succeed). + */ + @Generated + @JsonProperty(value = "message") + private String message; + + /** + * Creates an instance of FaceCollectionTrainingResult class. + * + * @param status the status value to set. + * @param createdDateTime the createdDateTime value to set. + * @param lastActionDateTime the lastActionDateTime value to set. + * @param lastSuccessfulTrainingDateTime the lastSuccessfulTrainingDateTime value to set. + */ + @Generated + @JsonCreator + private FaceCollectionTrainingResult(@JsonProperty(value = "status") FaceOperationStatus status, + @JsonProperty(value = "createdDateTime") OffsetDateTime createdDateTime, + @JsonProperty(value = "lastActionDateTime") OffsetDateTime lastActionDateTime, + @JsonProperty(value = "lastSuccessfulTrainingDateTime") OffsetDateTime lastSuccessfulTrainingDateTime) { + this.status = status; + this.createdDateTime = createdDateTime; + this.lastActionDateTime = lastActionDateTime; + this.lastSuccessfulTrainingDateTime = lastSuccessfulTrainingDateTime; + } + + /** + * Get the status property: Training status of the container. + * + * @return the status value. + */ + @Generated + public FaceOperationStatus getStatus() { + return this.status; + } + + /** + * Get the createdDateTime property: A combined UTC date and time string that describes the created time of the + * person group, large person group or large face list. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: A combined UTC date and time string that describes the last modify time of + * the person group, large person group or large face list, could be null value when the group is not successfully + * trained. + * + * @return the lastActionDateTime value. + */ + @Generated + public OffsetDateTime getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the lastSuccessfulTrainingDateTime property: A combined UTC date and time string that describes the last + * successful training time of the person group, large person group or large face list. + * + * @return the lastSuccessfulTrainingDateTime value. + */ + @Generated + public OffsetDateTime getLastSuccessfulTrainingDateTime() { + return this.lastSuccessfulTrainingDateTime; + } + + /** + * Get the message property: Show failure message when training failed (omitted when training succeed). + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionModel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionModel.java new file mode 100644 index 0000000000000..88b8d7338b679 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionModel.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The detection model for the face. + */ +public final class FaceDetectionModel extends ExpandableStringEnum { + /** + * The default detection model. Recommend for near frontal face detection. For scenarios with exceptionally large + * angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. + */ + @Generated + public static final FaceDetectionModel DETECTION_01 = fromString("detection_01"); + + /** + * Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. + */ + @Generated + public static final FaceDetectionModel DETECTION_02 = fromString("detection_02"); + + /** + * Detection model released in 2021 February with improved accuracy especially on small faces. + */ + @Generated + public static final FaceDetectionModel DETECTION_03 = fromString("detection_03"); + + /** + * Creates a new instance of FaceDetectionModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceDetectionModel() { + } + + /** + * Creates or finds a FaceDetectionModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceDetectionModel. + */ + @Generated + @JsonCreator + public static FaceDetectionModel fromString(String name) { + return fromString(name, FaceDetectionModel.class); + } + + /** + * Gets known FaceDetectionModel values. + * + * @return known FaceDetectionModel values. + */ + @Generated + public static Collection values() { + return values(FaceDetectionModel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionResult.java new file mode 100644 index 0000000000000..aa8d7c08d4cbf --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceDetectionResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response for detect API. + */ +@Immutable +public final class FaceDetectionResult { + /* + * Unique faceId of the detected face, created by detection API and it will expire 24 hours after the detection call. To return this, it requires 'returnFaceId' parameter to be true. + */ + @Generated + @JsonProperty(value = "faceId") + private String faceId; + + /* + * The 'recognitionModel' associated with this faceId. This is only returned when 'returnRecognitionModel' is explicitly set as true. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * A rectangle area for the face location on image. + */ + @Generated + @JsonProperty(value = "faceRectangle") + private final FaceRectangle faceRectangle; + + /* + * An array of 27-point face landmarks pointing to the important positions of face components. To return this, it requires 'returnFaceLandmarks' parameter to be true. + */ + @Generated + @JsonProperty(value = "faceLandmarks") + private FaceLandmarks faceLandmarks; + + /* + * Face attributes for detected face. + */ + @Generated + @JsonProperty(value = "faceAttributes") + private FaceAttributes faceAttributes; + + /** + * Creates an instance of FaceDetectionResult class. + * + * @param faceRectangle the faceRectangle value to set. + */ + @Generated + @JsonCreator + private FaceDetectionResult(@JsonProperty(value = "faceRectangle") FaceRectangle faceRectangle) { + this.faceRectangle = faceRectangle; + } + + /** + * Get the faceId property: Unique faceId of the detected face, created by detection API and it will expire 24 hours + * after the detection call. To return this, it requires 'returnFaceId' parameter to be true. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the recognitionModel property: The 'recognitionModel' associated with this faceId. This is only returned when + * 'returnRecognitionModel' is explicitly set as true. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the faceRectangle property: A rectangle area for the face location on image. + * + * @return the faceRectangle value. + */ + @Generated + public FaceRectangle getFaceRectangle() { + return this.faceRectangle; + } + + /** + * Get the faceLandmarks property: An array of 27-point face landmarks pointing to the important positions of face + * components. To return this, it requires 'returnFaceLandmarks' parameter to be true. + * + * @return the faceLandmarks value. + */ + @Generated + public FaceLandmarks getFaceLandmarks() { + return this.faceLandmarks; + } + + /** + * Get the faceAttributes property: Face attributes for detected face. + * + * @return the faceAttributes value. + */ + @Generated + public FaceAttributes getFaceAttributes() { + return this.faceAttributes; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceFindSimilarResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceFindSimilarResult.java new file mode 100644 index 0000000000000..29654a0e5f8ee --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceFindSimilarResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response body for find similar face operation. + */ +@Immutable +public final class FaceFindSimilarResult { + /* + * Confidence value of the candidate. The higher confidence, the more similar. Range between [0,1]. + */ + @Generated + @JsonProperty(value = "confidence") + private final double confidence; + + /* + * faceId of candidate face when find by faceIds. faceId is created by "Detect" and will expire 24 hours after the detection call. + */ + @Generated + @JsonProperty(value = "faceId") + private String faceId; + + /* + * persistedFaceId of candidate face when find by faceListId or largeFaceListId. persistedFaceId in face list/large face list is persisted and will not expire. + */ + @Generated + @JsonProperty(value = "persistedFaceId") + private String persistedFaceId; + + /** + * Creates an instance of FaceFindSimilarResult class. + * + * @param confidence the confidence value to set. + */ + @Generated + @JsonCreator + private FaceFindSimilarResult(@JsonProperty(value = "confidence") double confidence) { + this.confidence = confidence; + } + + /** + * Get the confidence property: Confidence value of the candidate. The higher confidence, the more similar. Range + * between [0,1]. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } + + /** + * Get the faceId property: faceId of candidate face when find by faceIds. faceId is created by "Detect" and will + * expire 24 hours after the detection call. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the persistedFaceId property: persistedFaceId of candidate face when find by faceListId or largeFaceListId. + * persistedFaceId in face list/large face list is persisted and will not expire. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceGroupingResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceGroupingResult.java new file mode 100644 index 0000000000000..12f7fec391cb2 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceGroupingResult.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response body for group face operation. + */ +@Immutable +public final class FaceGroupingResult { + /* + * A partition of the original faces based on face similarity. Groups are ranked by number of faces. + */ + @Generated + @JsonProperty(value = "groups") + private final List> groups; + + /* + * Face ids array of faces that cannot find any similar faces from original faces. + */ + @Generated + @JsonProperty(value = "messyGroup") + private final List messyGroup; + + /** + * Creates an instance of FaceGroupingResult class. + * + * @param groups the groups value to set. + * @param messyGroup the messyGroup value to set. + */ + @Generated + @JsonCreator + private FaceGroupingResult(@JsonProperty(value = "groups") List> groups, + @JsonProperty(value = "messyGroup") List messyGroup) { + this.groups = groups; + this.messyGroup = messyGroup; + } + + /** + * Get the groups property: A partition of the original faces based on face similarity. Groups are ranked by number + * of faces. + * + * @return the groups value. + */ + @Generated + public List> getGroups() { + return this.groups; + } + + /** + * Get the messyGroup property: Face ids array of faces that cannot find any similar faces from original faces. + * + * @return the messyGroup value. + */ + @Generated + public List getMessyGroup() { + return this.messyGroup; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java new file mode 100644 index 0000000000000..184065c9c0aaf --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationCandidate.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Candidate for identify call. + */ +@Immutable +public final class FaceIdentificationCandidate { + /* + * personId of candidate person. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /* + * Confidence value of the candidate. The higher confidence, the more similar. Range between [0,1]. + */ + @Generated + @JsonProperty(value = "confidence") + private final double confidence; + + /** + * Creates an instance of FaceIdentificationCandidate class. + * + * @param personId the personId value to set. + * @param confidence the confidence value to set. + */ + @Generated + @JsonCreator + private FaceIdentificationCandidate(@JsonProperty(value = "personId") String personId, + @JsonProperty(value = "confidence") double confidence) { + this.personId = personId; + this.confidence = confidence; + } + + /** + * Get the personId property: personId of candidate person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the confidence property: Confidence value of the candidate. The higher confidence, the more similar. Range + * between [0,1]. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.java new file mode 100644 index 0000000000000..7f24805f16bb2 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceIdentificationResult.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Identify result. + */ +@Immutable +public final class FaceIdentificationResult { + /* + * faceId of the query face. + */ + @Generated + @JsonProperty(value = "faceId") + private final String faceId; + + /* + * Identified person candidates for that face (ranked by confidence). Array size should be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array. + */ + @Generated + @JsonProperty(value = "candidates") + private final List candidates; + + /** + * Creates an instance of FaceIdentificationResult class. + * + * @param faceId the faceId value to set. + * @param candidates the candidates value to set. + */ + @Generated + @JsonCreator + private FaceIdentificationResult(@JsonProperty(value = "faceId") String faceId, + @JsonProperty(value = "candidates") List candidates) { + this.faceId = faceId; + this.candidates = candidates; + } + + /** + * Get the faceId property: faceId of the query face. + * + * @return the faceId value. + */ + @Generated + public String getFaceId() { + return this.faceId; + } + + /** + * Get the candidates property: Identified person candidates for that face (ranked by confidence). Array size should + * be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array. + * + * @return the candidates value. + */ + @Generated + public List getCandidates() { + return this.candidates; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceImageType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceImageType.java new file mode 100644 index 0000000000000..23daa9388f815 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceImageType.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The type of image. + */ +public final class FaceImageType extends ExpandableStringEnum { + /** + * Color image. + */ + @Generated + public static final FaceImageType COLOR = fromString("Color"); + + /** + * Infrared image. + */ + @Generated + public static final FaceImageType INFRARED = fromString("Infrared"); + + /** + * Depth image. + */ + @Generated + public static final FaceImageType DEPTH = fromString("Depth"); + + /** + * Creates a new instance of FaceImageType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceImageType() { + } + + /** + * Creates or finds a FaceImageType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceImageType. + */ + @Generated + @JsonCreator + public static FaceImageType fromString(String name) { + return fromString(name, FaceImageType.class); + } + + /** + * Gets known FaceImageType values. + * + * @return known FaceImageType values. + */ + @Generated + public static Collection values() { + return values(FaceImageType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLandmarks.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLandmarks.java new file mode 100644 index 0000000000000..fbc40d989078b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLandmarks.java @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A collection of 27-point face landmarks pointing to the important positions of face components. + */ +@Immutable +public final class FaceLandmarks { + /* + * The coordinates of the left eye pupil. + */ + @Generated + @JsonProperty(value = "pupilLeft") + private final LandmarkCoordinate pupilLeft; + + /* + * The coordinates of the right eye pupil. + */ + @Generated + @JsonProperty(value = "pupilRight") + private final LandmarkCoordinate pupilRight; + + /* + * The coordinates of the nose tip. + */ + @Generated + @JsonProperty(value = "noseTip") + private final LandmarkCoordinate noseTip; + + /* + * The coordinates of the mouth left. + */ + @Generated + @JsonProperty(value = "mouthLeft") + private final LandmarkCoordinate mouthLeft; + + /* + * The coordinates of the mouth right. + */ + @Generated + @JsonProperty(value = "mouthRight") + private final LandmarkCoordinate mouthRight; + + /* + * The coordinates of the left eyebrow outer. + */ + @Generated + @JsonProperty(value = "eyebrowLeftOuter") + private final LandmarkCoordinate eyebrowLeftOuter; + + /* + * The coordinates of the left eyebrow inner. + */ + @Generated + @JsonProperty(value = "eyebrowLeftInner") + private final LandmarkCoordinate eyebrowLeftInner; + + /* + * The coordinates of the left eye outer. + */ + @Generated + @JsonProperty(value = "eyeLeftOuter") + private final LandmarkCoordinate eyeLeftOuter; + + /* + * The coordinates of the left eye top. + */ + @Generated + @JsonProperty(value = "eyeLeftTop") + private final LandmarkCoordinate eyeLeftTop; + + /* + * The coordinates of the left eye bottom. + */ + @Generated + @JsonProperty(value = "eyeLeftBottom") + private final LandmarkCoordinate eyeLeftBottom; + + /* + * The coordinates of the left eye inner. + */ + @Generated + @JsonProperty(value = "eyeLeftInner") + private final LandmarkCoordinate eyeLeftInner; + + /* + * The coordinates of the right eyebrow inner. + */ + @Generated + @JsonProperty(value = "eyebrowRightInner") + private final LandmarkCoordinate eyebrowRightInner; + + /* + * The coordinates of the right eyebrow outer. + */ + @Generated + @JsonProperty(value = "eyebrowRightOuter") + private final LandmarkCoordinate eyebrowRightOuter; + + /* + * The coordinates of the right eye inner. + */ + @Generated + @JsonProperty(value = "eyeRightInner") + private final LandmarkCoordinate eyeRightInner; + + /* + * The coordinates of the right eye top. + */ + @Generated + @JsonProperty(value = "eyeRightTop") + private final LandmarkCoordinate eyeRightTop; + + /* + * The coordinates of the right eye bottom. + */ + @Generated + @JsonProperty(value = "eyeRightBottom") + private final LandmarkCoordinate eyeRightBottom; + + /* + * The coordinates of the right eye outer. + */ + @Generated + @JsonProperty(value = "eyeRightOuter") + private final LandmarkCoordinate eyeRightOuter; + + /* + * The coordinates of the nose root left. + */ + @Generated + @JsonProperty(value = "noseRootLeft") + private final LandmarkCoordinate noseRootLeft; + + /* + * The coordinates of the nose root right. + */ + @Generated + @JsonProperty(value = "noseRootRight") + private final LandmarkCoordinate noseRootRight; + + /* + * The coordinates of the nose left alar top. + */ + @Generated + @JsonProperty(value = "noseLeftAlarTop") + private final LandmarkCoordinate noseLeftAlarTop; + + /* + * The coordinates of the nose right alar top. + */ + @Generated + @JsonProperty(value = "noseRightAlarTop") + private final LandmarkCoordinate noseRightAlarTop; + + /* + * The coordinates of the nose left alar out tip. + */ + @Generated + @JsonProperty(value = "noseLeftAlarOutTip") + private final LandmarkCoordinate noseLeftAlarOutTip; + + /* + * The coordinates of the nose right alar out tip. + */ + @Generated + @JsonProperty(value = "noseRightAlarOutTip") + private final LandmarkCoordinate noseRightAlarOutTip; + + /* + * The coordinates of the upper lip top. + */ + @Generated + @JsonProperty(value = "upperLipTop") + private final LandmarkCoordinate upperLipTop; + + /* + * The coordinates of the upper lip bottom. + */ + @Generated + @JsonProperty(value = "upperLipBottom") + private final LandmarkCoordinate upperLipBottom; + + /* + * The coordinates of the under lip top. + */ + @Generated + @JsonProperty(value = "underLipTop") + private final LandmarkCoordinate underLipTop; + + /* + * The coordinates of the under lip bottom. + */ + @Generated + @JsonProperty(value = "underLipBottom") + private final LandmarkCoordinate underLipBottom; + + /** + * Creates an instance of FaceLandmarks class. + * + * @param pupilLeft the pupilLeft value to set. + * @param pupilRight the pupilRight value to set. + * @param noseTip the noseTip value to set. + * @param mouthLeft the mouthLeft value to set. + * @param mouthRight the mouthRight value to set. + * @param eyebrowLeftOuter the eyebrowLeftOuter value to set. + * @param eyebrowLeftInner the eyebrowLeftInner value to set. + * @param eyeLeftOuter the eyeLeftOuter value to set. + * @param eyeLeftTop the eyeLeftTop value to set. + * @param eyeLeftBottom the eyeLeftBottom value to set. + * @param eyeLeftInner the eyeLeftInner value to set. + * @param eyebrowRightInner the eyebrowRightInner value to set. + * @param eyebrowRightOuter the eyebrowRightOuter value to set. + * @param eyeRightInner the eyeRightInner value to set. + * @param eyeRightTop the eyeRightTop value to set. + * @param eyeRightBottom the eyeRightBottom value to set. + * @param eyeRightOuter the eyeRightOuter value to set. + * @param noseRootLeft the noseRootLeft value to set. + * @param noseRootRight the noseRootRight value to set. + * @param noseLeftAlarTop the noseLeftAlarTop value to set. + * @param noseRightAlarTop the noseRightAlarTop value to set. + * @param noseLeftAlarOutTip the noseLeftAlarOutTip value to set. + * @param noseRightAlarOutTip the noseRightAlarOutTip value to set. + * @param upperLipTop the upperLipTop value to set. + * @param upperLipBottom the upperLipBottom value to set. + * @param underLipTop the underLipTop value to set. + * @param underLipBottom the underLipBottom value to set. + */ + @Generated + @JsonCreator + private FaceLandmarks(@JsonProperty(value = "pupilLeft") LandmarkCoordinate pupilLeft, + @JsonProperty(value = "pupilRight") LandmarkCoordinate pupilRight, + @JsonProperty(value = "noseTip") LandmarkCoordinate noseTip, + @JsonProperty(value = "mouthLeft") LandmarkCoordinate mouthLeft, + @JsonProperty(value = "mouthRight") LandmarkCoordinate mouthRight, + @JsonProperty(value = "eyebrowLeftOuter") LandmarkCoordinate eyebrowLeftOuter, + @JsonProperty(value = "eyebrowLeftInner") LandmarkCoordinate eyebrowLeftInner, + @JsonProperty(value = "eyeLeftOuter") LandmarkCoordinate eyeLeftOuter, + @JsonProperty(value = "eyeLeftTop") LandmarkCoordinate eyeLeftTop, + @JsonProperty(value = "eyeLeftBottom") LandmarkCoordinate eyeLeftBottom, + @JsonProperty(value = "eyeLeftInner") LandmarkCoordinate eyeLeftInner, + @JsonProperty(value = "eyebrowRightInner") LandmarkCoordinate eyebrowRightInner, + @JsonProperty(value = "eyebrowRightOuter") LandmarkCoordinate eyebrowRightOuter, + @JsonProperty(value = "eyeRightInner") LandmarkCoordinate eyeRightInner, + @JsonProperty(value = "eyeRightTop") LandmarkCoordinate eyeRightTop, + @JsonProperty(value = "eyeRightBottom") LandmarkCoordinate eyeRightBottom, + @JsonProperty(value = "eyeRightOuter") LandmarkCoordinate eyeRightOuter, + @JsonProperty(value = "noseRootLeft") LandmarkCoordinate noseRootLeft, + @JsonProperty(value = "noseRootRight") LandmarkCoordinate noseRootRight, + @JsonProperty(value = "noseLeftAlarTop") LandmarkCoordinate noseLeftAlarTop, + @JsonProperty(value = "noseRightAlarTop") LandmarkCoordinate noseRightAlarTop, + @JsonProperty(value = "noseLeftAlarOutTip") LandmarkCoordinate noseLeftAlarOutTip, + @JsonProperty(value = "noseRightAlarOutTip") LandmarkCoordinate noseRightAlarOutTip, + @JsonProperty(value = "upperLipTop") LandmarkCoordinate upperLipTop, + @JsonProperty(value = "upperLipBottom") LandmarkCoordinate upperLipBottom, + @JsonProperty(value = "underLipTop") LandmarkCoordinate underLipTop, + @JsonProperty(value = "underLipBottom") LandmarkCoordinate underLipBottom) { + this.pupilLeft = pupilLeft; + this.pupilRight = pupilRight; + this.noseTip = noseTip; + this.mouthLeft = mouthLeft; + this.mouthRight = mouthRight; + this.eyebrowLeftOuter = eyebrowLeftOuter; + this.eyebrowLeftInner = eyebrowLeftInner; + this.eyeLeftOuter = eyeLeftOuter; + this.eyeLeftTop = eyeLeftTop; + this.eyeLeftBottom = eyeLeftBottom; + this.eyeLeftInner = eyeLeftInner; + this.eyebrowRightInner = eyebrowRightInner; + this.eyebrowRightOuter = eyebrowRightOuter; + this.eyeRightInner = eyeRightInner; + this.eyeRightTop = eyeRightTop; + this.eyeRightBottom = eyeRightBottom; + this.eyeRightOuter = eyeRightOuter; + this.noseRootLeft = noseRootLeft; + this.noseRootRight = noseRootRight; + this.noseLeftAlarTop = noseLeftAlarTop; + this.noseRightAlarTop = noseRightAlarTop; + this.noseLeftAlarOutTip = noseLeftAlarOutTip; + this.noseRightAlarOutTip = noseRightAlarOutTip; + this.upperLipTop = upperLipTop; + this.upperLipBottom = upperLipBottom; + this.underLipTop = underLipTop; + this.underLipBottom = underLipBottom; + } + + /** + * Get the pupilLeft property: The coordinates of the left eye pupil. + * + * @return the pupilLeft value. + */ + @Generated + public LandmarkCoordinate getPupilLeft() { + return this.pupilLeft; + } + + /** + * Get the pupilRight property: The coordinates of the right eye pupil. + * + * @return the pupilRight value. + */ + @Generated + public LandmarkCoordinate getPupilRight() { + return this.pupilRight; + } + + /** + * Get the noseTip property: The coordinates of the nose tip. + * + * @return the noseTip value. + */ + @Generated + public LandmarkCoordinate getNoseTip() { + return this.noseTip; + } + + /** + * Get the mouthLeft property: The coordinates of the mouth left. + * + * @return the mouthLeft value. + */ + @Generated + public LandmarkCoordinate getMouthLeft() { + return this.mouthLeft; + } + + /** + * Get the mouthRight property: The coordinates of the mouth right. + * + * @return the mouthRight value. + */ + @Generated + public LandmarkCoordinate getMouthRight() { + return this.mouthRight; + } + + /** + * Get the eyebrowLeftOuter property: The coordinates of the left eyebrow outer. + * + * @return the eyebrowLeftOuter value. + */ + @Generated + public LandmarkCoordinate getEyebrowLeftOuter() { + return this.eyebrowLeftOuter; + } + + /** + * Get the eyebrowLeftInner property: The coordinates of the left eyebrow inner. + * + * @return the eyebrowLeftInner value. + */ + @Generated + public LandmarkCoordinate getEyebrowLeftInner() { + return this.eyebrowLeftInner; + } + + /** + * Get the eyeLeftOuter property: The coordinates of the left eye outer. + * + * @return the eyeLeftOuter value. + */ + @Generated + public LandmarkCoordinate getEyeLeftOuter() { + return this.eyeLeftOuter; + } + + /** + * Get the eyeLeftTop property: The coordinates of the left eye top. + * + * @return the eyeLeftTop value. + */ + @Generated + public LandmarkCoordinate getEyeLeftTop() { + return this.eyeLeftTop; + } + + /** + * Get the eyeLeftBottom property: The coordinates of the left eye bottom. + * + * @return the eyeLeftBottom value. + */ + @Generated + public LandmarkCoordinate getEyeLeftBottom() { + return this.eyeLeftBottom; + } + + /** + * Get the eyeLeftInner property: The coordinates of the left eye inner. + * + * @return the eyeLeftInner value. + */ + @Generated + public LandmarkCoordinate getEyeLeftInner() { + return this.eyeLeftInner; + } + + /** + * Get the eyebrowRightInner property: The coordinates of the right eyebrow inner. + * + * @return the eyebrowRightInner value. + */ + @Generated + public LandmarkCoordinate getEyebrowRightInner() { + return this.eyebrowRightInner; + } + + /** + * Get the eyebrowRightOuter property: The coordinates of the right eyebrow outer. + * + * @return the eyebrowRightOuter value. + */ + @Generated + public LandmarkCoordinate getEyebrowRightOuter() { + return this.eyebrowRightOuter; + } + + /** + * Get the eyeRightInner property: The coordinates of the right eye inner. + * + * @return the eyeRightInner value. + */ + @Generated + public LandmarkCoordinate getEyeRightInner() { + return this.eyeRightInner; + } + + /** + * Get the eyeRightTop property: The coordinates of the right eye top. + * + * @return the eyeRightTop value. + */ + @Generated + public LandmarkCoordinate getEyeRightTop() { + return this.eyeRightTop; + } + + /** + * Get the eyeRightBottom property: The coordinates of the right eye bottom. + * + * @return the eyeRightBottom value. + */ + @Generated + public LandmarkCoordinate getEyeRightBottom() { + return this.eyeRightBottom; + } + + /** + * Get the eyeRightOuter property: The coordinates of the right eye outer. + * + * @return the eyeRightOuter value. + */ + @Generated + public LandmarkCoordinate getEyeRightOuter() { + return this.eyeRightOuter; + } + + /** + * Get the noseRootLeft property: The coordinates of the nose root left. + * + * @return the noseRootLeft value. + */ + @Generated + public LandmarkCoordinate getNoseRootLeft() { + return this.noseRootLeft; + } + + /** + * Get the noseRootRight property: The coordinates of the nose root right. + * + * @return the noseRootRight value. + */ + @Generated + public LandmarkCoordinate getNoseRootRight() { + return this.noseRootRight; + } + + /** + * Get the noseLeftAlarTop property: The coordinates of the nose left alar top. + * + * @return the noseLeftAlarTop value. + */ + @Generated + public LandmarkCoordinate getNoseLeftAlarTop() { + return this.noseLeftAlarTop; + } + + /** + * Get the noseRightAlarTop property: The coordinates of the nose right alar top. + * + * @return the noseRightAlarTop value. + */ + @Generated + public LandmarkCoordinate getNoseRightAlarTop() { + return this.noseRightAlarTop; + } + + /** + * Get the noseLeftAlarOutTip property: The coordinates of the nose left alar out tip. + * + * @return the noseLeftAlarOutTip value. + */ + @Generated + public LandmarkCoordinate getNoseLeftAlarOutTip() { + return this.noseLeftAlarOutTip; + } + + /** + * Get the noseRightAlarOutTip property: The coordinates of the nose right alar out tip. + * + * @return the noseRightAlarOutTip value. + */ + @Generated + public LandmarkCoordinate getNoseRightAlarOutTip() { + return this.noseRightAlarOutTip; + } + + /** + * Get the upperLipTop property: The coordinates of the upper lip top. + * + * @return the upperLipTop value. + */ + @Generated + public LandmarkCoordinate getUpperLipTop() { + return this.upperLipTop; + } + + /** + * Get the upperLipBottom property: The coordinates of the upper lip bottom. + * + * @return the upperLipBottom value. + */ + @Generated + public LandmarkCoordinate getUpperLipBottom() { + return this.upperLipBottom; + } + + /** + * Get the underLipTop property: The coordinates of the under lip top. + * + * @return the underLipTop value. + */ + @Generated + public LandmarkCoordinate getUnderLipTop() { + return this.underLipTop; + } + + /** + * Get the underLipBottom property: The coordinates of the under lip bottom. + * + * @return the underLipBottom value. + */ + @Generated + public LandmarkCoordinate getUnderLipBottom() { + return this.underLipBottom; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceList.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceList.java new file mode 100644 index 0000000000000..73c75e8b1fcf6 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceList.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Face list is a list of faces, up to 1,000 faces. + */ +@Immutable +public final class FaceList { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + */ + @Generated + @JsonProperty(value = "faceListId", access = JsonProperty.Access.WRITE_ONLY) + private String faceListId; + + /* + * Face ids of registered faces in the face list. + */ + @Generated + @JsonProperty(value = "persistedFaces") + private List persistedFaces; + + /** + * Creates an instance of FaceList class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private FaceList(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the faceListId property: Valid character is letter in lower case or digit or '-' or '_', maximum length is + * 64. + * + * @return the faceListId value. + */ + @Generated + public String getFaceListId() { + return this.faceListId; + } + + /** + * Get the persistedFaces property: Face ids of registered faces in the face list. + * + * @return the persistedFaces value. + */ + @Generated + public List getPersistedFaces() { + return this.persistedFaces; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListFace.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListFace.java new file mode 100644 index 0000000000000..c0661779052af --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListFace.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face resource for face list. + */ +@Immutable +public final class FaceListFace { + /* + * Face ID of the face. + */ + @Generated + @JsonProperty(value = "persistedFaceId", access = JsonProperty.Access.WRITE_ONLY) + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of FaceListFace class. + */ + @Generated + private FaceListFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListItem.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListItem.java new file mode 100644 index 0000000000000..944071fc03088 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceListItem.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face list item for list face list. + */ +@Immutable +public final class FaceListItem { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + */ + @Generated + @JsonProperty(value = "faceListId") + private final String faceListId; + + /** + * Creates an instance of FaceListItem class. + * + * @param name the name value to set. + * @param faceListId the faceListId value to set. + */ + @Generated + @JsonCreator + private FaceListItem(@JsonProperty(value = "name") String name, + @JsonProperty(value = "faceListId") String faceListId) { + this.name = name; + this.faceListId = faceListId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the faceListId property: Valid character is letter in lower case or digit or '-' or '_', maximum length is + * 64. + * + * @return the faceListId value. + */ + @Generated + public String getFaceListId() { + return this.faceListId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLivenessDecision.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLivenessDecision.java new file mode 100644 index 0000000000000..be5ca91d7257d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceLivenessDecision.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The outcome of the liveness classification. + */ +public final class FaceLivenessDecision extends ExpandableStringEnum { + /** + * The algorithm could not classify the target face as either real or spoof. + */ + @Generated + public static final FaceLivenessDecision UNCERTAIN = fromString("uncertain"); + + /** + * The algorithm has classified the target face as real. + */ + @Generated + public static final FaceLivenessDecision REAL_FACE = fromString("realface"); + + /** + * The algorithm has classified the target face as a spoof. + */ + @Generated + public static final FaceLivenessDecision SPOOF_FACE = fromString("spoofface"); + + /** + * Creates a new instance of FaceLivenessDecision value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceLivenessDecision() { + } + + /** + * Creates or finds a FaceLivenessDecision from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceLivenessDecision. + */ + @Generated + @JsonCreator + public static FaceLivenessDecision fromString(String name) { + return fromString(name, FaceLivenessDecision.class); + } + + /** + * Gets known FaceLivenessDecision values. + * + * @return known FaceLivenessDecision values. + */ + @Generated + public static Collection values() { + return values(FaceLivenessDecision.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationResult.java new file mode 100644 index 0000000000000..ac2cb526db42d --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationResult.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Long running operation resource for person directory. + */ +@Immutable +public final class FaceOperationResult { + /* + * Operation ID of the operation. + */ + @Generated + @JsonProperty(value = "operationId", access = JsonProperty.Access.WRITE_ONLY) + private String operationId; + + /* + * Current status of the operation. + */ + @Generated + @JsonProperty(value = "status") + private final FaceOperationStatus status; + + /* + * Date and time the operation was created. + */ + @Generated + @JsonProperty(value = "createdTime") + private final OffsetDateTime createdTime; + + /* + * Date and time the operation was last updated. + */ + @Generated + @JsonProperty(value = "lastActionTime") + private OffsetDateTime lastActionTime; + + /* + * Date and time the operation was finished. + */ + @Generated + @JsonProperty(value = "finishedTime") + private OffsetDateTime finishedTime; + + /* + * Message for the operation. + */ + @Generated + @JsonProperty(value = "message") + private String message; + + /** + * Creates an instance of FaceOperationResult class. + * + * @param status the status value to set. + * @param createdTime the createdTime value to set. + */ + @Generated + @JsonCreator + private FaceOperationResult(@JsonProperty(value = "status") FaceOperationStatus status, + @JsonProperty(value = "createdTime") OffsetDateTime createdTime) { + this.status = status; + this.createdTime = createdTime; + } + + /** + * Get the operationId property: Operation ID of the operation. + * + * @return the operationId value. + */ + @Generated + public String getOperationId() { + return this.operationId; + } + + /** + * Get the status property: Current status of the operation. + * + * @return the status value. + */ + @Generated + public FaceOperationStatus getStatus() { + return this.status; + } + + /** + * Get the createdTime property: Date and time the operation was created. + * + * @return the createdTime value. + */ + @Generated + public OffsetDateTime getCreatedTime() { + return this.createdTime; + } + + /** + * Get the lastActionTime property: Date and time the operation was last updated. + * + * @return the lastActionTime value. + */ + @Generated + public OffsetDateTime getLastActionTime() { + return this.lastActionTime; + } + + /** + * Get the finishedTime property: Date and time the operation was finished. + * + * @return the finishedTime value. + */ + @Generated + public OffsetDateTime getFinishedTime() { + return this.finishedTime; + } + + /** + * Get the message property: Message for the operation. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java new file mode 100644 index 0000000000000..7716789b14124 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceOperationStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The status of long running operation. + */ +public final class FaceOperationStatus extends ExpandableStringEnum { + /** + * The operation is not started. + */ + @Generated + public static final FaceOperationStatus NOT_STARTED = fromString("notStarted"); + + /** + * The operation is still running. + */ + @Generated + public static final FaceOperationStatus RUNNING = fromString("running"); + + /** + * The operation is succeeded. + */ + @Generated + public static final FaceOperationStatus SUCCEEDED = fromString("succeeded"); + + /** + * The operation is failed. + */ + @Generated + public static final FaceOperationStatus FAILED = fromString("failed"); + + /** + * Creates a new instance of FaceOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceOperationStatus() { + } + + /** + * Creates or finds a FaceOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceOperationStatus. + */ + @Generated + @JsonCreator + public static FaceOperationStatus fromString(String name) { + return fromString(name, FaceOperationStatus.class); + } + + /** + * Gets known FaceOperationStatus values. + * + * @return known FaceOperationStatus values. + */ + @Generated + public static Collection values() { + return values(FaceOperationStatus.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRecognitionModel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRecognitionModel.java new file mode 100644 index 0000000000000..cd85275baa011 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRecognitionModel.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The recognition model for the face. + */ +public final class FaceRecognitionModel extends ExpandableStringEnum { + /** + * The default recognition model for "Detect". All those faceIds created before 2019 March are bonded with this + * recognition model. + */ + @Generated + public static final FaceRecognitionModel RECOGNITION_01 = fromString("recognition_01"); + + /** + * Recognition model released in 2019 March. + */ + @Generated + public static final FaceRecognitionModel RECOGNITION_02 = fromString("recognition_02"); + + /** + * Recognition model released in 2020 May. + */ + @Generated + public static final FaceRecognitionModel RECOGNITION_03 = fromString("recognition_03"); + + /** + * Recognition model released in 2021 February. It's recommended to use this recognition model for better + * recognition accuracy. + */ + @Generated + public static final FaceRecognitionModel RECOGNITION_04 = fromString("recognition_04"); + + /** + * Creates a new instance of FaceRecognitionModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceRecognitionModel() { + } + + /** + * Creates or finds a FaceRecognitionModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceRecognitionModel. + */ + @Generated + @JsonCreator + public static FaceRecognitionModel fromString(String name) { + return fromString(name, FaceRecognitionModel.class); + } + + /** + * Gets known FaceRecognitionModel values. + * + * @return known FaceRecognitionModel values. + */ + @Generated + public static Collection values() { + return values(FaceRecognitionModel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRectangle.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRectangle.java new file mode 100644 index 0000000000000..64500cbed9c0e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceRectangle.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A rectangle within which a face can be found. + */ +@Immutable +public final class FaceRectangle { + /* + * The distance from the top edge if the image to the top edge of the rectangle, in pixels. + */ + @Generated + @JsonProperty(value = "top") + private final int top; + + /* + * The distance from the left edge if the image to the left edge of the rectangle, in pixels. + */ + @Generated + @JsonProperty(value = "left") + private final int left; + + /* + * The width of the rectangle, in pixels. + */ + @Generated + @JsonProperty(value = "width") + private final int width; + + /* + * The height of the rectangle, in pixels. + */ + @Generated + @JsonProperty(value = "height") + private final int height; + + /** + * Creates an instance of FaceRectangle class. + * + * @param top the top value to set. + * @param left the left value to set. + * @param width the width value to set. + * @param height the height value to set. + */ + @Generated + @JsonCreator + private FaceRectangle(@JsonProperty(value = "top") int top, @JsonProperty(value = "left") int left, + @JsonProperty(value = "width") int width, @JsonProperty(value = "height") int height) { + this.top = top; + this.left = left; + this.width = width; + this.height = height; + } + + /** + * Get the top property: The distance from the top edge if the image to the top edge of the rectangle, in pixels. + * + * @return the top value. + */ + @Generated + public int getTop() { + return this.top; + } + + /** + * Get the left property: The distance from the left edge if the image to the left edge of the rectangle, in pixels. + * + * @return the left value. + */ + @Generated + public int getLeft() { + return this.left; + } + + /** + * Get the width property: The width of the rectangle, in pixels. + * + * @return the width value. + */ + @Generated + public int getWidth() { + return this.width; + } + + /** + * Get the height property: The height of the rectangle, in pixels. + * + * @return the height value. + */ + @Generated + public int getHeight() { + return this.height; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java new file mode 100644 index 0000000000000..8fb399252dbfd --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The current status of the session. + */ +public final class FaceSessionStatus extends ExpandableStringEnum { + /** + * Session has not started. + */ + @Generated + public static final FaceSessionStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Session has started. + */ + @Generated + public static final FaceSessionStatus STARTED = fromString("Started"); + + /** + * Session has available result. + */ + @Generated + public static final FaceSessionStatus RESULT_AVAILABLE = fromString("ResultAvailable"); + + /** + * Creates a new instance of FaceSessionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FaceSessionStatus() { + } + + /** + * Creates or finds a FaceSessionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding FaceSessionStatus. + */ + @Generated + @JsonCreator + public static FaceSessionStatus fromString(String name) { + return fromString(name, FaceSessionStatus.class); + } + + /** + * Gets known FaceSessionStatus values. + * + * @return known FaceSessionStatus values. + */ + @Generated + public static Collection values() { + return values(FaceSessionStatus.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceVerificationResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceVerificationResult.java new file mode 100644 index 0000000000000..8c4e4b32881a5 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceVerificationResult.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Verify result. + */ +@Immutable +public final class FaceVerificationResult { + /* + * True if the two faces belong to the same person or the face belongs to the person, otherwise false. + */ + @Generated + @JsonProperty(value = "isIdentical") + private final boolean isIdentical; + + /* + * A number indicates the similarity confidence of whether two faces belong to the same person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity confidence is greater than or equal to 0.5. This is useful for advanced users to override 'isIdentical' and fine-tune the result on their own data. + */ + @Generated + @JsonProperty(value = "confidence") + private final double confidence; + + /** + * Creates an instance of FaceVerificationResult class. + * + * @param isIdentical the isIdentical value to set. + * @param confidence the confidence value to set. + */ + @Generated + @JsonCreator + private FaceVerificationResult(@JsonProperty(value = "isIdentical") boolean isIdentical, + @JsonProperty(value = "confidence") double confidence) { + this.isIdentical = isIdentical; + this.confidence = confidence; + } + + /** + * Get the isIdentical property: True if the two faces belong to the same person or the face belongs to the person, + * otherwise false. + * + * @return the isIdentical value. + */ + @Generated + public boolean isIdentical() { + return this.isIdentical; + } + + /** + * Get the confidence property: A number indicates the similarity confidence of whether two faces belong to the same + * person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity + * confidence is greater than or equal to 0.5. This is useful for advanced users to override 'isIdentical' and + * fine-tune the result on their own data. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FacialHair.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FacialHair.java new file mode 100644 index 0000000000000..60280de59128c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FacialHair.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing facial hair attributes. + */ +@Immutable +public final class FacialHair { + /* + * A number ranging from 0 to 1 indicating a level of confidence associated with a property. + */ + @Generated + @JsonProperty(value = "moustache") + private final double moustache; + + /* + * A number ranging from 0 to 1 indicating a level of confidence associated with a property. + */ + @Generated + @JsonProperty(value = "beard") + private final double beard; + + /* + * A number ranging from 0 to 1 indicating a level of confidence associated with a property. + */ + @Generated + @JsonProperty(value = "sideburns") + private final double sideburns; + + /** + * Creates an instance of FacialHair class. + * + * @param moustache the moustache value to set. + * @param beard the beard value to set. + * @param sideburns the sideburns value to set. + */ + @Generated + @JsonCreator + private FacialHair(@JsonProperty(value = "moustache") double moustache, @JsonProperty(value = "beard") double beard, + @JsonProperty(value = "sideburns") double sideburns) { + this.moustache = moustache; + this.beard = beard; + this.sideburns = sideburns; + } + + /** + * Get the moustache property: A number ranging from 0 to 1 indicating a level of confidence associated with a + * property. + * + * @return the moustache value. + */ + @Generated + public double getMoustache() { + return this.moustache; + } + + /** + * Get the beard property: A number ranging from 0 to 1 indicating a level of confidence associated with a property. + * + * @return the beard value. + */ + @Generated + public double getBeard() { + return this.beard; + } + + /** + * Get the sideburns property: A number ranging from 0 to 1 indicating a level of confidence associated with a + * property. + * + * @return the sideburns value. + */ + @Generated + public double getSideburns() { + return this.sideburns; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FindSimilarMatchMode.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FindSimilarMatchMode.java new file mode 100644 index 0000000000000..062cc88bcaab0 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FindSimilarMatchMode.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Similar face searching mode. + */ +public final class FindSimilarMatchMode extends ExpandableStringEnum { + /** + * Match person. + */ + @Generated + public static final FindSimilarMatchMode MATCH_PERSON = fromString("matchPerson"); + + /** + * Match face. + */ + @Generated + public static final FindSimilarMatchMode MATCH_FACE = fromString("matchFace"); + + /** + * Creates a new instance of FindSimilarMatchMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FindSimilarMatchMode() { + } + + /** + * Creates or finds a FindSimilarMatchMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding FindSimilarMatchMode. + */ + @Generated + @JsonCreator + public static FindSimilarMatchMode fromString(String name) { + return fromString(name, FindSimilarMatchMode.class); + } + + /** + * Gets known FindSimilarMatchMode values. + * + * @return known FindSimilarMatchMode values. + */ + @Generated + public static Collection values() { + return values(FindSimilarMatchMode.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/GlassesType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/GlassesType.java new file mode 100644 index 0000000000000..789c71bd9c45f --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/GlassesType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Glasses type of the face. + */ +public final class GlassesType extends ExpandableStringEnum { + /** + * No glasses on the face. + */ + @Generated + public static final GlassesType NO_GLASSES = fromString("noGlasses"); + + /** + * Normal glasses on the face. + */ + @Generated + public static final GlassesType READING_GLASSES = fromString("readingGlasses"); + + /** + * Sunglasses on the face. + */ + @Generated + public static final GlassesType SUNGLASSES = fromString("sunglasses"); + + /** + * Swimming goggles on the face. + */ + @Generated + public static final GlassesType SWIMMING_GOGGLES = fromString("swimmingGoggles"); + + /** + * Creates a new instance of GlassesType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GlassesType() { + } + + /** + * Creates or finds a GlassesType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GlassesType. + */ + @Generated + @JsonCreator + public static GlassesType fromString(String name) { + return fromString(name, GlassesType.class); + } + + /** + * Gets known GlassesType values. + * + * @return known GlassesType values. + */ + @Generated + public static Collection values() { + return values(GlassesType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColor.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColor.java new file mode 100644 index 0000000000000..e2fe46f385a1c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColor.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An array of candidate colors and confidence level in the presence of each. + */ +@Immutable +public final class HairColor { + /* + * Name of the hair color. + */ + @Generated + @JsonProperty(value = "color") + private final HairColorType color; + + /* + * Confidence level of the color. Range between [0,1]. + */ + @Generated + @JsonProperty(value = "confidence") + private final double confidence; + + /** + * Creates an instance of HairColor class. + * + * @param color the color value to set. + * @param confidence the confidence value to set. + */ + @Generated + @JsonCreator + private HairColor(@JsonProperty(value = "color") HairColorType color, + @JsonProperty(value = "confidence") double confidence) { + this.color = color; + this.confidence = confidence; + } + + /** + * Get the color property: Name of the hair color. + * + * @return the color value. + */ + @Generated + public HairColorType getColor() { + return this.color; + } + + /** + * Get the confidence property: Confidence level of the color. Range between [0,1]. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColorType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColorType.java new file mode 100644 index 0000000000000..c96cb1905ab76 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairColorType.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Name of the hair color. + */ +public final class HairColorType extends ExpandableStringEnum { + /** + * Unknown. + */ + @Generated + public static final HairColorType UNKNOWN_HAIR_COLOR = fromString("unknown"); + + /** + * White. + */ + @Generated + public static final HairColorType WHITE = fromString("white"); + + /** + * Gray. + */ + @Generated + public static final HairColorType GRAY = fromString("gray"); + + /** + * Blond. + */ + @Generated + public static final HairColorType BLOND = fromString("blond"); + + /** + * Brown. + */ + @Generated + public static final HairColorType BROWN = fromString("brown"); + + /** + * Red. + */ + @Generated + public static final HairColorType RED = fromString("red"); + + /** + * Black. + */ + @Generated + public static final HairColorType BLACK = fromString("black"); + + /** + * Other. + */ + @Generated + public static final HairColorType OTHER = fromString("other"); + + /** + * Creates a new instance of HairColorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public HairColorType() { + } + + /** + * Creates or finds a HairColorType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HairColorType. + */ + @Generated + @JsonCreator + public static HairColorType fromString(String name) { + return fromString(name, HairColorType.class); + } + + /** + * Gets known HairColorType values. + * + * @return known HairColorType values. + */ + @Generated + public static Collection values() { + return values(HairColorType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairProperties.java new file mode 100644 index 0000000000000..9e874b92b8504 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HairProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Properties describing hair attributes. + */ +@Immutable +public final class HairProperties { + /* + * A number describing confidence level of whether the person is bald. + */ + @Generated + @JsonProperty(value = "bald") + private final double bald; + + /* + * A boolean value describing whether the hair is visible in the image. + */ + @Generated + @JsonProperty(value = "invisible") + private final boolean invisible; + + /* + * An array of candidate colors and confidence level in the presence of each. + */ + @Generated + @JsonProperty(value = "hairColor") + private final List hairColor; + + /** + * Creates an instance of HairProperties class. + * + * @param bald the bald value to set. + * @param invisible the invisible value to set. + * @param hairColor the hairColor value to set. + */ + @Generated + @JsonCreator + private HairProperties(@JsonProperty(value = "bald") double bald, + @JsonProperty(value = "invisible") boolean invisible, + @JsonProperty(value = "hairColor") List hairColor) { + this.bald = bald; + this.invisible = invisible; + this.hairColor = hairColor; + } + + /** + * Get the bald property: A number describing confidence level of whether the person is bald. + * + * @return the bald value. + */ + @Generated + public double getBald() { + return this.bald; + } + + /** + * Get the invisible property: A boolean value describing whether the hair is visible in the image. + * + * @return the invisible value. + */ + @Generated + public boolean isInvisible() { + return this.invisible; + } + + /** + * Get the hairColor property: An array of candidate colors and confidence level in the presence of each. + * + * @return the hairColor value. + */ + @Generated + public List getHairColor() { + return this.hairColor; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HeadPose.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HeadPose.java new file mode 100644 index 0000000000000..5bb6ca7c22a62 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/HeadPose.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * 3-D roll/yaw/pitch angles for face direction. + */ +@Immutable +public final class HeadPose { + /* + * Value of angles. + */ + @Generated + @JsonProperty(value = "pitch") + private final double pitch; + + /* + * Value of angles. + */ + @Generated + @JsonProperty(value = "roll") + private final double roll; + + /* + * Value of angles. + */ + @Generated + @JsonProperty(value = "yaw") + private final double yaw; + + /** + * Creates an instance of HeadPose class. + * + * @param pitch the pitch value to set. + * @param roll the roll value to set. + * @param yaw the yaw value to set. + */ + @Generated + @JsonCreator + private HeadPose(@JsonProperty(value = "pitch") double pitch, @JsonProperty(value = "roll") double roll, + @JsonProperty(value = "yaw") double yaw) { + this.pitch = pitch; + this.roll = roll; + this.yaw = yaw; + } + + /** + * Get the pitch property: Value of angles. + * + * @return the pitch value. + */ + @Generated + public double getPitch() { + return this.pitch; + } + + /** + * Get the roll property: Value of angles. + * + * @return the roll value. + */ + @Generated + public double getRoll() { + return this.roll; + } + + /** + * Get the yaw property: Value of angles. + * + * @return the yaw value. + */ + @Generated + public double getYaw() { + return this.yaw; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LandmarkCoordinate.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LandmarkCoordinate.java new file mode 100644 index 0000000000000..e884ba727c335 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LandmarkCoordinate.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Landmark coordinates within an image. + */ +@Immutable +public final class LandmarkCoordinate { + /* + * The horizontal component, in pixels. + */ + @Generated + @JsonProperty(value = "x") + private final double x; + + /* + * The vertical component, in pixels. + */ + @Generated + @JsonProperty(value = "y") + private final double y; + + /** + * Creates an instance of LandmarkCoordinate class. + * + * @param x the x value to set. + * @param y the y value to set. + */ + @Generated + @JsonCreator + private LandmarkCoordinate(@JsonProperty(value = "x") double x, @JsonProperty(value = "y") double y) { + this.x = x; + this.y = y; + } + + /** + * Get the x property: The horizontal component, in pixels. + * + * @return the x value. + */ + @Generated + public double getX() { + return this.x; + } + + /** + * Get the y property: The vertical component, in pixels. + * + * @return the y value. + */ + @Generated + public double getY() { + return this.y; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java new file mode 100644 index 0000000000000..c0566bc16da82 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Large face list is a list of faces, up to 1,000,000 faces. + */ +@Immutable +public final class LargeFaceList { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + */ + @Generated + @JsonProperty(value = "largeFaceListId", access = JsonProperty.Access.WRITE_ONLY) + private String largeFaceListId; + + /** + * Creates an instance of LargeFaceList class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private LargeFaceList(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the largeFaceListId property: Valid character is letter in lower case or digit or '-' or '_', maximum length + * is 64. + * + * @return the largeFaceListId value. + */ + @Generated + public String getLargeFaceListId() { + return this.largeFaceListId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java new file mode 100644 index 0000000000000..b858111ae8c60 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargeFaceListFace.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face resource for large face list. + */ +@Immutable +public final class LargeFaceListFace { + /* + * Face ID of the face. + */ + @Generated + @JsonProperty(value = "persistedFaceId", access = JsonProperty.Access.WRITE_ONLY) + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of LargeFaceListFace class. + */ + @Generated + private LargeFaceListFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.java new file mode 100644 index 0000000000000..72bb84d41d090 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroup.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container of the uploaded person data, including face recognition feature, and up to 1,000,000 people. + */ +@Immutable +public final class LargePersonGroup { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * ID of the container. + */ + @Generated + @JsonProperty(value = "largePersonGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String largePersonGroupId; + + /** + * Creates an instance of LargePersonGroup class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private LargePersonGroup(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the largePersonGroupId property: ID of the container. + * + * @return the largePersonGroupId value. + */ + @Generated + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.java new file mode 100644 index 0000000000000..167d00b502d36 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPerson.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The person in a specified large person group. To add face to this person, please call "Add Large Person Group Person + * Face". + */ +@Immutable +public final class LargePersonGroupPerson { + /* + * ID of the person. + */ + @Generated + @JsonProperty(value = "personId", access = JsonProperty.Access.WRITE_ONLY) + private String personId; + + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Face ids of registered faces in the person. + */ + @Generated + @JsonProperty(value = "persistedFaceIds") + private List persistedFaceIds; + + /** + * Creates an instance of LargePersonGroupPerson class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private LargePersonGroupPerson(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the personId property: ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the persistedFaceIds property: Face ids of registered faces in the person. + * + * @return the persistedFaceIds value. + */ + @Generated + public List getPersistedFaceIds() { + return this.persistedFaceIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java new file mode 100644 index 0000000000000..d59787d97f3bd --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LargePersonGroupPersonFace.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face resource for large person group person. + */ +@Immutable +public final class LargePersonGroupPersonFace { + /* + * Face ID of the face. + */ + @Generated + @JsonProperty(value = "persistedFaceId", access = JsonProperty.Access.WRITE_ONLY) + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of LargePersonGroupPersonFace class. + */ + @Generated + private LargePersonGroupPersonFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListFaceResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListFaceResult.java new file mode 100644 index 0000000000000..b0e83f4718419 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListFaceResult.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response of list face of person. + */ +@Immutable +public final class ListFaceResult { + /* + * Id of person. + */ + @Generated + @JsonProperty(value = "personId") + private final String personId; + + /* + * Array of persisted face ids. + */ + @Generated + @JsonProperty(value = "persistedFaceIds") + private final List persistedFaceIds; + + /** + * Creates an instance of ListFaceResult class. + * + * @param personId the personId value to set. + * @param persistedFaceIds the persistedFaceIds value to set. + */ + @Generated + @JsonCreator + private ListFaceResult(@JsonProperty(value = "personId") String personId, + @JsonProperty(value = "persistedFaceIds") List persistedFaceIds) { + this.personId = personId; + this.persistedFaceIds = persistedFaceIds; + } + + /** + * Get the personId property: Id of person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the persistedFaceIds property: Array of persisted face ids. + * + * @return the persistedFaceIds value. + */ + @Generated + public List getPersistedFaceIds() { + return this.persistedFaceIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListGroupReferenceResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListGroupReferenceResult.java new file mode 100644 index 0000000000000..49290ff7d414b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListGroupReferenceResult.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response of list dynamic person group of person. + */ +@Immutable +public final class ListGroupReferenceResult { + /* + * Array of PersonDirectory DynamicPersonGroup ids. + */ + @Generated + @JsonProperty(value = "dynamicPersonGroupIds") + private final List dynamicPersonGroupIds; + + /** + * Creates an instance of ListGroupReferenceResult class. + * + * @param dynamicPersonGroupIds the dynamicPersonGroupIds value to set. + */ + @Generated + @JsonCreator + private ListGroupReferenceResult( + @JsonProperty(value = "dynamicPersonGroupIds") List dynamicPersonGroupIds) { + this.dynamicPersonGroupIds = dynamicPersonGroupIds; + } + + /** + * Get the dynamicPersonGroupIds property: Array of PersonDirectory DynamicPersonGroup ids. + * + * @return the dynamicPersonGroupIds value. + */ + @Generated + public List getDynamicPersonGroupIds() { + return this.dynamicPersonGroupIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListPersonResult.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListPersonResult.java new file mode 100644 index 0000000000000..269bd01a9d020 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/ListPersonResult.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Response of list dynamic person group person. + */ +@Immutable +public final class ListPersonResult { + /* + * Array of PersonDirectory Person ids. + */ + @Generated + @JsonProperty(value = "personIds") + private final List personIds; + + /** + * Creates an instance of ListPersonResult class. + * + * @param personIds the personIds value to set. + */ + @Generated + @JsonCreator + private ListPersonResult(@JsonProperty(value = "personIds") List personIds) { + this.personIds = personIds; + } + + /** + * Get the personIds property: Array of PersonDirectory Person ids. + * + * @return the personIds value. + */ + @Generated + public List getPersonIds() { + return this.personIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java new file mode 100644 index 0000000000000..86370517cbc69 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The model version used for liveness classification. + */ +public final class LivenessModel extends ExpandableStringEnum { + /** + * Static value 2020-02-15-preview.01 for LivenessModel. + */ + @Generated + public static final LivenessModel V2020_02_15_PREVIEW_01 = fromString("2020-02-15-preview.01"); + + /** + * Static value 2021-11-12-preview.03 for LivenessModel. + */ + @Generated + public static final LivenessModel V2021_11_12_PREVIEW_03 = fromString("2021-11-12-preview.03"); + + /** + * Static value 2022-10-15-preview.04 for LivenessModel. + */ + @Generated + public static final LivenessModel V2022_10_15_PREVIEW_04 = fromString("2022-10-15-preview.04"); + + /** + * Static value 2023-03-02-preview.05 for LivenessModel. + */ + @Generated + public static final LivenessModel V2023_03_02_PREVIEW_05 = fromString("2023-03-02-preview.05"); + + /** + * Creates a new instance of LivenessModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public LivenessModel() { + } + + /** + * Creates or finds a LivenessModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding LivenessModel. + */ + @Generated + @JsonCreator + public static LivenessModel fromString(String name) { + return fromString(name, LivenessModel.class); + } + + /** + * Gets known LivenessModel values. + * + * @return known LivenessModel values. + */ + @Generated + public static Collection values() { + return values(LivenessModel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOperationMode.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOperationMode.java new file mode 100644 index 0000000000000..c41b1fbb7a8ff --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOperationMode.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The operation mode for the liveness modal. + */ +public final class LivenessOperationMode extends ExpandableStringEnum { + /** + * The operation mode for the liveness modal. + */ + @Generated + public static final LivenessOperationMode PASSIVE = fromString("Passive"); + + /** + * Creates a new instance of LivenessOperationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public LivenessOperationMode() { + } + + /** + * Creates or finds a LivenessOperationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding LivenessOperationMode. + */ + @Generated + @JsonCreator + public static LivenessOperationMode fromString(String name) { + return fromString(name, LivenessOperationMode.class); + } + + /** + * Gets known LivenessOperationMode values. + * + * @return known LivenessOperationMode values. + */ + @Generated + public static Collection values() { + return values(LivenessOperationMode.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java new file mode 100644 index 0000000000000..e6060e429d7e5 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The liveness classification for target face. + */ +@Immutable +public final class LivenessOutputsTarget { + /* + * The face region where the liveness classification was made on. + */ + @Generated + @JsonProperty(value = "faceRectangle") + private final FaceRectangle faceRectangle; + + /* + * The file name which contains the face rectangle where the liveness classification was made on. + */ + @Generated + @JsonProperty(value = "fileName") + private final String fileName; + + /* + * The time offset within the file of the frame which contains the face rectangle where the liveness classification was made on. + */ + @Generated + @JsonProperty(value = "timeOffsetWithinFile") + private final int timeOffsetWithinFile; + + /* + * The image type which contains the face rectangle where the liveness classification was made on. + */ + @Generated + @JsonProperty(value = "imageType") + private final FaceImageType imageType; + + /** + * Creates an instance of LivenessOutputsTarget class. + * + * @param faceRectangle the faceRectangle value to set. + * @param fileName the fileName value to set. + * @param timeOffsetWithinFile the timeOffsetWithinFile value to set. + * @param imageType the imageType value to set. + */ + @Generated + @JsonCreator + private LivenessOutputsTarget(@JsonProperty(value = "faceRectangle") FaceRectangle faceRectangle, + @JsonProperty(value = "fileName") String fileName, + @JsonProperty(value = "timeOffsetWithinFile") int timeOffsetWithinFile, + @JsonProperty(value = "imageType") FaceImageType imageType) { + this.faceRectangle = faceRectangle; + this.fileName = fileName; + this.timeOffsetWithinFile = timeOffsetWithinFile; + this.imageType = imageType; + } + + /** + * Get the faceRectangle property: The face region where the liveness classification was made on. + * + * @return the faceRectangle value. + */ + @Generated + public FaceRectangle getFaceRectangle() { + return this.faceRectangle; + } + + /** + * Get the fileName property: The file name which contains the face rectangle where the liveness classification was + * made on. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the timeOffsetWithinFile property: The time offset within the file of the frame which contains the face + * rectangle where the liveness classification was made on. + * + * @return the timeOffsetWithinFile value. + */ + @Generated + public int getTimeOffsetWithinFile() { + return this.timeOffsetWithinFile; + } + + /** + * Get the imageType property: The image type which contains the face rectangle where the liveness classification + * was made on. + * + * @return the imageType value. + */ + @Generated + public FaceImageType getImageType() { + return this.imageType; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java new file mode 100644 index 0000000000000..c0d14a36f9718 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.HashMap; +import java.util.Map; + +/** + * The response body of detect liveness API call. + */ +@Immutable +public final class LivenessResponseBody { + /* + * The liveness classification for the target face. + */ + @Generated + @JsonProperty(value = "livenessDecision") + private FaceLivenessDecision livenessDecision; + + /* + * Specific targets used for liveness classification. + */ + @Generated + @JsonProperty(value = "target") + private LivenessOutputsTarget target; + + /* + * The model version used for liveness classification. + */ + @Generated + @JsonProperty(value = "modelVersionUsed") + private LivenessModel modelVersionUsed; + + /* + * The face verification output. Only available when the request is liveness with verify. + */ + @Generated + @JsonProperty(value = "verifyResult") + private LivenessWithVerifyOutputs verifyResult; + + /* + * Additional properties + */ + @Generated + @JsonIgnore + private Map additionalProperties; + + /** + * Creates an instance of LivenessResponseBody class. + */ + @Generated + private LivenessResponseBody() { + } + + /** + * Get the livenessDecision property: The liveness classification for the target face. + * + * @return the livenessDecision value. + */ + @Generated + public FaceLivenessDecision getLivenessDecision() { + return this.livenessDecision; + } + + /** + * Get the target property: Specific targets used for liveness classification. + * + * @return the target value. + */ + @Generated + public LivenessOutputsTarget getTarget() { + return this.target; + } + + /** + * Get the modelVersionUsed property: The model version used for liveness classification. + * + * @return the modelVersionUsed value. + */ + @Generated + public LivenessModel getModelVersionUsed() { + return this.modelVersionUsed; + } + + /** + * Get the verifyResult property: The face verification output. Only available when the request is liveness with + * verify. + * + * @return the verifyResult value. + */ + @Generated + public LivenessWithVerifyOutputs getVerifyResult() { + return this.verifyResult; + } + + /** + * Get the additionalProperties property: Additional properties. + * + * @return the additionalProperties value. + */ + @Generated + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @Generated + @JsonAnySetter + void setAdditionalProperties(String key, Object value) { + if (additionalProperties == null) { + additionalProperties = new HashMap<>(); + } + additionalProperties.put(key, value); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java new file mode 100644 index 0000000000000..453613a5a1cfe --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Session result of detect liveness. + */ +@Immutable +public final class LivenessSession { + /* + * The unique ID to reference this session. + */ + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * DateTime when this session was created. + */ + @Generated + @JsonProperty(value = "createdDateTime") + private final OffsetDateTime createdDateTime; + + /* + * DateTime when this session was started by the client. + */ + @Generated + @JsonProperty(value = "sessionStartDateTime") + private OffsetDateTime sessionStartDateTime; + + /* + * Whether or not the session is expired. + */ + @Generated + @JsonProperty(value = "sessionExpired") + private final boolean sessionExpired; + + /* + * Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. + */ + @Generated + @JsonProperty(value = "deviceCorrelationId") + private String deviceCorrelationId; + + /* + * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + */ + @Generated + @JsonProperty(value = "authTokenTimeToLiveInSeconds") + private Integer authTokenTimeToLiveInSeconds; + + /* + * The current status of the session. + */ + @Generated + @JsonProperty(value = "status") + private final FaceSessionStatus status; + + /* + * The latest session audit result only populated if status == 'ResultAvailable'. + */ + @Generated + @JsonProperty(value = "result") + private LivenessSessionAuditEntry result; + + /** + * Creates an instance of LivenessSession class. + * + * @param createdDateTime the createdDateTime value to set. + * @param sessionExpired the sessionExpired value to set. + * @param status the status value to set. + */ + @Generated + @JsonCreator + private LivenessSession(@JsonProperty(value = "createdDateTime") OffsetDateTime createdDateTime, + @JsonProperty(value = "sessionExpired") boolean sessionExpired, + @JsonProperty(value = "status") FaceSessionStatus status) { + this.createdDateTime = createdDateTime; + this.sessionExpired = sessionExpired; + this.status = status; + } + + /** + * Get the id property: The unique ID to reference this session. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the createdDateTime property: DateTime when this session was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the sessionStartDateTime property: DateTime when this session was started by the client. + * + * @return the sessionStartDateTime value. + */ + @Generated + public OffsetDateTime getSessionStartDateTime() { + return this.sessionStartDateTime; + } + + /** + * Get the sessionExpired property: Whether or not the session is expired. + * + * @return the sessionExpired value. + */ + @Generated + public boolean isSessionExpired() { + return this.sessionExpired; + } + + /** + * Get the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and + * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be + * null. + * + * @return the deviceCorrelationId value. + */ + @Generated + public String getDeviceCorrelationId() { + return this.deviceCorrelationId; + } + + /** + * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. + * + * @return the authTokenTimeToLiveInSeconds value. + */ + @Generated + public Integer getAuthTokenTimeToLiveInSeconds() { + return this.authTokenTimeToLiveInSeconds; + } + + /** + * Get the status property: The current status of the session. + * + * @return the status value. + */ + @Generated + public FaceSessionStatus getStatus() { + return this.status; + } + + /** + * Get the result property: The latest session audit result only populated if status == 'ResultAvailable'. + * + * @return the result value. + */ + @Generated + public LivenessSessionAuditEntry getResult() { + return this.result; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java new file mode 100644 index 0000000000000..6b9c1c0cd67e6 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Audit entry for a request in session. + */ +@Immutable +public final class LivenessSessionAuditEntry { + /* + * The unique id to refer to this audit request. Use this id with the 'start' query parameter to continue on to the next page of audit results. + */ + @Generated + @JsonProperty(value = "id") + private final long id; + + /* + * The unique sessionId of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding session DELETE operation. + */ + @Generated + @JsonProperty(value = "sessionId") + private final String sessionId; + + /* + * The unique requestId that is returned by the service to the client in the 'apim-request-id' header. + */ + @Generated + @JsonProperty(value = "requestId") + private final String requestId; + + /* + * The unique clientRequestId that is sent by the client in the 'client-request-id' header. + */ + @Generated + @JsonProperty(value = "clientRequestId") + private final String clientRequestId; + + /* + * The UTC DateTime that the request was received. + */ + @Generated + @JsonProperty(value = "receivedDateTime") + private final OffsetDateTime receivedDateTime; + + /* + * The request of this entry. + */ + @Generated + @JsonProperty(value = "request") + private final AuditRequestInfo request; + + /* + * The response of this entry. + */ + @Generated + @JsonProperty(value = "response") + private final AuditLivenessResponseInfo response; + + /* + * The server calculated digest for this request. If the client reported digest differs from the server calculated digest, then the message integrity between the client and service has been compromised and the result should not be trusted. For more information, see how to guides on how to leverage this value to secure your end-to-end solution. + */ + @Generated + @JsonProperty(value = "digest") + private final String digest; + + /** + * Creates an instance of LivenessSessionAuditEntry class. + * + * @param id the id value to set. + * @param sessionId the sessionId value to set. + * @param requestId the requestId value to set. + * @param clientRequestId the clientRequestId value to set. + * @param receivedDateTime the receivedDateTime value to set. + * @param request the request value to set. + * @param response the response value to set. + * @param digest the digest value to set. + */ + @Generated + @JsonCreator + private LivenessSessionAuditEntry(@JsonProperty(value = "id") long id, + @JsonProperty(value = "sessionId") String sessionId, @JsonProperty(value = "requestId") String requestId, + @JsonProperty(value = "clientRequestId") String clientRequestId, + @JsonProperty(value = "receivedDateTime") OffsetDateTime receivedDateTime, + @JsonProperty(value = "request") AuditRequestInfo request, + @JsonProperty(value = "response") AuditLivenessResponseInfo response, + @JsonProperty(value = "digest") String digest) { + this.id = id; + this.sessionId = sessionId; + this.requestId = requestId; + this.clientRequestId = clientRequestId; + this.receivedDateTime = receivedDateTime; + this.request = request; + this.response = response; + this.digest = digest; + } + + /** + * Get the id property: The unique id to refer to this audit request. Use this id with the 'start' query parameter + * to continue on to the next page of audit results. + * + * @return the id value. + */ + @Generated + public long getId() { + return this.id; + } + + /** + * Get the sessionId property: The unique sessionId of the created session. It will expire 48 hours after it was + * created or may be deleted sooner using the corresponding session DELETE operation. + * + * @return the sessionId value. + */ + @Generated + public String getSessionId() { + return this.sessionId; + } + + /** + * Get the requestId property: The unique requestId that is returned by the service to the client in the + * 'apim-request-id' header. + * + * @return the requestId value. + */ + @Generated + public String getRequestId() { + return this.requestId; + } + + /** + * Get the clientRequestId property: The unique clientRequestId that is sent by the client in the + * 'client-request-id' header. + * + * @return the clientRequestId value. + */ + @Generated + public String getClientRequestId() { + return this.clientRequestId; + } + + /** + * Get the receivedDateTime property: The UTC DateTime that the request was received. + * + * @return the receivedDateTime value. + */ + @Generated + public OffsetDateTime getReceivedDateTime() { + return this.receivedDateTime; + } + + /** + * Get the request property: The request of this entry. + * + * @return the request value. + */ + @Generated + public AuditRequestInfo getRequest() { + return this.request; + } + + /** + * Get the response property: The response of this entry. + * + * @return the response value. + */ + @Generated + public AuditLivenessResponseInfo getResponse() { + return this.response; + } + + /** + * Get the digest property: The server calculated digest for this request. If the client reported digest differs + * from the server calculated digest, then the message integrity between the client and service has been compromised + * and the result should not be trusted. For more information, see how to guides on how to leverage this value to + * secure your end-to-end solution. + * + * @return the digest value. + */ + @Generated + public String getDigest() { + return this.digest; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java new file mode 100644 index 0000000000000..a4ded847cfdc6 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Session data returned for enumeration. + */ +@Immutable +public final class LivenessSessionItem { + /* + * The unique ID to reference this session. + */ + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * DateTime when this session was created. + */ + @Generated + @JsonProperty(value = "createdDateTime") + private final OffsetDateTime createdDateTime; + + /* + * DateTime when this session was started by the client. + */ + @Generated + @JsonProperty(value = "sessionStartDateTime") + private OffsetDateTime sessionStartDateTime; + + /* + * Whether or not the session is expired. + */ + @Generated + @JsonProperty(value = "sessionExpired") + private final boolean sessionExpired; + + /* + * Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. + */ + @Generated + @JsonProperty(value = "deviceCorrelationId") + private String deviceCorrelationId; + + /* + * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + */ + @Generated + @JsonProperty(value = "authTokenTimeToLiveInSeconds") + private Integer authTokenTimeToLiveInSeconds; + + /** + * Creates an instance of LivenessSessionItem class. + * + * @param createdDateTime the createdDateTime value to set. + * @param sessionExpired the sessionExpired value to set. + */ + @Generated + @JsonCreator + private LivenessSessionItem(@JsonProperty(value = "createdDateTime") OffsetDateTime createdDateTime, + @JsonProperty(value = "sessionExpired") boolean sessionExpired) { + this.createdDateTime = createdDateTime; + this.sessionExpired = sessionExpired; + } + + /** + * Get the id property: The unique ID to reference this session. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the createdDateTime property: DateTime when this session was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the sessionStartDateTime property: DateTime when this session was started by the client. + * + * @return the sessionStartDateTime value. + */ + @Generated + public OffsetDateTime getSessionStartDateTime() { + return this.sessionStartDateTime; + } + + /** + * Get the sessionExpired property: Whether or not the session is expired. + * + * @return the sessionExpired value. + */ + @Generated + public boolean isSessionExpired() { + return this.sessionExpired; + } + + /** + * Get the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and + * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be + * null. + * + * @return the deviceCorrelationId value. + */ + @Generated + public String getDeviceCorrelationId() { + return this.deviceCorrelationId; + } + + /** + * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. + * + * @return the authTokenTimeToLiveInSeconds value. + */ + @Generated + public Integer getAuthTokenTimeToLiveInSeconds() { + return this.authTokenTimeToLiveInSeconds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java new file mode 100644 index 0000000000000..bb1a0e3683dbc --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The detail of face for verification. + */ +@Immutable +public final class LivenessWithVerifyImage { + /* + * The face region where the comparison image's classification was made. + */ + @Generated + @JsonProperty(value = "faceRectangle") + private final FaceRectangle faceRectangle; + + /* + * Quality of face image for recognition. + */ + @Generated + @JsonProperty(value = "qualityForRecognition") + private final QualityForRecognition qualityForRecognition; + + /** + * Creates an instance of LivenessWithVerifyImage class. + * + * @param faceRectangle the faceRectangle value to set. + * @param qualityForRecognition the qualityForRecognition value to set. + */ + @Generated + @JsonCreator + private LivenessWithVerifyImage(@JsonProperty(value = "faceRectangle") FaceRectangle faceRectangle, + @JsonProperty(value = "qualityForRecognition") QualityForRecognition qualityForRecognition) { + this.faceRectangle = faceRectangle; + this.qualityForRecognition = qualityForRecognition; + } + + /** + * Get the faceRectangle property: The face region where the comparison image's classification was made. + * + * @return the faceRectangle value. + */ + @Generated + public FaceRectangle getFaceRectangle() { + return this.faceRectangle; + } + + /** + * Get the qualityForRecognition property: Quality of face image for recognition. + * + * @return the qualityForRecognition value. + */ + @Generated + public QualityForRecognition getQualityForRecognition() { + return this.qualityForRecognition; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java new file mode 100644 index 0000000000000..a99c85be60df1 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The face verification output. + */ +@Immutable +public final class LivenessWithVerifyOutputs { + /* + * The detail of face for verification. + */ + @Generated + @JsonProperty(value = "verifyImage") + private final LivenessWithVerifyImage verifyImage; + + /* + * The target face liveness face and comparison image face verification confidence. + */ + @Generated + @JsonProperty(value = "matchConfidence") + private final double matchConfidence; + + /* + * Whether the target liveness face and comparison image face match. + */ + @Generated + @JsonProperty(value = "isIdentical") + private final boolean isIdentical; + + /** + * Creates an instance of LivenessWithVerifyOutputs class. + * + * @param verifyImage the verifyImage value to set. + * @param matchConfidence the matchConfidence value to set. + * @param isIdentical the isIdentical value to set. + */ + @Generated + @JsonCreator + private LivenessWithVerifyOutputs(@JsonProperty(value = "verifyImage") LivenessWithVerifyImage verifyImage, + @JsonProperty(value = "matchConfidence") double matchConfidence, + @JsonProperty(value = "isIdentical") boolean isIdentical) { + this.verifyImage = verifyImage; + this.matchConfidence = matchConfidence; + this.isIdentical = isIdentical; + } + + /** + * Get the verifyImage property: The detail of face for verification. + * + * @return the verifyImage value. + */ + @Generated + public LivenessWithVerifyImage getVerifyImage() { + return this.verifyImage; + } + + /** + * Get the matchConfidence property: The target face liveness face and comparison image face verification + * confidence. + * + * @return the matchConfidence value. + */ + @Generated + public double getMatchConfidence() { + return this.matchConfidence; + } + + /** + * Get the isIdentical property: Whether the target liveness face and comparison image face match. + * + * @return the isIdentical value. + */ + @Generated + public boolean isIdentical() { + return this.isIdentical; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java new file mode 100644 index 0000000000000..fcfd4a34aaff9 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * Session result of detect liveness with verify. + */ +@Immutable +public final class LivenessWithVerifySession { + /* + * The unique ID to reference this session. + */ + @Generated + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * DateTime when this session was created. + */ + @Generated + @JsonProperty(value = "createdDateTime") + private final OffsetDateTime createdDateTime; + + /* + * DateTime when this session was started by the client. + */ + @Generated + @JsonProperty(value = "sessionStartDateTime") + private OffsetDateTime sessionStartDateTime; + + /* + * Whether or not the session is expired. + */ + @Generated + @JsonProperty(value = "sessionExpired") + private final boolean sessionExpired; + + /* + * Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null. + */ + @Generated + @JsonProperty(value = "deviceCorrelationId") + private String deviceCorrelationId; + + /* + * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + */ + @Generated + @JsonProperty(value = "authTokenTimeToLiveInSeconds") + private Integer authTokenTimeToLiveInSeconds; + + /* + * The current status of the session. + */ + @Generated + @JsonProperty(value = "status") + private final FaceSessionStatus status; + + /* + * The latest session audit result only populated if status == 'ResultAvailable'. + */ + @Generated + @JsonProperty(value = "result") + private LivenessSessionAuditEntry result; + + /** + * Creates an instance of LivenessWithVerifySession class. + * + * @param createdDateTime the createdDateTime value to set. + * @param sessionExpired the sessionExpired value to set. + * @param status the status value to set. + */ + @Generated + @JsonCreator + private LivenessWithVerifySession(@JsonProperty(value = "createdDateTime") OffsetDateTime createdDateTime, + @JsonProperty(value = "sessionExpired") boolean sessionExpired, + @JsonProperty(value = "status") FaceSessionStatus status) { + this.createdDateTime = createdDateTime; + this.sessionExpired = sessionExpired; + this.status = status; + } + + /** + * Get the id property: The unique ID to reference this session. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the createdDateTime property: DateTime when this session was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the sessionStartDateTime property: DateTime when this session was started by the client. + * + * @return the sessionStartDateTime value. + */ + @Generated + public OffsetDateTime getSessionStartDateTime() { + return this.sessionStartDateTime; + } + + /** + * Get the sessionExpired property: Whether or not the session is expired. + * + * @return the sessionExpired value. + */ + @Generated + public boolean isSessionExpired() { + return this.sessionExpired; + } + + /** + * Get the deviceCorrelationId property: Unique Guid per each end-user device. This is to provide rate limiting and + * anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be + * null. + * + * @return the deviceCorrelationId value. + */ + @Generated + public String getDeviceCorrelationId() { + return this.deviceCorrelationId; + } + + /** + * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. + * + * @return the authTokenTimeToLiveInSeconds value. + */ + @Generated + public Integer getAuthTokenTimeToLiveInSeconds() { + return this.authTokenTimeToLiveInSeconds; + } + + /** + * Get the status property: The current status of the session. + * + * @return the status value. + */ + @Generated + public FaceSessionStatus getStatus() { + return this.status; + } + + /** + * Get the result property: The latest session audit result only populated if status == 'ResultAvailable'. + * + * @return the result value. + */ + @Generated + public LivenessSessionAuditEntry getResult() { + return this.result; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskProperties.java new file mode 100644 index 0000000000000..90ac888e70908 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskProperties.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing the presence of a mask on a given face. + */ +@Immutable +public final class MaskProperties { + /* + * A boolean value indicating whether nose and mouth are covered. + */ + @Generated + @JsonProperty(value = "noseAndMouthCovered") + private final boolean noseAndMouthCovered; + + /* + * Type of the mask. + */ + @Generated + @JsonProperty(value = "type") + private final MaskType type; + + /** + * Creates an instance of MaskProperties class. + * + * @param noseAndMouthCovered the noseAndMouthCovered value to set. + * @param type the type value to set. + */ + @Generated + @JsonCreator + private MaskProperties(@JsonProperty(value = "noseAndMouthCovered") boolean noseAndMouthCovered, + @JsonProperty(value = "type") MaskType type) { + this.noseAndMouthCovered = noseAndMouthCovered; + this.type = type; + } + + /** + * Get the noseAndMouthCovered property: A boolean value indicating whether nose and mouth are covered. + * + * @return the noseAndMouthCovered value. + */ + @Generated + public boolean isNoseAndMouthCovered() { + return this.noseAndMouthCovered; + } + + /** + * Get the type property: Type of the mask. + * + * @return the type value. + */ + @Generated + public MaskType getType() { + return this.type; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskType.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskType.java new file mode 100644 index 0000000000000..979c11790f73f --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/MaskType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Type of the mask. + */ +public final class MaskType extends ExpandableStringEnum { + /** + * Face mask. + */ + @Generated + public static final MaskType FACE_MASK = fromString("faceMask"); + + /** + * No mask. + */ + @Generated + public static final MaskType NO_MASK = fromString("noMask"); + + /** + * Other types of mask or occlusion. + */ + @Generated + public static final MaskType OTHER_MASK_OR_OCCLUSION = fromString("otherMaskOrOcclusion"); + + /** + * Uncertain. + */ + @Generated + public static final MaskType UNCERTAIN = fromString("uncertain"); + + /** + * Creates a new instance of MaskType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public MaskType() { + } + + /** + * Creates or finds a MaskType from its string representation. + * + * @param name a name to look for. + * @return the corresponding MaskType. + */ + @Generated + @JsonCreator + public static MaskType fromString(String name) { + return fromString(name, MaskType.class); + } + + /** + * Gets known MaskType values. + * + * @return known MaskType values. + */ + @Generated + public static Collection values() { + return values(MaskType.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseLevel.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseLevel.java new file mode 100644 index 0000000000000..e17c6d7e4de4b --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseLevel.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates level of noise. + */ +public final class NoiseLevel extends ExpandableStringEnum { + /** + * Low noise level. + */ + @Generated + public static final NoiseLevel LOW = fromString("low"); + + /** + * Medium noise level. + */ + @Generated + public static final NoiseLevel MEDIUM = fromString("medium"); + + /** + * High noise level. + */ + @Generated + public static final NoiseLevel HIGH = fromString("high"); + + /** + * Creates a new instance of NoiseLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public NoiseLevel() { + } + + /** + * Creates or finds a NoiseLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding NoiseLevel. + */ + @Generated + @JsonCreator + public static NoiseLevel fromString(String name) { + return fromString(name, NoiseLevel.class); + } + + /** + * Gets known NoiseLevel values. + * + * @return known NoiseLevel values. + */ + @Generated + public static Collection values() { + return values(NoiseLevel.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseProperties.java new file mode 100644 index 0000000000000..9e8698d601878 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/NoiseProperties.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing noise level of the image. + */ +@Immutable +public final class NoiseProperties { + /* + * An enum value indicating level of noise. + */ + @Generated + @JsonProperty(value = "noiseLevel") + private final NoiseLevel noiseLevel; + + /* + * A number indicating level of noise level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise level. [0.3, 0.7) is medium noise level. [0.7, 1] is high noise level. + */ + @Generated + @JsonProperty(value = "value") + private final double value; + + /** + * Creates an instance of NoiseProperties class. + * + * @param noiseLevel the noiseLevel value to set. + * @param value the value value to set. + */ + @Generated + @JsonCreator + private NoiseProperties(@JsonProperty(value = "noiseLevel") NoiseLevel noiseLevel, + @JsonProperty(value = "value") double value) { + this.noiseLevel = noiseLevel; + this.value = value; + } + + /** + * Get the noiseLevel property: An enum value indicating level of noise. + * + * @return the noiseLevel value. + */ + @Generated + public NoiseLevel getNoiseLevel() { + return this.noiseLevel; + } + + /** + * Get the value property: A number indicating level of noise level ranging from 0 to 1. [0, 0.25) is under + * exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise level. [0.3, 0.7) is + * medium noise level. [0.7, 1] is high noise level. + * + * @return the value value. + */ + @Generated + public double getValue() { + return this.value; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OcclusionProperties.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OcclusionProperties.java new file mode 100644 index 0000000000000..05cef6ae84324 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OcclusionProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties describing occlusions on a given face. + */ +@Immutable +public final class OcclusionProperties { + /* + * A boolean value indicating whether forehead is occluded. + */ + @Generated + @JsonProperty(value = "foreheadOccluded") + private final boolean foreheadOccluded; + + /* + * A boolean value indicating whether eyes are occluded. + */ + @Generated + @JsonProperty(value = "eyeOccluded") + private final boolean eyeOccluded; + + /* + * A boolean value indicating whether the mouth is occluded. + */ + @Generated + @JsonProperty(value = "mouthOccluded") + private final boolean mouthOccluded; + + /** + * Creates an instance of OcclusionProperties class. + * + * @param foreheadOccluded the foreheadOccluded value to set. + * @param eyeOccluded the eyeOccluded value to set. + * @param mouthOccluded the mouthOccluded value to set. + */ + @Generated + @JsonCreator + private OcclusionProperties(@JsonProperty(value = "foreheadOccluded") boolean foreheadOccluded, + @JsonProperty(value = "eyeOccluded") boolean eyeOccluded, + @JsonProperty(value = "mouthOccluded") boolean mouthOccluded) { + this.foreheadOccluded = foreheadOccluded; + this.eyeOccluded = eyeOccluded; + this.mouthOccluded = mouthOccluded; + } + + /** + * Get the foreheadOccluded property: A boolean value indicating whether forehead is occluded. + * + * @return the foreheadOccluded value. + */ + @Generated + public boolean isForeheadOccluded() { + return this.foreheadOccluded; + } + + /** + * Get the eyeOccluded property: A boolean value indicating whether eyes are occluded. + * + * @return the eyeOccluded value. + */ + @Generated + public boolean isEyeOccluded() { + return this.eyeOccluded; + } + + /** + * Get the mouthOccluded property: A boolean value indicating whether the mouth is occluded. + * + * @return the mouthOccluded value. + */ + @Generated + public boolean isMouthOccluded() { + return this.mouthOccluded; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryFace.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryFace.java new file mode 100644 index 0000000000000..8d965cc54c2d5 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryFace.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face resource for person directory person. + */ +@Immutable +public final class PersonDirectoryFace { + /* + * Face ID of the face. + */ + @Generated + @JsonProperty(value = "persistedFaceId", access = JsonProperty.Access.WRITE_ONLY) + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of PersonDirectoryFace class. + */ + @Generated + private PersonDirectoryFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryPerson.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryPerson.java new file mode 100644 index 0000000000000..954314b51abf2 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonDirectoryPerson.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Person resource for person directory. + */ +@Immutable +public final class PersonDirectoryPerson { + /* + * Person ID of the person. + */ + @Generated + @JsonProperty(value = "personId", access = JsonProperty.Access.WRITE_ONLY) + private String personId; + + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of PersonDirectoryPerson class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private PersonDirectoryPerson(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the personId property: Person ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroup.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroup.java new file mode 100644 index 0000000000000..62b1b8d6ba2cb --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroup.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container of the uploaded person data, including face recognition feature, and up to 10,000 persons. To handle + * larger scale face identification problem, please consider using Large Person Group. + */ +@Immutable +public final class PersonGroup { + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds. + */ + @Generated + @JsonProperty(value = "recognitionModel") + private FaceRecognitionModel recognitionModel; + + /* + * ID of the container. + */ + @Generated + @JsonProperty(value = "personGroupId", access = JsonProperty.Access.WRITE_ONLY) + private String personGroupId; + + /** + * Creates an instance of PersonGroup class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private PersonGroup(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the recognitionModel property: Name of recognition model. Recognition model is used when the face features + * are extracted and associated with detected faceIds. + * + * @return the recognitionModel value. + */ + @Generated + public FaceRecognitionModel getRecognitionModel() { + return this.recognitionModel; + } + + /** + * Get the personGroupId property: ID of the container. + * + * @return the personGroupId value. + */ + @Generated + public String getPersonGroupId() { + return this.personGroupId; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPerson.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPerson.java new file mode 100644 index 0000000000000..52bf756b5ae95 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPerson.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The person in a specified person group. To add face to this person, please call "Add Large Person Group Person Face". + */ +@Immutable +public final class PersonGroupPerson { + /* + * ID of the person. + */ + @Generated + @JsonProperty(value = "personId", access = JsonProperty.Access.WRITE_ONLY) + private String personId; + + /* + * User defined name, maximum length is 128. + */ + @Generated + @JsonProperty(value = "name") + private final String name; + + /* + * Optional user defined data. Length should not exceed 16K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /* + * Face ids of registered faces in the person. + */ + @Generated + @JsonProperty(value = "persistedFaceIds") + private List persistedFaceIds; + + /** + * Creates an instance of PersonGroupPerson class. + * + * @param name the name value to set. + */ + @Generated + @JsonCreator + private PersonGroupPerson(@JsonProperty(value = "name") String name) { + this.name = name; + } + + /** + * Get the personId property: ID of the person. + * + * @return the personId value. + */ + @Generated + public String getPersonId() { + return this.personId; + } + + /** + * Get the name property: User defined name, maximum length is 128. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the userData property: Optional user defined data. Length should not exceed 16K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } + + /** + * Get the persistedFaceIds property: Face ids of registered faces in the person. + * + * @return the persistedFaceIds value. + */ + @Generated + public List getPersistedFaceIds() { + return this.persistedFaceIds; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPersonFace.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPersonFace.java new file mode 100644 index 0000000000000..1beca0346b61e --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/PersonGroupPersonFace.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Face resource for person group person. + */ +@Immutable +public final class PersonGroupPersonFace { + /* + * Face ID of the face. + */ + @Generated + @JsonProperty(value = "persistedFaceId", access = JsonProperty.Access.WRITE_ONLY) + private String persistedFaceId; + + /* + * User-provided data attached to the face. The length limit is 1K. + */ + @Generated + @JsonProperty(value = "userData") + private String userData; + + /** + * Creates an instance of PersonGroupPersonFace class. + */ + @Generated + private PersonGroupPersonFace() { + } + + /** + * Get the persistedFaceId property: Face ID of the face. + * + * @return the persistedFaceId value. + */ + @Generated + public String getPersistedFaceId() { + return this.persistedFaceId; + } + + /** + * Get the userData property: User-provided data attached to the face. The length limit is 1K. + * + * @return the userData value. + */ + @Generated + public String getUserData() { + return this.userData; + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/QualityForRecognition.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/QualityForRecognition.java new file mode 100644 index 0000000000000..38f9ca036442c --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/QualityForRecognition.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Indicates quality of image for recognition. + */ +public final class QualityForRecognition extends ExpandableStringEnum { + /** + * Low quality. + */ + @Generated + public static final QualityForRecognition LOW = fromString("low"); + + /** + * Medium quality. + */ + @Generated + public static final QualityForRecognition MEDIUM = fromString("medium"); + + /** + * High quality. + */ + @Generated + public static final QualityForRecognition HIGH = fromString("high"); + + /** + * Creates a new instance of QualityForRecognition value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public QualityForRecognition() { + } + + /** + * Creates or finds a QualityForRecognition from its string representation. + * + * @param name a name to look for. + * @return the corresponding QualityForRecognition. + */ + @Generated + @JsonCreator + public static QualityForRecognition fromString(String name) { + return fromString(name, QualityForRecognition.class); + } + + /** + * Gets known QualityForRecognition values. + * + * @return known QualityForRecognition values. + */ + @Generated + public static Collection values() { + return values(QualityForRecognition.class); + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/package-info.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/package-info.java new file mode 100644 index 0000000000000..144f6cdb506c2 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Face. + * + */ +package com.azure.ai.vision.face.models; diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/package-info.java b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/package-info.java new file mode 100644 index 0000000000000..333cfc609bdc4 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the classes for Face. + * + */ +package com.azure.ai.vision.face; diff --git a/sdk/vision/azure-ai-vision-face/src/main/java/module-info.java b/sdk/vision/azure-ai-vision-face/src/main/java/module-info.java new file mode 100644 index 0000000000000..2ad3696718f29 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/java/module-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.ai.vision.face { + requires transitive com.azure.core; + exports com.azure.ai.vision.face; + exports com.azure.ai.vision.face.models; + opens com.azure.ai.vision.face.implementation.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.ai.vision.face.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file diff --git a/sdk/vision/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json b/sdk/vision/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json new file mode 100644 index 0000000000000..2abebda96bfd9 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json @@ -0,0 +1,520 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.vision.face.FaceAdministrationAsyncClient": "Face.FaceAdministrationClient", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addFaceListFace": "ClientCustomizations.FaceAdministrationClient.addFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addFaceListFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addFaceListFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargeFaceListFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargeFaceListFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargePersonGroupPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargePersonGroupPersonFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addPersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addPersonGroupPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addPersonGroupPersonFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.addPersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginAddPersonFace": "ClientCustomizations.FaceAdministrationClient.addPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginAddPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginAddPersonFaceFromUrlWithModel": "ClientCustomizations.FaceAdministrationClient.addPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginAddPersonFaceWithModel": "ClientCustomizations.FaceAdministrationClient.addPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginCreateDynamicPersonGroupWithPerson": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroupWithPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginCreateDynamicPersonGroupWithPersonWithModel": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroupWithPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginCreatePerson": "ClientCustomizations.FaceAdministrationClient.createPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginCreatePersonWithModel": "ClientCustomizations.FaceAdministrationClient.createPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeleteDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.deleteDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeleteDynamicPersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.deleteDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeletePerson": "ClientCustomizations.FaceAdministrationClient.deletePerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeletePersonFace": "ClientCustomizations.FaceAdministrationClient.deletePersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeletePersonFaceWithModel": "ClientCustomizations.FaceAdministrationClient.deletePersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginDeletePersonWithModel": "ClientCustomizations.FaceAdministrationClient.deletePerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainLargeFaceList": "ClientCustomizations.FaceAdministrationClient.trainLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainLargeFaceListWithModel": "ClientCustomizations.FaceAdministrationClient.trainLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.trainLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainLargePersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.trainLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainPersonGroup": "ClientCustomizations.FaceAdministrationClient.trainPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginTrainPersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.trainPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginUpdateDynamicPersonGroupWithPersonChanges": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroupWithPersonChanges", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModel": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroupWithPersonChanges", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createFaceList": "ClientCustomizations.FaceAdministrationClient.createFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.createFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargeFaceList": "ClientCustomizations.FaceAdministrationClient.createLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createPersonGroup": "ClientCustomizations.FaceAdministrationClient.createPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createPersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.createPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createPersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.createPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.createPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteFaceList": "ClientCustomizations.FaceAdministrationClient.deleteFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteFaceListFace": "ClientCustomizations.FaceAdministrationClient.deleteFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargeFaceList": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deleteLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroup": "ClientCustomizations.FaceAdministrationClient.deletePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.deletePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupReferences": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupReferences", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupReferencesWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupReferences", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroups": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getDynamicPersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getFaceList": "ClientCustomizations.FaceAdministrationClient.getFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.getFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getFaceLists": "ClientCustomizations.FaceAdministrationClient.getFaceLists", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.getFaceLists", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceList": "ClientCustomizations.FaceAdministrationClient.getLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListFaces": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFaces", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFaces", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceLists": "ClientCustomizations.FaceAdministrationClient.getLargeFaceLists", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargeFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceLists", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroups": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getLargePersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPerson": "ClientCustomizations.FaceAdministrationClient.getPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonFace": "ClientCustomizations.FaceAdministrationClient.getPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonFaces": "ClientCustomizations.FaceAdministrationClient.getPersonFaces", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonFaces", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroup": "ClientCustomizations.FaceAdministrationClient.getPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getPersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroups": "ClientCustomizations.FaceAdministrationClient.getPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersons": "ClientCustomizations.FaceAdministrationClient.getPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.getPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersons", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateFaceList": "ClientCustomizations.FaceAdministrationClient.updateFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.updateFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargeFaceList": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updateLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePerson": "ClientCustomizations.FaceAdministrationClient.updatePerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonFace": "ClientCustomizations.FaceAdministrationClient.updatePersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroup": "ClientCustomizations.FaceAdministrationClient.updatePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationAsyncClient.updatePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePerson", + "com.azure.ai.vision.face.FaceAdministrationClient": "Face.FaceAdministrationClient", + "com.azure.ai.vision.face.FaceAdministrationClient.addFaceListFace": "ClientCustomizations.FaceAdministrationClient.addFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addFaceListFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addFaceListFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargeFaceListFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargeFaceListFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addPersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.addPersonGroupPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addPersonGroupPersonFaceFromUrlWithResponse": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.addPersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.addPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.beginAddPersonFace": "ClientCustomizations.FaceAdministrationClient.addPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.beginAddPersonFaceFromUrl": "ClientCustomizations.FaceAdministrationClient.addPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.beginAddPersonFaceFromUrlWithModel": "ClientCustomizations.FaceAdministrationClient.addPersonFaceFromUrl", + "com.azure.ai.vision.face.FaceAdministrationClient.beginAddPersonFaceWithModel": "ClientCustomizations.FaceAdministrationClient.addPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.beginCreateDynamicPersonGroupWithPerson": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroupWithPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginCreateDynamicPersonGroupWithPersonWithModel": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroupWithPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginCreatePerson": "ClientCustomizations.FaceAdministrationClient.createPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginCreatePersonWithModel": "ClientCustomizations.FaceAdministrationClient.createPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeleteDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.deleteDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeleteDynamicPersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.deleteDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeletePerson": "ClientCustomizations.FaceAdministrationClient.deletePerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeletePersonFace": "ClientCustomizations.FaceAdministrationClient.deletePersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeletePersonFaceWithModel": "ClientCustomizations.FaceAdministrationClient.deletePersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.beginDeletePersonWithModel": "ClientCustomizations.FaceAdministrationClient.deletePerson", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainLargeFaceList": "ClientCustomizations.FaceAdministrationClient.trainLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainLargeFaceListWithModel": "ClientCustomizations.FaceAdministrationClient.trainLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.trainLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainLargePersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.trainLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainPersonGroup": "ClientCustomizations.FaceAdministrationClient.trainPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginTrainPersonGroupWithModel": "ClientCustomizations.FaceAdministrationClient.trainPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.beginUpdateDynamicPersonGroupWithPersonChanges": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroupWithPersonChanges", + "com.azure.ai.vision.face.FaceAdministrationClient.beginUpdateDynamicPersonGroupWithPersonChangesWithModel": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroupWithPersonChanges", + "com.azure.ai.vision.face.FaceAdministrationClient.createDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.createDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.createFaceList": "ClientCustomizations.FaceAdministrationClient.createFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.createFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.createFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargeFaceList": "ClientCustomizations.FaceAdministrationClient.createLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.createLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.createPersonGroup": "ClientCustomizations.FaceAdministrationClient.createPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.createPersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.createPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.createPersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.createPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.createPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.createPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteFaceList": "ClientCustomizations.FaceAdministrationClient.deleteFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteFaceListFace": "ClientCustomizations.FaceAdministrationClient.deleteFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargeFaceList": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.deleteLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.deleteLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroup": "ClientCustomizations.FaceAdministrationClient.deletePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.deletePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.deletePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupReferences": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupReferences", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupReferencesWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroupReferences", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroups": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getDynamicPersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getDynamicPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getFaceList": "ClientCustomizations.FaceAdministrationClient.getFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.getFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.getFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.getFaceLists": "ClientCustomizations.FaceAdministrationClient.getFaceLists", + "com.azure.ai.vision.face.FaceAdministrationClient.getFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.getFaceLists", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceList": "ClientCustomizations.FaceAdministrationClient.getLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListFaces": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFaces", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListFaces", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceListTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceLists": "ClientCustomizations.FaceAdministrationClient.getLargeFaceLists", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargeFaceListsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargeFaceLists", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroups": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getLargePersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getLargePersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getPerson": "ClientCustomizations.FaceAdministrationClient.getPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonFace": "ClientCustomizations.FaceAdministrationClient.getPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonFaces": "ClientCustomizations.FaceAdministrationClient.getPersonFaces", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonFacesWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonFaces", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroup": "ClientCustomizations.FaceAdministrationClient.getPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPersons": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupTrainingStatus": "ClientCustomizations.FaceAdministrationClient.getPersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupTrainingStatusWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroupTrainingStatus", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroups": "ClientCustomizations.FaceAdministrationClient.getPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonGroupsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersonGroups", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.getPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersons": "ClientCustomizations.FaceAdministrationClient.getPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.getPersonsWithResponse": "ClientCustomizations.FaceAdministrationClient.getPersons", + "com.azure.ai.vision.face.FaceAdministrationClient.updateDynamicPersonGroup": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updateDynamicPersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updateDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updateFaceList": "ClientCustomizations.FaceAdministrationClient.updateFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.updateFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.updateFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargeFaceList": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargeFaceListFace": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargeFaceListFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceListFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargeFaceListWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargeFaceList", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroup": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.updateLargePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updateLargePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePerson": "ClientCustomizations.FaceAdministrationClient.updatePerson", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonFace": "ClientCustomizations.FaceAdministrationClient.updatePersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroup": "ClientCustomizations.FaceAdministrationClient.updatePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroupPerson": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroupPersonFace": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroupPersonFaceWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPersonFace", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroupPersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroupPerson", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonGroupWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePersonGroup", + "com.azure.ai.vision.face.FaceAdministrationClient.updatePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.updatePerson", + "com.azure.ai.vision.face.FaceAdministrationClientBuilder": "Face.FaceAdministrationClient", + "com.azure.ai.vision.face.FaceAsyncClient": "Face.FaceClient", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilar": "ClientCustomizations.FaceClient.findSimilar", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilarFromFaceList": "ClientCustomizations.FaceClient.findSimilarFromFaceList", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilarFromFaceListWithResponse": "ClientCustomizations.FaceClient.findSimilarFromFaceList", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilarFromLargeFaceList": "ClientCustomizations.FaceClient.findSimilarFromLargeFaceList", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilarFromLargeFaceListWithResponse": "ClientCustomizations.FaceClient.findSimilarFromLargeFaceList", + "com.azure.ai.vision.face.FaceAsyncClient.findSimilarWithResponse": "ClientCustomizations.FaceClient.findSimilar", + "com.azure.ai.vision.face.FaceAsyncClient.group": "ClientCustomizations.FaceClient.group", + "com.azure.ai.vision.face.FaceAsyncClient.groupWithResponse": "ClientCustomizations.FaceClient.group", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromDynamicPersonGroup": "ClientCustomizations.FaceClient.identifyFromDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromDynamicPersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromDynamicPersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromLargePersonGroup": "ClientCustomizations.FaceClient.identifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromLargePersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromPersonDirectory": "ClientCustomizations.FaceClient.identifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromPersonDirectoryWithResponse": "ClientCustomizations.FaceClient.identifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromPersonGroup": "ClientCustomizations.FaceClient.identifyFromPersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.identifyFromPersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromPersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFaceToFace": "ClientCustomizations.FaceClient.verifyFaceToFace", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFaceToFaceWithResponse": "ClientCustomizations.FaceClient.verifyFaceToFace", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromLargePersonGroup": "ClientCustomizations.FaceClient.verifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromLargePersonGroupWithResponse": "ClientCustomizations.FaceClient.verifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromPersonDirectory": "ClientCustomizations.FaceClient.verifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromPersonDirectoryWithResponse": "ClientCustomizations.FaceClient.verifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromPersonGroup": "ClientCustomizations.FaceClient.verifyFromPersonGroup", + "com.azure.ai.vision.face.FaceAsyncClient.verifyFromPersonGroupWithResponse": "ClientCustomizations.FaceClient.verifyFromPersonGroup", + "com.azure.ai.vision.face.FaceClient": "Face.FaceClient", + "com.azure.ai.vision.face.FaceClient.findSimilar": "ClientCustomizations.FaceClient.findSimilar", + "com.azure.ai.vision.face.FaceClient.findSimilarFromFaceList": "ClientCustomizations.FaceClient.findSimilarFromFaceList", + "com.azure.ai.vision.face.FaceClient.findSimilarFromFaceListWithResponse": "ClientCustomizations.FaceClient.findSimilarFromFaceList", + "com.azure.ai.vision.face.FaceClient.findSimilarFromLargeFaceList": "ClientCustomizations.FaceClient.findSimilarFromLargeFaceList", + "com.azure.ai.vision.face.FaceClient.findSimilarFromLargeFaceListWithResponse": "ClientCustomizations.FaceClient.findSimilarFromLargeFaceList", + "com.azure.ai.vision.face.FaceClient.findSimilarWithResponse": "ClientCustomizations.FaceClient.findSimilar", + "com.azure.ai.vision.face.FaceClient.group": "ClientCustomizations.FaceClient.group", + "com.azure.ai.vision.face.FaceClient.groupWithResponse": "ClientCustomizations.FaceClient.group", + "com.azure.ai.vision.face.FaceClient.identifyFromDynamicPersonGroup": "ClientCustomizations.FaceClient.identifyFromDynamicPersonGroup", + "com.azure.ai.vision.face.FaceClient.identifyFromDynamicPersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromDynamicPersonGroup", + "com.azure.ai.vision.face.FaceClient.identifyFromLargePersonGroup": "ClientCustomizations.FaceClient.identifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceClient.identifyFromLargePersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceClient.identifyFromPersonDirectory": "ClientCustomizations.FaceClient.identifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceClient.identifyFromPersonDirectoryWithResponse": "ClientCustomizations.FaceClient.identifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceClient.identifyFromPersonGroup": "ClientCustomizations.FaceClient.identifyFromPersonGroup", + "com.azure.ai.vision.face.FaceClient.identifyFromPersonGroupWithResponse": "ClientCustomizations.FaceClient.identifyFromPersonGroup", + "com.azure.ai.vision.face.FaceClient.verifyFaceToFace": "ClientCustomizations.FaceClient.verifyFaceToFace", + "com.azure.ai.vision.face.FaceClient.verifyFaceToFaceWithResponse": "ClientCustomizations.FaceClient.verifyFaceToFace", + "com.azure.ai.vision.face.FaceClient.verifyFromLargePersonGroup": "ClientCustomizations.FaceClient.verifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceClient.verifyFromLargePersonGroupWithResponse": "ClientCustomizations.FaceClient.verifyFromLargePersonGroup", + "com.azure.ai.vision.face.FaceClient.verifyFromPersonDirectory": "ClientCustomizations.FaceClient.verifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceClient.verifyFromPersonDirectoryWithResponse": "ClientCustomizations.FaceClient.verifyFromPersonDirectory", + "com.azure.ai.vision.face.FaceClient.verifyFromPersonGroup": "ClientCustomizations.FaceClient.verifyFromPersonGroup", + "com.azure.ai.vision.face.FaceClient.verifyFromPersonGroupWithResponse": "ClientCustomizations.FaceClient.verifyFromPersonGroup", + "com.azure.ai.vision.face.FaceClientBuilder": "Face.FaceClient", + "com.azure.ai.vision.face.FaceSessionAsyncClient": "Face.FaceSessionClient", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessSession": "ClientCustomizations.FaceSessionClient.createLivenessSession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessSession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessWithVerifySessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessWithVerifySessionWithVerifyImage": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImage", + "com.azure.ai.vision.face.FaceSessionAsyncClient.createLivenessWithVerifySessionWithVerifyImageWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImage", + "com.azure.ai.vision.face.FaceSessionAsyncClient.deleteLivenessSession": "ClientCustomizations.FaceSessionClient.deleteLivenessSession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.deleteLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.deleteLivenessSession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.deleteLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.deleteLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.deleteLivenessWithVerifySessionWithResponse": "ClientCustomizations.FaceSessionClient.deleteLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessionAuditEntries": "ClientCustomizations.FaceSessionClient.getLivenessSessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessionAuditEntriesWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessionResult": "ClientCustomizations.FaceSessionClient.getLivenessSessionResult", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessionResult", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessions": "ClientCustomizations.FaceSessionClient.getLivenessSessions", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessSessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessions", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionAuditEntries": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionAuditEntriesWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionResult": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessions": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", + "com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", + "com.azure.ai.vision.face.FaceSessionClient": "Face.FaceSessionClient", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessSession": "ClientCustomizations.FaceSessionClient.createLivenessSession", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessSession", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessWithVerifySessionWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImage": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImage", + "com.azure.ai.vision.face.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImageWithResponse": "ClientCustomizations.FaceSessionClient.createLivenessWithVerifySessionWithVerifyImage", + "com.azure.ai.vision.face.FaceSessionClient.deleteLivenessSession": "ClientCustomizations.FaceSessionClient.deleteLivenessSession", + "com.azure.ai.vision.face.FaceSessionClient.deleteLivenessSessionWithResponse": "ClientCustomizations.FaceSessionClient.deleteLivenessSession", + "com.azure.ai.vision.face.FaceSessionClient.deleteLivenessWithVerifySession": "ClientCustomizations.FaceSessionClient.deleteLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionClient.deleteLivenessWithVerifySessionWithResponse": "ClientCustomizations.FaceSessionClient.deleteLivenessWithVerifySession", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessionAuditEntries": "ClientCustomizations.FaceSessionClient.getLivenessSessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessionAuditEntriesWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessionResult": "ClientCustomizations.FaceSessionClient.getLivenessSessionResult", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessionResult", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessions": "ClientCustomizations.FaceSessionClient.getLivenessSessions", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessSessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessSessions", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionAuditEntries": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionAuditEntriesWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionAuditEntries", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionResult": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionResultWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessions": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", + "com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionsWithResponse": "ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessions", + "com.azure.ai.vision.face.FaceSessionClientBuilder": "Face.FaceSessionClient", + "com.azure.ai.vision.face.implementation.models.AddFaceListFaceFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.AddLargeFaceListFaceFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.AddLargePersonGroupPersonFaceFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.AddPersonFaceFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.AddPersonGroupPersonFaceFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateDynamicPersonGroupWithPersonRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateFaceListRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateLargeFaceListRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupPersonRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateLargePersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionContent": "Face.CreateLivenessWithVerifySessionContent", + "com.azure.ai.vision.face.implementation.models.CreatePersonGroupPersonRequest": "", + "com.azure.ai.vision.face.implementation.models.CreatePersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.CreatePersonRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest": "", + "com.azure.ai.vision.face.implementation.models.FindSimilarFromFaceListRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.FindSimilarRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.GroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.IdentifyFromDynamicPersonGroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.IdentifyFromPersonDirectoryRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.IdentifyFromPersonGroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateDynamicPersonGroupWithPersonChangesRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateFaceListRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListFaceRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateLargeFaceListRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonFaceRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupPersonRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdateLargePersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdatePersonFaceRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonFaceRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdatePersonGroupPersonRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdatePersonGroupRequest": "", + "com.azure.ai.vision.face.implementation.models.UpdatePersonRequest": "", + "com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.VerifyFromPersonDirectoryRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.VerifyFromPersonGroupRequest": "ClientCustomizations.", + "com.azure.ai.vision.face.implementation.models.VerifyImageFileDetails": "null", + "com.azure.ai.vision.face.models.AccessoryItem": "Face.AccessoryItem", + "com.azure.ai.vision.face.models.AccessoryType": "Face.AccessoryType", + "com.azure.ai.vision.face.models.AddFaceResult": "Face.AddFaceResult", + "com.azure.ai.vision.face.models.AuditLivenessResponseInfo": "Face.AuditLivenessResponseInfo", + "com.azure.ai.vision.face.models.AuditRequestInfo": "Face.AuditRequestInfo", + "com.azure.ai.vision.face.models.BlurLevel": "Face.BlurLevel", + "com.azure.ai.vision.face.models.BlurProperties": "Face.BlurProperties", + "com.azure.ai.vision.face.models.CreateLivenessSessionContent": "Face.CreateLivenessSessionContent", + "com.azure.ai.vision.face.models.CreateLivenessSessionResult": "Face.CreateLivenessSessionResult", + "com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult": "Face.CreateLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.models.CreatePersonResult": "Face.CreatePersonResult", + "com.azure.ai.vision.face.models.DynamicPersonGroup": "Face.DynamicPersonGroup", + "com.azure.ai.vision.face.models.ExposureLevel": "Face.ExposureLevel", + "com.azure.ai.vision.face.models.ExposureProperties": "Face.ExposureProperties", + "com.azure.ai.vision.face.models.FaceAttributeType": "Face.FaceAttributeType", + "com.azure.ai.vision.face.models.FaceAttributes": "Face.FaceAttributes", + "com.azure.ai.vision.face.models.FaceCollectionTrainingResult": "Face.TrainingResult", + "com.azure.ai.vision.face.models.FaceDetectionModel": "Face.DetectionModel", + "com.azure.ai.vision.face.models.FaceDetectionResult": "Face.FaceDetectionResult", + "com.azure.ai.vision.face.models.FaceFindSimilarResult": "Face.FindSimilarResult", + "com.azure.ai.vision.face.models.FaceGroupingResult": "Face.GroupingResult", + "com.azure.ai.vision.face.models.FaceIdentificationCandidate": "Face.IdentificationCandidate", + "com.azure.ai.vision.face.models.FaceIdentificationResult": "Face.IdentificationResult", + "com.azure.ai.vision.face.models.FaceImageType": "Face.ImageType", + "com.azure.ai.vision.face.models.FaceLandmarks": "Face.FaceLandmarks", + "com.azure.ai.vision.face.models.FaceList": "Face.FaceList", + "com.azure.ai.vision.face.models.FaceListFace": "Face.FaceListFace", + "com.azure.ai.vision.face.models.FaceListItem": "Face.FaceListItem", + "com.azure.ai.vision.face.models.FaceLivenessDecision": "Face.LivenessDecision", + "com.azure.ai.vision.face.models.FaceOperationResult": "Face.OperationResult", + "com.azure.ai.vision.face.models.FaceOperationStatus": "Face.OperationStatus", + "com.azure.ai.vision.face.models.FaceRecognitionModel": "Face.RecognitionModel", + "com.azure.ai.vision.face.models.FaceRectangle": "Face.FaceRectangle", + "com.azure.ai.vision.face.models.FaceSessionStatus": "Face.FaceSessionStatus", + "com.azure.ai.vision.face.models.FaceVerificationResult": "Face.VerificationResult", + "com.azure.ai.vision.face.models.FacialHair": "Face.FacialHair", + "com.azure.ai.vision.face.models.FindSimilarMatchMode": "Face.FindSimilarMatchMode", + "com.azure.ai.vision.face.models.GlassesType": "Face.GlassesType", + "com.azure.ai.vision.face.models.HairColor": "Face.HairColor", + "com.azure.ai.vision.face.models.HairColorType": "Face.HairColorType", + "com.azure.ai.vision.face.models.HairProperties": "Face.HairProperties", + "com.azure.ai.vision.face.models.HeadPose": "Face.HeadPose", + "com.azure.ai.vision.face.models.LandmarkCoordinate": "Face.LandmarkCoordinate", + "com.azure.ai.vision.face.models.LargeFaceList": "Face.LargeFaceList", + "com.azure.ai.vision.face.models.LargeFaceListFace": "Face.LargeFaceListFace", + "com.azure.ai.vision.face.models.LargePersonGroup": "Face.LargePersonGroup", + "com.azure.ai.vision.face.models.LargePersonGroupPerson": "Face.LargePersonGroupPerson", + "com.azure.ai.vision.face.models.LargePersonGroupPersonFace": "Face.LargePersonGroupPersonFace", + "com.azure.ai.vision.face.models.ListFaceResult": "Face.ListFaceResult", + "com.azure.ai.vision.face.models.ListGroupReferenceResult": "Face.ListGroupReferenceResult", + "com.azure.ai.vision.face.models.ListPersonResult": "Face.ListPersonResult", + "com.azure.ai.vision.face.models.LivenessModel": "Face.LivenessModel", + "com.azure.ai.vision.face.models.LivenessOperationMode": "Face.LivenessOperationMode", + "com.azure.ai.vision.face.models.LivenessOutputsTarget": "Face.LivenessOutputsTarget", + "com.azure.ai.vision.face.models.LivenessResponseBody": "Face.LivenessResponseBody", + "com.azure.ai.vision.face.models.LivenessSession": "Face.LivenessSession", + "com.azure.ai.vision.face.models.LivenessSessionAuditEntry": "Face.LivenessSessionAuditEntry", + "com.azure.ai.vision.face.models.LivenessSessionItem": "Face.LivenessSessionItem", + "com.azure.ai.vision.face.models.LivenessWithVerifyImage": "Face.LivenessWithVerifyImage", + "com.azure.ai.vision.face.models.LivenessWithVerifyOutputs": "Face.LivenessWithVerifyOutputs", + "com.azure.ai.vision.face.models.LivenessWithVerifySession": "Face.LivenessWithVerifySession", + "com.azure.ai.vision.face.models.MaskProperties": "Face.MaskProperties", + "com.azure.ai.vision.face.models.MaskType": "Face.MaskType", + "com.azure.ai.vision.face.models.NoiseLevel": "Face.NoiseLevel", + "com.azure.ai.vision.face.models.NoiseProperties": "Face.NoiseProperties", + "com.azure.ai.vision.face.models.OcclusionProperties": "Face.OcclusionProperties", + "com.azure.ai.vision.face.models.PersonDirectoryFace": "Face.PersonDirectoryFace", + "com.azure.ai.vision.face.models.PersonDirectoryPerson": "Face.PersonDirectoryPerson", + "com.azure.ai.vision.face.models.PersonGroup": "Face.PersonGroup", + "com.azure.ai.vision.face.models.PersonGroupPerson": "Face.PersonGroupPerson", + "com.azure.ai.vision.face.models.PersonGroupPersonFace": "Face.PersonGroupPersonFace", + "com.azure.ai.vision.face.models.QualityForRecognition": "Face.QualityForRecognition" + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/main/resources/azure-ai-vision-face.properties b/sdk/vision/azure-ai-vision-face/src/main/resources/azure-ai-vision-face.properties new file mode 100644 index 0000000000000..ca812989b4f27 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/main/resources/azure-ai-vision-face.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/vision/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java b/sdk/vision/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java new file mode 100644 index 0000000000000..75f7d39e6b309 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.ai.vision.face.readme + // END: com.azure.ai.vision.face.readme + } +} diff --git a/sdk/vision/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceClientTestBase.java b/sdk/vision/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceClientTestBase.java new file mode 100644 index 0000000000000..29df5fc1140d9 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/generated/FaceClientTestBase.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.vision.face.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.vision.face.FaceAdministrationClient; +import com.azure.ai.vision.face.FaceAdministrationClientBuilder; +import com.azure.ai.vision.face.FaceClient; +import com.azure.ai.vision.face.FaceClientBuilder; +import com.azure.ai.vision.face.FaceSessionClient; +import com.azure.ai.vision.face.FaceSessionClientBuilder; +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class FaceClientTestBase extends TestProxyTestBase { + protected FaceClient faceClient; + + protected FaceAdministrationClient faceAdministrationClient; + + protected FaceSessionClient faceSessionClient; + + @Override + protected void beforeTest() { + FaceClientBuilder faceClientbuilder + = new FaceClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + faceClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + faceClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + faceClient = faceClientbuilder.buildClient(); + + FaceAdministrationClientBuilder faceAdministrationClientbuilder = new FaceAdministrationClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceAdministrationClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + faceAdministrationClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + faceAdministrationClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + faceAdministrationClient = faceAdministrationClientbuilder.buildClient(); + + FaceSessionClientBuilder faceSessionClientbuilder = new FaceSessionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceSessionClientbuilder.httpClient(interceptorManager.getPlaybackClient()) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } else if (getTestMode() == TestMode.RECORD) { + faceSessionClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + faceSessionClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + faceSessionClient = faceSessionClientbuilder.buildClient(); + + } +} diff --git a/sdk/vision/azure-ai-vision-face/tsp-location.yaml b/sdk/vision/azure-ai-vision-face/tsp-location.yaml new file mode 100644 index 0000000000000..c9ae1c8eeef48 --- /dev/null +++ b/sdk/vision/azure-ai-vision-face/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai/Face +commit: 4d15e8e8e0c72b7e3e2f74186da4b9ed950ce2c2 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/vision/ci.yml b/sdk/vision/ci.yml index f0ebe6c50098c..1f5ecf22c7c6a 100644 --- a/sdk/vision/ci.yml +++ b/sdk/vision/ci.yml @@ -34,12 +34,11 @@ parameters: displayName: azure-ai-vision-imageanalysis type: boolean default: true + - name: release_azureaivisionface + displayName: azure-ai-vision-face + type: boolean + default: true -# Note that IgnoreVerifyTypeSpecCodeGenerationError is set to true here in order to ignore -# errors from the task "Verify TypeSpec Code Generation" in the CI pipeline. This task is -# currently failing because the tools do not account for the additional code snippet that -# were inserted into Java source code comments (JavaDocs). This task will be enabled again -# once the tools are updated. extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: @@ -50,4 +49,8 @@ extends: - name: azure-ai-vision-imageanalysis groupId: com.azure safeName: azureaivisionimageanalysis - releaseInBatch: ${{ parameters.release_azureaivisionimageanalysis }} \ No newline at end of file + releaseInBatch: ${{ parameters.release_azureaivisionimageanalysis }} + - name: azure-ai-vision-face + groupId: com.azure + safeName: azureaivisionface + releaseInBatch: ${{ parameters.release_azureaivisionface }} diff --git a/sdk/vision/pom.xml b/sdk/vision/pom.xml index 6ac7de14460e9..6ccbca17021a0 100644 --- a/sdk/vision/pom.xml +++ b/sdk/vision/pom.xml @@ -10,6 +10,7 @@ 1.0.0 + azure-ai-vision-face azure-ai-vision-imageanalysis \ No newline at end of file