diff --git a/.vscode/cspell.json b/.vscode/cspell.json index ff1fd4cc7915..ea122f4e65e8 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -613,6 +613,13 @@ "riskiq" ] }, + { + "filename": "sdk/face/**", + "words": [ + "Fcomputer", + "Fcontext" + ] + }, { "filename": "**/pom.xml", "patterns": [ diff --git a/sdk/face/azure-ai-vision-face/CHANGELOG.md b/sdk/face/azure-ai-vision-face/CHANGELOG.md index b7a9ec7987a0..9b89bd78639f 100644 --- a/sdk/face/azure-ai-vision-face/CHANGELOG.md +++ b/sdk/face/azure-ai-vision-face/CHANGELOG.md @@ -1,15 +1,24 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2025-07-11) -### Features Added ### Breaking Changes -### Bugs Fixed +- Change the default service API version to `v1.2` +- Removed `CreateLivenessSessionResult` and use `LivenessSession` for liveness session creation and get session. +- Unified `CreateLivenessWithVerifySession` and require the verify image when creating a liveness with verify session. +- Update model `LivenessSession`, `CreateLivenessSessionOptions`, and `CreateLivenessWithVerifySessionContent`. +- Removed `LivenessSessionAudit` +- Removed `GetLivenessSessions` and `GetLivenessWithVerifySessions` +- Removed `PersonDirectory` operations ### Other Changes +- Removed FaceClient customizations +- Liveness + - Added `LivenessSessionAttempt` + ## 1.0.0-beta.2 (2024-10-23) - Added support for the Large Face List and Large Person Group: @@ -18,12 +27,12 @@ - Added models for supporting Large Face List and Large Person Group. - Added support for latest Detect Liveness Session API: - Added operations `GetSessionImage` and `DetectFromSessionImage` to `FaceSessionClient`. - - Added properties `EnableSessionImage ` and `LivenessSingleModalModel` to model `CreateLivenessSessionContent`. + - Added properties `EnableSessionImage ` and `LivenessSingleModalModel` to model `CreateLivenessSessionOptions`. - Added model `CreateLivenessWithVerifySessionContent`. ### Breaking Changes -- Changed the parameter of `CreateLivenessWithVerifySession` from model `CreateLivenessSessionContent` to `CreateLivenessWithVerifySessionContent`. +- Changed the parameter of `CreateLivenessWithVerifySession` from model `CreateLivenessSessionOptions` to `CreateLivenessWithVerifySessionContent`. ### Other Changes diff --git a/sdk/face/azure-ai-vision-face/README.md b/sdk/face/azure-ai-vision-face/README.md index 8f42ce02023e..407d2dbfb178 100644 --- a/sdk/face/azure-ai-vision-face/README.md +++ b/sdk/face/azure-ai-vision-face/README.md @@ -104,9 +104,9 @@ Once completed, set the values of the client ID, tenant ID, and client secret of //variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET String endpoint = "https://.cognitiveservices.azure.com/"; FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); + .endpoint(endpoint) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); ``` #### Create the client with AzureKeyCredential @@ -117,9 +117,9 @@ To use an API key as the `credential` parameter, pass the key as a string into a String endpoint = "https://.cognitiveservices.azure.com/"; String accountKey = ""; FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); ``` ## Key concepts @@ -158,19 +158,19 @@ Detect faces and analyze them from an binary data. The latest model is the most ```java com.azure.ai.vision.face.readme.detectFace FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String imagePathString = Resources.TEST_IMAGE_PATH_DETECT_SAMPLE_IMAGE; Path path = Paths.get(imagePathString); BinaryData imageData = BinaryData.fromFile(path); List attributeTypes = Arrays.asList( - FaceAttributeType.ModelDetection03.HEAD_POSE, FaceAttributeType.ModelDetection03.MASK, FaceAttributeType.ModelRecognition04.QUALITY_FOR_RECOGNITION); + FaceAttributeType.HEAD_POSE, FaceAttributeType.MASK, FaceAttributeType.QUALITY_FOR_RECOGNITION); List results = client.detect( - imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true, - attributeTypes, true, true, 120); + imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true, + attributeTypes, true, true, 120); for (int i = 0, size = results.size(); i < size; i++) { System.out.println("----- Detection result: #" + i + " -----"); @@ -201,48 +201,62 @@ Here is an example to create and get the liveness detection result of a session. ```java com.azure.ai.vision.face.readme.createLivenessSessionAndGetResult System.out.println("Create a liveness session."); FaceSessionClient sessionClient = new FaceSessionClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); -CreateLivenessSessionContent parameters = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(deviceCorrelationId) - .setSendResultsToClient(false); +CreateLivenessSessionOptions parameters = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE) + .setDeviceCorrelationId(deviceCorrelationId); -CreateLivenessSessionResult createLivenessSessionResult = sessionClient.createLivenessSession(parameters); +LivenessSession createLivenessSessionResult = sessionClient.createLivenessSession(parameters); String sessionId = createLivenessSessionResult.getSessionId(); System.out.println("Result: " + sessionId); System.out.println("Get the liveness detection result."); LivenessSession session = sessionClient.getLivenessSessionResult(sessionId); -System.out.println("Result: " + session.getResult().getResponse().getBody().getLivenessDecision()); +if (session.getResults() != null + && session.getResults().getAttempts() != null + && !session.getResults().getAttempts().isEmpty()) { + + if (session.getResults().getAttempts().get(0).getResult() != null) { + FaceLivenessDecision decision = session.getResults().getAttempts().get(0).getResult().getLivenessDecision(); + System.out.println("First Attempt Result: " + decision); + } +} ``` Here is another example for the liveness detection with face verification. ```java com.azure.ai.vision.face.readme.createLivenessWithVerifySessionAndGetResult System.out.println("Create a liveness session."); FaceSessionClient sessionClient = new FaceSessionClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); -CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(deviceCorrelationId) - .setSendResultsToClient(false); Path path = Paths.get(imagePathString); BinaryData verifyImage = BinaryData.fromFile(path); +VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); +CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationId(deviceCorrelationId); -CreateLivenessWithVerifySessionResult createLivenessSessionResult = sessionClient - .createLivenessWithVerifySession(parameters, verifyImage); -String sessionId = createLivenessSessionResult.getSessionId(); +LivenessWithVerifySession livenessWithVerifySessionResults = sessionClient.createLivenessWithVerifySession(parameters); +String sessionId = livenessWithVerifySessionResults.getSessionId(); System.out.println("Result: " + sessionId); System.out.println("Get the liveness detection result."); LivenessWithVerifySession session = sessionClient.getLivenessWithVerifySessionResult(sessionId); -LivenessResponseBody response = session.getResult().getResponse().getBody(); -System.out.println("Result: " + response.getLivenessDecision() + ", Verify result:" + response.getVerifyResult()); +if (session.getResults() != null && session.getResults().getAttempts() != null + && !session.getResults().getAttempts().isEmpty()) { + LivenessWithVerifySessionAttempt attempt = session.getResults().getAttempts().get(0); + if (attempt.getResult() != null) { + FaceLivenessDecision livenessDecision = attempt.getResult().getLivenessDecision(); + LivenessWithVerifyOutputs verifyOutputs = attempt.getResult().getVerifyResult(); + System.out.println("Result: " + livenessDecision + ", Verify result:" + + (verifyOutputs != null ? verifyOutputs.toString() : "null")); + } +} ``` ## Troubleshooting diff --git a/sdk/face/azure-ai-vision-face/assets.json b/sdk/face/azure-ai-vision-face/assets.json index b9896bf3c80d..40ba7f760419 100644 --- a/sdk/face/azure-ai-vision-face/assets.json +++ b/sdk/face/azure-ai-vision-face/assets.json @@ -2,5 +2,5 @@ "AssetsRepo" : "Azure/azure-sdk-assets", "AssetsRepoPrefixPath" : "java", "TagPrefix" : "java/face/azure-ai-vision-face", - "Tag" : "java/face/azure-ai-vision-face_7aba032dc1" + "Tag" : "java/face/azure-ai-vision-face_4d5356423f" } diff --git a/sdk/face/azure-ai-vision-face/customization/pom.xml b/sdk/face/azure-ai-vision-face/customization/pom.xml deleted file mode 100644 index 0fee845d5d19..000000000000 --- a/sdk/face/azure-ai-vision-face/customization/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 4.0.0 - - - com.azure - azure-code-customization-parent - 1.0.0-beta.1 - ../../../parents/azure-code-customization-parent - - - Microsoft Azure Face client for Java - This package contains client customization for Microsoft Azure Face - - com.azure.tools - azure-face-customization - 1.0.0-beta.1 - jar - diff --git a/sdk/face/azure-ai-vision-face/customization/src/main/java/FaceCustomizations.java b/sdk/face/azure-ai-vision-face/customization/src/main/java/FaceCustomizations.java deleted file mode 100644 index 2b69f1137527..000000000000 --- a/sdk/face/azure-ai-vision-face/customization/src/main/java/FaceCustomizations.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -import com.azure.autorest.customization.Customization; -import com.azure.autorest.customization.LibraryCustomization; -import com.github.javaparser.StaticJavaParser; -import com.github.javaparser.ast.Node; -import org.slf4j.Logger; - -/** - * This class contains the customization code to customize the AutoRest generated code for OpenAI. - */ -public class FaceCustomizations extends Customization { - - @Override - public void customize(LibraryCustomization customization, Logger logger) { - customization.getClass("com.azure.ai.vision.face.administration", "FaceAdministrationClientBuilder") - .customizeAst(ast -> ast.getClassByName("FaceAdministrationClientBuilder").ifPresent(clazz -> { - clazz.getAnnotationByName("ServiceClientBuilder").ifPresent(Node::remove); - clazz.addAnnotation(StaticJavaParser.parseAnnotation("@ServiceClientBuilder(serviceClients = {" - + "FaceAdministrationClient.class, FaceAdministrationAsyncClient.class, LargeFaceListClient.class, " - + "LargePersonGroupClient.class, LargeFaceListAsyncClient.class, LargePersonGroupAsyncClient.class })")); - })); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java index aaafa729738f..6b01da5e056f 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceAsyncClient.java @@ -62,269 +62,6 @@ public final class FaceAsyncClient { this.serviceClient = serviceClient; } - /** - * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the - * faces created by Detect. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more - * details. - *

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 findSimilarRequest The findSimilarRequest 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 findSimilarRequest, - RequestOptions requestOptions) { - return this.serviceClient.findSimilarWithResponseAsync(findSimilarRequest, requestOptions); - } - - /** - * Verify whether two faces belong to a same person. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for - * more details. - *

Request Body Schema

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

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     isIdentical: boolean (Required)
-     *     confidence: double (Required)
-     * }
-     * }
-     * 
- * - * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest 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 verifyFaceToFaceRequest, - RequestOptions requestOptions) { - return this.serviceClient.verifyFaceToFaceWithResponseAsync(verifyFaceToFaceRequest, requestOptions); - } - - /** - * Divide candidate faces into groups based on face similarity. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. - *

Request Body Schema

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

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     groups (Required): [
-     *          (Required)[
-     *             String (Required)
-     *         ]
-     *     ]
-     *     messyGroup (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
-     * 
- * - * @param groupRequest The groupRequest 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 groupRequest, RequestOptions requestOptions) { - return this.serviceClient.groupWithResponseAsync(groupRequest, 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more - * details. - * - * @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 findSimilarRequestObj - = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) - .setMode(mode); - BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); - return findSimilarWithResponse(findSimilarRequest, 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more - * details. - * - * @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 findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); - BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); - return findSimilarWithResponse(findSimilarRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); - } - - /** - * Verify whether two faces belong to a same person. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for - * more details. - * - * @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 verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); - BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); - return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); - } - - /** - * Divide candidate faces into groups based on face similarity. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. - * - * @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 groupRequestObj = new GroupRequest(faceIds); - BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); - return groupWithResponse(groupRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(FaceGroupingResult.class)); - } - - @Generated - private static final TypeReference> TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT - = new TypeReference>() { - }; - /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * @@ -629,18 +366,307 @@ Mono> detectFromUrlImplWithResponse(BinaryData detectFromUr * } * * - * @param imageContent The input image binary. + * @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> detectImplWithResponse(BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.detectImplWithResponseAsync(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. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. + *

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 findSimilarRequest The findSimilarRequest 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 findSimilarRequest, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponseAsync(findSimilarRequest, requestOptions); + } + + /** + * Verify whether two faces belong to a same person. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for + * more details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+     * 
+ * + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest 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 verifyFaceToFaceRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponseAsync(verifyFaceToFaceRequest, requestOptions); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param groupRequest The groupRequest 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 groupRequest, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponseAsync(groupRequest, 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. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list for more + * details. + *

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 findSimilarFromLargeFaceListRequest The findSimilarFromLargeFaceListRequest 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 findSimilarFromLargeFaceListRequest, RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromLargeFaceListWithResponseAsync(findSimilarFromLargeFaceListRequest, + requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + *

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 identifyFromLargePersonGroupRequest The identifyFromLargePersonGroupRequest 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 identifyFromLargePersonGroupRequest, RequestOptions requestOptions) { + return this.serviceClient.identifyFromLargePersonGroupWithResponseAsync(identifyFromLargePersonGroupRequest, + requestOptions); + } + + /** + * Verify whether a face belongs to a person in a Large Person Group. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-from-large-person-group for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+     * 
+ * + * @param verifyFromLargePersonGroupRequest The verifyFromLargePersonGroupRequest 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}. + * @return verify result along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> detectImplWithResponse(BinaryData imageContent, RequestOptions requestOptions) { - return this.serviceClient.detectImplWithResponseAsync(imageContent, requestOptions); + public Mono> verifyFromLargePersonGroupWithResponse( + BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponseAsync(verifyFromLargePersonGroupRequest, + requestOptions); } /** @@ -791,11 +817,6 @@ Mono> detectImpl(BinaryData imageContent) { .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT)); } - @Generated - private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT - = new TypeReference>() { - }; - /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * @@ -1268,152 +1289,121 @@ public Mono> detect(String url, FaceDetectionModel det } /** - * 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. + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list for more + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more * details. - *

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 findSimilarFromLargeFaceListRequest The findSimilarFromLargeFaceListRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @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> findSimilarFromLargeFaceListWithResponse( - BinaryData findSimilarFromLargeFaceListRequest, RequestOptions requestOptions) { - return this.serviceClient.findSimilarFromLargeFaceListWithResponseAsync(findSimilarFromLargeFaceListRequest, - requestOptions); + public Mono> findSimilar(String faceId, List faceIds, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest findSimilarRequestObj + = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, 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 Large Person Group. + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group - * for more details. - *

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)
-     *             }
-     *         ]
-     *     }
-     * ]
-     * }
-     * 
+ * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. * - * @param identifyFromLargePersonGroupRequest The identifyFromLargePersonGroupRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @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> identifyFromLargePersonGroupWithResponse( - BinaryData identifyFromLargePersonGroupRequest, RequestOptions requestOptions) { - return this.serviceClient.identifyFromLargePersonGroupWithResponseAsync(identifyFromLargePersonGroupRequest, - requestOptions); + public Mono> findSimilar(String faceId, List faceIds) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT)); } /** - * Verify whether a face belongs to a person in a Large Person Group. + * Verify whether two faces belong to a same person. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-from-large-person-group for more - * details. - *

Request Body Schema

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

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     isIdentical: boolean (Required)
-     *     confidence: double (Required)
-     * }
-     * }
-     * 
+ * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for + * more details. * - * @param verifyFromLargePersonGroupRequest The verifyFromLargePersonGroupRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return verify result along with {@link Response} on successful completion of {@link Mono}. + * @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> verifyFromLargePersonGroupWithResponse( - BinaryData verifyFromLargePersonGroupRequest, RequestOptions requestOptions) { - return this.serviceClient.verifyFromLargePersonGroupWithResponseAsync(verifyFromLargePersonGroupRequest, - requestOptions); + public Mono verifyFaceToFace(String faceId1, String faceId2) { + // Generated convenience method for verifyFaceToFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFaceToFaceRequest verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); + return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); + } + + /** + * Divide candidate faces into groups based on face similarity. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. + * + * @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 groupRequestObj = new GroupRequest(faceIds); + BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); + return groupWithResponse(groupRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(FaceGroupingResult.class)); } /** @@ -1592,8 +1582,18 @@ public Mono verifyFromLargePersonGroup(String faceId, St .map(protocolMethodData -> protocolMethodData.toObject(FaceVerificationResult.class)); } + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT + = new TypeReference>() { + }; + @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/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java index 5a7923d36ae3..7e66c3c46c09 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClient.java @@ -61,22 +61,43 @@ public final class FaceClient { } /** - * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the - * faces created by Detect. + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more * details. + *

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'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 + * pixels) and rotated face orientations. 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
      * {
-     *     faceId: String (Required)
-     *     maxNumOfCandidatesReturned: Integer (Optional)
-     *     mode: String(matchPerson/matchFace) (Optional)
-     *     faceIds (Required): [
-     *         String (Required)
-     *     ]
+     *     url: String (Required)
      * }
      * }
      * 
@@ -87,15 +108,105 @@ public final class FaceClient { * {@code * [ * (Required){ - * confidence: double (Required) * faceId: String (Optional) - * persistedFaceId: 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 findSimilarRequest The findSimilarRequest parameter. + * @param detectFromUrlRequest The detectFromUrlRequest 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. @@ -105,260 +216,46 @@ public final class FaceClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response findSimilarWithResponse(BinaryData findSimilarRequest, RequestOptions requestOptions) { - return this.serviceClient.findSimilarWithResponse(findSimilarRequest, requestOptions); - } - - /** - * Verify whether two faces belong to a same person. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for - * more details. - *

Request Body Schema

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

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     isIdentical: boolean (Required)
-     *     confidence: double (Required)
-     * }
-     * }
-     * 
- * - * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest 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 verifyFaceToFaceRequest, - RequestOptions requestOptions) { - return this.serviceClient.verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions); + Response detectFromUrlImplWithResponse(BinaryData detectFromUrlRequest, RequestOptions requestOptions) { + return this.serviceClient.detectFromUrlImplWithResponse(detectFromUrlRequest, requestOptions); } /** - * Divide candidate faces into groups based on face similarity. + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. + *

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'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 + * pixels) and rotated face orientations. 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
-     * {
-     *     faceIds (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     groups (Required): [
-     *          (Required)[
-     *             String (Required)
-     *         ]
-     *     ]
-     *     messyGroup (Required): [
-     *         String (Required)
-     *     ]
-     * }
-     * }
-     * 
- * - * @param groupRequest The groupRequest 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 groupRequest, RequestOptions requestOptions) { - return this.serviceClient.groupWithResponse(groupRequest, 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more - * details. - * - * @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 findSimilarRequestObj - = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) - .setMode(mode); - BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); - return findSimilarWithResponse(findSimilarRequest, 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more - * details. - * - * @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 findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); - BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); - return findSimilarWithResponse(findSimilarRequest, requestOptions).getValue() - .toObject(TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT); - } - - /** - * Verify whether two faces belong to a same person. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for - * more details. - * - * @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 verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); - BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); - return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).getValue() - .toObject(FaceVerificationResult.class); - } - - /** - * Divide candidate faces into groups based on face similarity. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. - * - * @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 groupRequestObj = new GroupRequest(faceIds); - BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); - return groupWithResponse(groupRequest, requestOptions).getValue().toObject(FaceGroupingResult.class); - } - - @Generated - private static final TypeReference> TYPE_REFERENCE_LIST_FACE_FIND_SIMILAR_RESULT - = new TypeReference>() { - }; - - /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. - * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more - * details. - *

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'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 - * pixels) and rotated face orientations. 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)
-     * }
+     * BinaryData
      * }
      * 
* @@ -466,7 +363,7 @@ public FaceGroupingResult group(List faceIds) { * } * * - * @param detectFromUrlRequest The detectFromUrlRequest parameter. + * @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. @@ -476,46 +373,28 @@ public FaceGroupingResult group(List faceIds) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response detectFromUrlImplWithResponse(BinaryData detectFromUrlRequest, RequestOptions requestOptions) { - return this.serviceClient.detectFromUrlImplWithResponse(detectFromUrlRequest, requestOptions); + Response detectImplWithResponse(BinaryData imageContent, RequestOptions requestOptions) { + return this.serviceClient.detectImplWithResponse(imageContent, requestOptions); } /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. - *

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'. 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 - * pixels) and rotated face orientations. 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} + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more + * details. *

Request Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     faceId: String (Required)
+     *     maxNumOfCandidatesReturned: Integer (Optional)
+     *     mode: String(matchPerson/matchFace) (Optional)
+     *     faceIds (Required): [
+     *         String (Required)
+     *     ]
+     * }
      * }
      * 
* @@ -525,105 +404,15 @@ Response detectFromUrlImplWithResponse(BinaryData detectFromUrlReque * {@code * [ * (Required){ + * confidence: double (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) - * } + * persistedFaceId: String (Optional) * } * ] * } * * - * @param imageContent The input image binary. + * @param findSimilarRequest The findSimilarRequest 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. @@ -633,163 +422,248 @@ Response detectFromUrlImplWithResponse(BinaryData detectFromUrlReque */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response detectImplWithResponse(BinaryData imageContent, RequestOptions requestOptions) { - return this.serviceClient.detectImplWithResponse(imageContent, requestOptions); + public Response findSimilarWithResponse(BinaryData findSimilarRequest, RequestOptions requestOptions) { + return this.serviceClient.findSimilarWithResponse(findSimilarRequest, requestOptions); } /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * Verify whether two faces belong to a same person. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more - * details. + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for + * more details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+     * 
* - * @param options Options for detectFromUrlImpl API. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param verifyFaceToFaceRequest The verifyFaceToFaceRequest 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return verify result along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - List detectFromUrlImpl(DetectFromUrlImplOptions options) { - // Generated convenience method for detectFromUrlImplWithResponse - RequestOptions requestOptions = new RequestOptions(); - FaceDetectionModel detectionModel = options.getDetectionModel(); - FaceRecognitionModel recognitionModel = options.getRecognitionModel(); - Boolean returnFaceId = options.isReturnFaceId(); - List returnFaceAttributes = options.getReturnFaceAttributes(); - Boolean returnFaceLandmarks = options.isReturnFaceLandmarks(); - Boolean returnRecognitionModel = options.isReturnRecognitionModel(); - Integer faceIdTimeToLive = options.getFaceIdTimeToLive(); - DetectFromUrlRequest detectFromUrlRequestObj = new DetectFromUrlRequest(options.getUrl()); - BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); - if (detectionModel != null) { - requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); - } - if (recognitionModel != null) { - requestOptions.addQueryParam("recognitionModel", recognitionModel.toString(), false); - } - if (returnFaceId != null) { - requestOptions.addQueryParam("returnFaceId", String.valueOf(returnFaceId), false); - } - if (returnFaceAttributes != null) { - requestOptions.addQueryParam("returnFaceAttributes", - returnFaceAttributes.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - if (returnFaceLandmarks != null) { - requestOptions.addQueryParam("returnFaceLandmarks", String.valueOf(returnFaceLandmarks), false); - } - if (returnRecognitionModel != null) { - requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); - } - if (faceIdTimeToLive != null) { - requestOptions.addQueryParam("faceIdTimeToLive", String.valueOf(faceIdTimeToLive), false); - } - return detectFromUrlImplWithResponse(detectFromUrlRequest, requestOptions).getValue() - .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + public Response verifyFaceToFaceWithResponse(BinaryData verifyFaceToFaceRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions); } /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * Divide candidate faces into groups based on face similarity. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     groups (Required): [
+     *          (Required)[
+     *             String (Required)
+     *         ]
+     *     ]
+     *     messyGroup (Required): [
+     *         String (Required)
+     *     ]
+     * }
+     * }
+     * 
* - * @param imageContent The input image binary. - * @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'. - * 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and rotated face - * orientations. - * @param recognitionModel The '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'. - * @param returnFaceId Return faceIds of the detected faces or not. The default value is true. - * @param returnFaceAttributes Analyze 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. - * @param returnFaceLandmarks Return face landmarks of the detected faces or not. The default value is false. - * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. This is only - * applicable when returnFaceId = true. - * @param faceIdTimeToLive The 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). - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param groupRequest The groupRequest 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 groupRequest, RequestOptions requestOptions) { + return this.serviceClient.groupWithResponse(groupRequest, 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. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list for more + * details. + *

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 findSimilarFromLargeFaceListRequest The findSimilarFromLargeFaceListRequest 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 findSimilarFromLargeFaceListRequest, + RequestOptions requestOptions) { + return this.serviceClient.findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, + requestOptions); + } + + /** + * 1-to-many identification to find the closest matches of the specific query person face from a Large Person Group. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group + * for more details. + *

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 identifyFromLargePersonGroupRequest The identifyFromLargePersonGroupRequest 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - List detectImpl(BinaryData imageContent, FaceDetectionModel detectionModel, - FaceRecognitionModel recognitionModel, Boolean returnFaceId, List returnFaceAttributes, - Boolean returnFaceLandmarks, Boolean returnRecognitionModel, Integer faceIdTimeToLive) { - // Generated convenience method for detectImplWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (detectionModel != null) { - requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); - } - if (recognitionModel != null) { - requestOptions.addQueryParam("recognitionModel", recognitionModel.toString(), false); - } - if (returnFaceId != null) { - requestOptions.addQueryParam("returnFaceId", String.valueOf(returnFaceId), false); - } - if (returnFaceAttributes != null) { - requestOptions.addQueryParam("returnFaceAttributes", - returnFaceAttributes.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")), - false); - } - if (returnFaceLandmarks != null) { - requestOptions.addQueryParam("returnFaceLandmarks", String.valueOf(returnFaceLandmarks), false); - } - if (returnRecognitionModel != null) { - requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); - } - if (faceIdTimeToLive != null) { - requestOptions.addQueryParam("faceIdTimeToLive", String.valueOf(faceIdTimeToLive), false); - } - return detectImplWithResponse(imageContent, requestOptions).getValue() - .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + public Response identifyFromLargePersonGroupWithResponse(BinaryData identifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + return this.serviceClient.identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, + requestOptions); } /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * Verify whether a face belongs to a person in a Large Person Group. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. + * Please refer to + * https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-from-large-person-group for more + * details. + *

Request Body Schema

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

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     isIdentical: boolean (Required)
+     *     confidence: double (Required)
+     * }
+     * }
+     * 
* - * @param imageContent The input image binary. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param verifyFromLargePersonGroupRequest The verifyFromLargePersonGroupRequest 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return verify result along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - List detectImpl(BinaryData imageContent) { - // Generated convenience method for detectImplWithResponse - RequestOptions requestOptions = new RequestOptions(); - return detectImplWithResponse(imageContent, requestOptions).getValue() - .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + public Response verifyFromLargePersonGroupWithResponse(BinaryData verifyFromLargePersonGroupRequest, + RequestOptions requestOptions) { + return this.serviceClient.verifyFromLargePersonGroupWithResponse(verifyFromLargePersonGroupRequest, + requestOptions); } - @Generated - private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT - = new TypeReference>() { - }; - /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * @@ -981,18 +855,195 @@ public List detect(String url, FaceDetectionModel detection /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more - * details. + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * details. + * + * @param url the URL of input image. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. + * @param recognitionModel The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. + * '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'. + * 86400 seconds. The default value is 86400 (24 hours). + * @param returnFaceId Return faceIds of the detected faces or not. The default value is true. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List detect(String url, FaceDetectionModel detectionModel, + FaceRecognitionModel recognitionModel, boolean returnFaceId) { + return this.detect(url, detectionModel, recognitionModel, returnFaceId, null, null, null, null); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * details. + * + * @param url the URL of input image. + * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' + * values include 'detection_01', 'detection_02' and 'detection_03'. + * @param recognitionModel The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' + * values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. + * '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 returnFaceId Return faceIds of the detected faces or not. The default value is true. + * @param returnFaceAttributes Analyze 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. + * 86400 seconds. The default value is 86400 (24 hours). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public List detect(String url, FaceDetectionModel detectionModel, + FaceRecognitionModel recognitionModel, boolean returnFaceId, List returnFaceAttributes) { + return this.detect(url, detectionModel, recognitionModel, returnFaceId, returnFaceAttributes, null, null, null); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * details. + * + * @param options Options for detectFromUrlImpl API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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) + List detectFromUrlImpl(DetectFromUrlImplOptions options) { + // Generated convenience method for detectFromUrlImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + FaceDetectionModel detectionModel = options.getDetectionModel(); + FaceRecognitionModel recognitionModel = options.getRecognitionModel(); + Boolean returnFaceId = options.isReturnFaceId(); + List returnFaceAttributes = options.getReturnFaceAttributes(); + Boolean returnFaceLandmarks = options.isReturnFaceLandmarks(); + Boolean returnRecognitionModel = options.isReturnRecognitionModel(); + Integer faceIdTimeToLive = options.getFaceIdTimeToLive(); + DetectFromUrlRequest detectFromUrlRequestObj = new DetectFromUrlRequest(options.getUrl()); + BinaryData detectFromUrlRequest = BinaryData.fromObject(detectFromUrlRequestObj); + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (recognitionModel != null) { + requestOptions.addQueryParam("recognitionModel", recognitionModel.toString(), false); + } + if (returnFaceId != null) { + requestOptions.addQueryParam("returnFaceId", String.valueOf(returnFaceId), false); + } + if (returnFaceAttributes != null) { + requestOptions.addQueryParam("returnFaceAttributes", + returnFaceAttributes.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (returnFaceLandmarks != null) { + requestOptions.addQueryParam("returnFaceLandmarks", String.valueOf(returnFaceLandmarks), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + if (faceIdTimeToLive != null) { + requestOptions.addQueryParam("faceIdTimeToLive", String.valueOf(faceIdTimeToLive), false); + } + return detectFromUrlImplWithResponse(detectFromUrlRequest, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. + * + * @param imageContent The input image binary. + * @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'. + * 'detection_03' is recommended since its accuracy is improved on smaller faces (64x64 pixels) and rotated face + * orientations. + * @param recognitionModel The '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'. + * @param returnFaceId Return faceIds of the detected faces or not. The default value is true. + * @param returnFaceAttributes Analyze 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. + * @param returnFaceLandmarks Return face landmarks of the detected faces or not. The default value is false. + * @param returnRecognitionModel Return 'recognitionModel' or not. The default value is false. This is only + * applicable when returnFaceId = true. + * @param faceIdTimeToLive The 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). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the 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) + List detectImpl(BinaryData imageContent, FaceDetectionModel detectionModel, + FaceRecognitionModel recognitionModel, Boolean returnFaceId, List returnFaceAttributes, + Boolean returnFaceLandmarks, Boolean returnRecognitionModel, Integer faceIdTimeToLive) { + // Generated convenience method for detectImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (detectionModel != null) { + requestOptions.addQueryParam("detectionModel", detectionModel.toString(), false); + } + if (recognitionModel != null) { + requestOptions.addQueryParam("recognitionModel", recognitionModel.toString(), false); + } + if (returnFaceId != null) { + requestOptions.addQueryParam("returnFaceId", String.valueOf(returnFaceId), false); + } + if (returnFaceAttributes != null) { + requestOptions.addQueryParam("returnFaceAttributes", + returnFaceAttributes.stream() + .map(paramItemValue -> Objects.toString(paramItemValue, "")) + .collect(Collectors.joining(",")), + false); + } + if (returnFaceLandmarks != null) { + requestOptions.addQueryParam("returnFaceLandmarks", String.valueOf(returnFaceLandmarks), false); + } + if (returnRecognitionModel != null) { + requestOptions.addQueryParam("returnRecognitionModel", String.valueOf(returnRecognitionModel), false); + } + if (faceIdTimeToLive != null) { + requestOptions.addQueryParam("faceIdTimeToLive", String.valueOf(faceIdTimeToLive), false); + } + return detectImplWithResponse(imageContent, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); + } + + /** + * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * + * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect for more details. * - * @param url the URL of input image. - * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' - * values include 'detection_01', 'detection_02' and 'detection_03'. - * @param recognitionModel The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' - * values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. - * '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'. - * 86400 seconds. The default value is 86400 (24 hours). - * @param returnFaceId Return faceIds of the detected faces or not. The default value is true. + * @param imageContent The input image binary. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1001,30 +1052,29 @@ public List detect(String url, FaceDetectionModel detection * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public List detect(String url, FaceDetectionModel detectionModel, - FaceRecognitionModel recognitionModel, boolean returnFaceId) { - return this.detect(url, detectionModel, recognitionModel, returnFaceId, null, null, null, null); + List detectImpl(BinaryData imageContent) { + // Generated convenience method for detectImplWithResponse + RequestOptions requestOptions = new RequestOptions(); + return detectImplWithResponse(imageContent, requestOptions).getValue() + .toObject(TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT); } /** - * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-detection-operations/detect-from-url for more + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more * details. * - * @param url the URL of input image. - * @param detectionModel The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' - * values include 'detection_01', 'detection_02' and 'detection_03'. - * @param recognitionModel The 'recognitionModel' associated with the detected faceIds. Supported 'recognitionModel' - * values include 'recognition_01', 'recognition_02', 'recognition_03' or 'recognition_04'. - * '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 returnFaceId Return faceIds of the detected faces or not. The default value is true. - * @param returnFaceAttributes Analyze 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. - * 86400 seconds. The default value is 86400 (24 hours). + * @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. @@ -1033,159 +1083,99 @@ public List detect(String url, FaceDetectionModel detection * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public List detect(String url, FaceDetectionModel detectionModel, - FaceRecognitionModel recognitionModel, boolean returnFaceId, List returnFaceAttributes) { - return this.detect(url, detectionModel, recognitionModel, returnFaceId, returnFaceAttributes, null, null, null); + public List findSimilar(String faceId, List faceIds, + Integer maxNumOfCandidatesReturned, FindSimilarMatchMode mode) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest findSimilarRequestObj + = new FindSimilarRequest(faceId, faceIds).setMaxNumOfCandidatesReturned(maxNumOfCandidatesReturned) + .setMode(mode); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, 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. + * Given query face's faceId, to search the similar-looking faces from a faceId array. A faceId array contains the + * faces created by Detect. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar-from-large-face-list for more + * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/find-similar for more * details. - *

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 findSimilarFromLargeFaceListRequest The findSimilarFromLargeFaceListRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return the response body along with {@link Response}. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response findSimilarFromLargeFaceListWithResponse(BinaryData findSimilarFromLargeFaceListRequest, - RequestOptions requestOptions) { - return this.serviceClient.findSimilarFromLargeFaceListWithResponse(findSimilarFromLargeFaceListRequest, - requestOptions); + public List findSimilar(String faceId, List faceIds) { + // Generated convenience method for findSimilarWithResponse + RequestOptions requestOptions = new RequestOptions(); + FindSimilarRequest findSimilarRequestObj = new FindSimilarRequest(faceId, faceIds); + BinaryData findSimilarRequest = BinaryData.fromObject(findSimilarRequestObj); + return findSimilarWithResponse(findSimilarRequest, 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 Large Person Group. + * Verify whether two faces belong to a same person. * - * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/identify-from-person-group - * for more details. - *

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)
-     *             }
-     *         ]
-     *     }
-     * ]
-     * }
-     * 
+ * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-face-to-face for + * more details. * - * @param identifyFromLargePersonGroupRequest The identifyFromLargePersonGroupRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return the response body along with {@link Response}. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return verify result. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response identifyFromLargePersonGroupWithResponse(BinaryData identifyFromLargePersonGroupRequest, - RequestOptions requestOptions) { - return this.serviceClient.identifyFromLargePersonGroupWithResponse(identifyFromLargePersonGroupRequest, - requestOptions); + public FaceVerificationResult verifyFaceToFace(String faceId1, String faceId2) { + // Generated convenience method for verifyFaceToFaceWithResponse + RequestOptions requestOptions = new RequestOptions(); + VerifyFaceToFaceRequest verifyFaceToFaceRequestObj = new VerifyFaceToFaceRequest(faceId1, faceId2); + BinaryData verifyFaceToFaceRequest = BinaryData.fromObject(verifyFaceToFaceRequestObj); + return verifyFaceToFaceWithResponse(verifyFaceToFaceRequest, requestOptions).getValue() + .toObject(FaceVerificationResult.class); } /** - * Verify whether a face belongs to a person in a Large Person Group. + * Divide candidate faces into groups based on face similarity. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/face-recognition-operations/verify-from-large-person-group for more - * details. - *

Request Body Schema

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

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     isIdentical: boolean (Required)
-     *     confidence: double (Required)
-     * }
-     * }
-     * 
+ * Please refer to https://learn.microsoft.com/rest/api/face/face-recognition-operations/group for more details. * - * @param verifyFromLargePersonGroupRequest The verifyFromLargePersonGroupRequest parameter. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @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. - * @return verify result along with {@link Response}. + * @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 Response verifyFromLargePersonGroupWithResponse(BinaryData verifyFromLargePersonGroupRequest, - RequestOptions requestOptions) { - return this.serviceClient.verifyFromLargePersonGroupWithResponse(verifyFromLargePersonGroupRequest, - requestOptions); + public FaceGroupingResult group(List faceIds) { + // Generated convenience method for groupWithResponse + RequestOptions requestOptions = new RequestOptions(); + GroupRequest groupRequestObj = new GroupRequest(faceIds); + BinaryData groupRequest = BinaryData.fromObject(groupRequestObj); + return groupWithResponse(groupRequest, requestOptions).getValue().toObject(FaceGroupingResult.class); } /** @@ -1359,8 +1349,18 @@ public FaceVerificationResult verifyFromLargePersonGroup(String faceId, String l .toObject(FaceVerificationResult.class); } + @Generated + private static final TypeReference> TYPE_REFERENCE_LIST_FACE_DETECTION_RESULT + = new TypeReference>() { + }; + @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/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java index 1a8ad516f07d..4e864c3c76a2 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceClientBuilder.java @@ -73,37 +73,37 @@ public FaceClientBuilder() { } /* - * The HTTP pipeline to send requests through. + * The HTTP client used to send the request. */ @Generated - private HttpPipeline pipeline; + private HttpClient httpClient; /** * {@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; + public FaceClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP client used to send the request. + * The HTTP pipeline to send requests through. */ @Generated - private HttpClient httpClient; + private HttpPipeline pipeline; /** * {@inheritDoc}. */ @Generated @Override - public FaceClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + 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; } @@ -282,6 +282,13 @@ private FaceClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -344,11 +351,4 @@ public FaceClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(FaceClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java index af9dcc3ead7f..ec1a4464357d 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceServiceVersion.java @@ -18,7 +18,12 @@ public enum FaceServiceVersion implements ServiceVersion { /** * Enum value v1.2-preview.1. */ - V1_2_PREVIEW_1("v1.2-preview.1"); + V1_2_PREVIEW_1("v1.2-preview.1"), + + /** + * Enum value v1.2. + */ + V1_2("v1.2"); private final String version; @@ -40,6 +45,6 @@ public String getVersion() { * @return The latest {@link FaceServiceVersion}. */ public static FaceServiceVersion getLatest() { - return V1_2_PREVIEW_1; + return V1_2; } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java index 8aa67438dbd9..f6216c17cae4 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionAsyncClient.java @@ -5,21 +5,15 @@ import com.azure.ai.vision.face.implementation.FaceSessionClientImpl; import com.azure.ai.vision.face.implementation.MultipartFormDataHelper; -import com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent; import com.azure.ai.vision.face.implementation.models.DetectFromSessionImageRequest; -import com.azure.ai.vision.face.implementation.models.VerifyImageFileDetails; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.DetectFromSessionImageOptions; import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceDetectionResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; 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; @@ -69,10 +63,9 @@ public final class FaceSessionAsyncClient { * {@code * { * livenessOperationMode: String(Passive/PassiveActive) (Required) - * sendResultsToClient: Boolean (Optional) * deviceCorrelationIdSetInClient: Boolean (Optional) * enableSessionImage: Boolean (Optional) - * livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional) + * livenessModelVersion: String(2024-11-15) (Optional) * deviceCorrelationId: String (Optional) * authTokenTimeToLiveInSeconds: Integer (Optional) * } @@ -86,113 +79,41 @@ public final class FaceSessionAsyncClient { * { * sessionId: String (Required) * authToken: String (Required) - * } - * } - * - * - * @param body Body 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 liveness session creation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createLivenessSessionWithResponse(BinaryData body, - RequestOptions requestOptions) { - return this.serviceClient.createLivenessSessionWithResponseAsync(body, requestOptions); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for - * more details. - * - * @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); - } - - /** - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): {
+     *                                 top: int (Required)
+     *                                 left: int (Required)
+     *                                 width: int (Required)
+     *                                 height: int (Required)
+     *                             }
+     *                         }
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
      * 
* - * @param sessionId The unique ID to reference this session. + * @param options Options 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. @@ -202,251 +123,15 @@ public Mono> deleteLivenessSessionWithResponse(String sessionId, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLivenessSessionResultWithResponse(String sessionId, - RequestOptions requestOptions) { - return this.serviceClient.getLivenessSessionResultWithResponseAsync(sessionId, requestOptions); - } - - /** - * Lists sessions for /detectLiveness/SingleModal. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - *

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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for - * more details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     livenessOperationMode: String(Passive/PassiveActive) (Required)
-     *     sendResultsToClient: Boolean (Optional)
-     *     deviceCorrelationIdSetInClient: Boolean (Optional)
-     *     enableSessionImage: Boolean (Optional)
-     *     livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *     deviceCorrelationId: String (Optional)
-     *     authTokenTimeToLiveInSeconds: Integer (Optional)
-     *     returnVerifyImageHash: Boolean (Optional)
-     *     verifyConfidenceThreshold: Double (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 body Body 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 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 body, - RequestOptions requestOptions) { - return this.serviceClient.createLivenessWithVerifySessionWithResponseAsync(body, requestOptions); - } - - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. - *

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 body Request content 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 body, + public Mono> createLivenessSessionWithResponse(BinaryData options, RequestOptions requestOptions) { - // Operation 'createLivenessWithVerifySessionWithVerifyImage' is of content-type 'multipart/form-data'. Protocol - // API is not usable and hence not generated. - return this.serviceClient.createLivenessWithVerifySessionWithVerifyImageWithResponseAsync(body, requestOptions); + return this.serviceClient.createLivenessSessionWithResponseAsync(options, requestOptions); } /** * Delete all session related information for matching the specified session id. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for * more details. * * @param sessionId The unique ID to reference this session. @@ -459,600 +144,239 @@ Mono> createLivenessWithVerifySessionWithVerifyImageWithRes */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLivenessWithVerifySessionWithResponse(String sessionId, - RequestOptions requestOptions) { - return this.serviceClient.deleteLivenessWithVerifySessionWithResponseAsync(sessionId, requestOptions); + public Mono> deleteLivenessSessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessSessionWithResponseAsync(sessionId, requestOptions); } /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for - * more details. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result + * for more details. *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * }
-     * }
-     * 
- * - * @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 detect liveness with verify 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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. - *

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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for - * more details. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the 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 body) { - // Generated convenience method for createLivenessSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createLivenessSessionWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessSessionResult.class)); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for - * more details. - * - * @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); - } - - /** - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result - * for more details. - * - * @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 detect liveness 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - * - * @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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the 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)); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - * - * @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 the response body 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)); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - * - * @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 the response body 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)); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for - * more details. - * - * @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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for - * more details. - * - * @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 detect liveness with verify 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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. - * - * @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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. + * { + * sessionId: String (Required) + * authToken: String (Required) + * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * modelVersion: String(2024-11-15) (Optional) + * results (Required): { + * attempts (Required): [ + * (Required){ + * attemptId: int (Required) + * attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * result (Optional): { + * livenessDecision: String(uncertain/realface/spoofface) (Optional) + * targets (Required): { + * color (Required): { + * faceRectangle (Required): { + * top: int (Required) + * left: int (Required) + * width: int (Required) + * height: int (Required) + * } + * } + * } + * digest: String (Required) + * sessionImageId: String (Optional) + * } + * error (Optional): { + * code: String (Required) + * message: String (Required) + * targets (Required): (recursive schema, see targets above) + * } + * } + * ] + * } + * } + * } + * * + * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return session result of detect liveness along with {@link Response} 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)); + public Mono> getLivenessSessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionResultWithResponseAsync(sessionId, requestOptions); } /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image * for more details. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
* - * @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. + * @param body Request content 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return session result of detect liveness with verify along with {@link Response} 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)); + Mono> createLivenessWithVerifySessionWithResponse(BinaryData body, + RequestOptions requestOptions) { + // Operation 'createLivenessWithVerifySession' is of content-type 'multipart/form-data'. Protocol API is not + // usable and hence not generated. + return this.serviceClient.createLivenessWithVerifySessionWithResponseAsync(body, requestOptions); } /** + * Delete all session related information for matching the specified session id. + * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. * * @param sessionId The unique ID to reference this session. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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}. + * @return the {@link Response} 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)); + public Mono> deleteLivenessWithVerifySessionWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessWithVerifySessionWithResponseAsync(sessionId, requestOptions); } - @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>() { - }; - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for + * more details. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
* - * @param body Request content of liveness with verify session creation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. - * @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 + * @return session result of detect liveness with verify along with {@link Response} on successful completion of * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono - createLivenessWithVerifySessionWithVerifyImage(CreateLivenessWithVerifySessionMultipartContent body) { - // Generated convenience method for createLivenessWithVerifySessionWithVerifyImageWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createLivenessWithVerifySessionWithVerifyImageWithResponse( - new MultipartFormDataHelper(requestOptions).serializeJsonField("Parameters", body.getParameters()) - .serializeFileField("VerifyImage", body.getVerifyImage().getContent(), - body.getVerifyImage().getContentType(), body.getVerifyImage().getFilename()) - .end() - .getRequestBody(), - requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessWithVerifySessionResult.class)); + public Mono> getLivenessWithVerifySessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionResultWithResponseAsync(sessionId, requestOptions); } /** @@ -1243,6 +567,156 @@ public Mono> getSessionImageWithResponse(String sessionImag return this.serviceClient.getSessionImageWithResponseAsync(sessionImageId, requestOptions); } + /** + * Delete all session related information for matching the specified session id. + * + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for + * more details. + * + * @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); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result + * for more details. + * + * @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 detect liveness 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)); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image + * for more details. + * + * @param options Request content 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 session result of detect liveness with verify on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono + createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent options) { + // Generated convenience method for createLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + MultipartFormDataHelper form = new MultipartFormDataHelper(requestOptions) + .serializeTextField("livenessOperationMode", Objects.toString(options.getLivenessOperationMode())); + // Handwritten start + if (options.isDeviceCorrelationIdSetInClient() != null) { + form.serializeTextField("deviceCorrelationIdSetInClient", + Objects.toString(options.isDeviceCorrelationIdSetInClient())); + } + if (options.isEnableSessionImage() != null) { + form.serializeTextField("enableSessionImage", Objects.toString(options.isEnableSessionImage())); + } + if (options.getLivenessModelVersion() != null) { + form.serializeTextField("livenessModelVersion", Objects.toString(options.getLivenessModelVersion())); + } + if (options.isReturnVerifyImageHash() != null) { + form.serializeTextField("returnVerifyImageHash", Objects.toString(options.isReturnVerifyImageHash())); + } + if (options.getVerifyConfidenceThreshold() != null) { + form.serializeTextField("verifyConfidenceThreshold", + Objects.toString(options.getVerifyConfidenceThreshold())); + } + if (options.getVerifyImage() != null && options.getVerifyImage().getContent() != null) { + form.serializeFileField("verifyImage", options.getVerifyImage().getContent(), + options.getVerifyImage().getContentType(), options.getVerifyImage().getFilename()); + } + if (options.getDeviceCorrelationId() != null) { + form.serializeTextField("deviceCorrelationId", options.getDeviceCorrelationId()); + } + if (options.getAuthTokenTimeToLiveInSeconds() != null) { + form.serializeTextField("authTokenTimeToLiveInSeconds", + Objects.toString(options.getAuthTokenTimeToLiveInSeconds())); + } + // Handwritten end + return createLivenessWithVerifySessionWithResponse(form.end().getRequestBody(), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LivenessWithVerifySession.class)); + } + + /** + * Delete all session related information for matching the specified session id. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. + * + * @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); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for + * more details. + * + * @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 detect liveness with verify 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)); + } + /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * @@ -1330,62 +804,27 @@ public Mono getSessionImage(String sessionImageId) { }; /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. + * Create a new detect liveness session. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for * more details. * - * @param body Body parameter. + * @param options Options parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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}. + * @return session result of detect liveness on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono - createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent body) { - // Generated convenience method for createLivenessWithVerifySessionWithResponse + public Mono createLivenessSession(CreateLivenessSessionOptions options) { + // Generated convenience method for createLivenessSessionWithResponse RequestOptions requestOptions = new RequestOptions(); - return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(body), requestOptions) + return createLivenessSessionWithResponse(BinaryData.fromObject(options), requestOptions) .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(CreateLivenessWithVerifySessionResult.class)); - } - - /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for - * more details. - * - * @param parameters Liveness with verify session parameter. - * @param verifyImage Verify image to be submitted during the 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent parameters, BinaryData verifyImage) { - if (verifyImage == null) { - return createLivenessWithVerifySession(parameters); - } - VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); - CreateLivenessWithVerifySessionMultipartContent realParameters - = new CreateLivenessWithVerifySessionMultipartContent(parameters, verifyImageFileDetails); - return this.createLivenessWithVerifySessionWithVerifyImage(realParameters); + .map(protocolMethodData -> protocolMethodData.toObject(LivenessSession.class)); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java index dceef3d438cd..61035be0abc8 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClient.java @@ -5,21 +5,15 @@ import com.azure.ai.vision.face.implementation.FaceSessionClientImpl; import com.azure.ai.vision.face.implementation.MultipartFormDataHelper; -import com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent; import com.azure.ai.vision.face.implementation.models.DetectFromSessionImageRequest; -import com.azure.ai.vision.face.implementation.models.VerifyImageFileDetails; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.DetectFromSessionImageOptions; import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceDetectionResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; 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; @@ -67,10 +61,9 @@ public final class FaceSessionClient { * {@code * { * livenessOperationMode: String(Passive/PassiveActive) (Required) - * sendResultsToClient: Boolean (Optional) * deviceCorrelationIdSetInClient: Boolean (Optional) * enableSessionImage: Boolean (Optional) - * livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional) + * livenessModelVersion: String(2024-11-15) (Optional) * deviceCorrelationId: String (Optional) * authTokenTimeToLiveInSeconds: Integer (Optional) * } @@ -84,111 +77,41 @@ public final class FaceSessionClient { * { * sessionId: String (Required) * authToken: String (Required) - * } - * } - * - * - * @param body Body 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 liveness session creation along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createLivenessSessionWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createLivenessSessionWithResponse(body, requestOptions); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for - * more details. - * - * @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); - } - - /** - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): {
+     *                                 top: int (Required)
+     *                                 left: int (Required)
+     *                                 width: int (Required)
+     *                                 height: int (Required)
+     *                             }
+     *                         }
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
      * 
* - * @param sessionId The unique ID to reference this session. + * @param options Options 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. @@ -198,247 +121,14 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLivenessSessionResultWithResponse(String sessionId, RequestOptions requestOptions) { - return this.serviceClient.getLivenessSessionResultWithResponse(sessionId, requestOptions); - } - - /** - * Lists sessions for /detectLiveness/SingleModal. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - *

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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for - * more details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     livenessOperationMode: String(Passive/PassiveActive) (Required)
-     *     sendResultsToClient: Boolean (Optional)
-     *     deviceCorrelationIdSetInClient: Boolean (Optional)
-     *     enableSessionImage: Boolean (Optional)
-     *     livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *     deviceCorrelationId: String (Optional)
-     *     authTokenTimeToLiveInSeconds: Integer (Optional)
-     *     returnVerifyImageHash: Boolean (Optional)
-     *     verifyConfidenceThreshold: Double (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 body Body 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 liveness session with verify creation with verify image provided along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - Response createLivenessWithVerifySessionWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createLivenessWithVerifySessionWithResponse(body, requestOptions); - } - - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. - *

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 body Request content 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 body, - RequestOptions requestOptions) { - // Operation 'createLivenessWithVerifySessionWithVerifyImage' is of content-type 'multipart/form-data'. Protocol - // API is not usable and hence not generated. - return this.serviceClient.createLivenessWithVerifySessionWithVerifyImageWithResponse(body, requestOptions); + public Response createLivenessSessionWithResponse(BinaryData options, RequestOptions requestOptions) { + return this.serviceClient.createLivenessSessionWithResponse(options, requestOptions); } /** * Delete all session related information for matching the specified session id. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for * more details. * * @param sessionId The unique ID to reference this session. @@ -451,593 +141,234 @@ Response createLivenessWithVerifySessionWithVerifyImageWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteLivenessWithVerifySessionWithResponse(String sessionId, RequestOptions requestOptions) { - return this.serviceClient.deleteLivenessWithVerifySessionWithResponse(sessionId, requestOptions); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for - * more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * }
-     * }
-     * 
- * - * @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 detect liveness with verify 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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. - *

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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for - * more details. - * - * @param body Body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the 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 body) { - // Generated convenience method for createLivenessSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createLivenessSessionWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(CreateLivenessSessionResult.class); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for - * more details. - * - * @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(); - } - - /** - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result - * for more details. - * - * @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 detect liveness. - */ - @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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - * - * @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. - * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - * - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the 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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - * - * @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 the response. - */ - @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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - * - * @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 the response. - */ - @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); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for - * more details. - * - * @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(); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for - * more details. - * - * @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 detect liveness with verify. - */ - @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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. - * - * @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); + public Response deleteLivenessSessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessSessionWithResponse(sessionId, requestOptions); } /** - * Lists sessions for /detectLivenessWithVerify/SingleModal. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result + * for more details. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): {
+     *                                 top: int (Required)
+     *                                 left: int (Required)
+     *                                 width: int (Required)
+     *                                 height: int (Required)
+     *                             }
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
* + * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return session result of detect liveness along with {@link 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); + public Response getLivenessSessionResultWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.getLivenessSessionResultWithResponse(sessionId, requestOptions); } /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image * for more details. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
* - * @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. + * @param body Request content 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return session result of detect liveness with verify along with {@link Response}. */ @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); + Response createLivenessWithVerifySessionWithResponse(BinaryData body, RequestOptions requestOptions) { + // Operation 'createLivenessWithVerifySession' is of content-type 'multipart/form-data'. Protocol API is not + // usable and hence not generated. + return this.serviceClient.createLivenessWithVerifySessionWithResponse(body, requestOptions); } /** + * Delete all session related information for matching the specified session id. + * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. * * @param sessionId The unique ID to reference this session. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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. + * @return the {@link Response}. */ @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); + public Response deleteLivenessWithVerifySessionWithResponse(String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteLivenessWithVerifySessionWithResponse(sessionId, requestOptions); } - @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>() { - }; - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for + * more details. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
* - * @param body Request content of liveness with verify session creation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. - * @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. + * @return session result of detect liveness with verify along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - CreateLivenessWithVerifySessionResult - createLivenessWithVerifySessionWithVerifyImage(CreateLivenessWithVerifySessionMultipartContent body) { - // Generated convenience method for createLivenessWithVerifySessionWithVerifyImageWithResponse - RequestOptions requestOptions = new RequestOptions(); - return createLivenessWithVerifySessionWithVerifyImageWithResponse( - new MultipartFormDataHelper(requestOptions).serializeJsonField("Parameters", body.getParameters()) - .serializeFileField("VerifyImage", body.getVerifyImage().getContent(), - body.getVerifyImage().getContentType(), body.getVerifyImage().getFilename()) - .end() - .getRequestBody(), - requestOptions).getValue().toObject(CreateLivenessWithVerifySessionResult.class); + public Response getLivenessWithVerifySessionResultWithResponse(String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.getLivenessWithVerifySessionResultWithResponse(sessionId, requestOptions); } /** @@ -1226,6 +557,150 @@ public Response getSessionImageWithResponse(String sessionImageId, R return this.serviceClient.getSessionImageWithResponse(sessionImageId, requestOptions); } + /** + * Delete all session related information for matching the specified session id. + * + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-session for + * more details. + * + * @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(); + } + + /** + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-result + * for more details. + * + * @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 detect liveness. + */ + @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); + } + + /** + * Create a new liveness session with verify. Provide the verify image during session creation. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image + * for more details. + * + * @param options Request content 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 session result of detect liveness with verify. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LivenessWithVerifySession createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent options) { + // Generated convenience method for createLivenessWithVerifySessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + MultipartFormDataHelper form = new MultipartFormDataHelper(requestOptions) + .serializeTextField("livenessOperationMode", Objects.toString(options.getLivenessOperationMode())); + if (options.isDeviceCorrelationIdSetInClient() != null) { + form.serializeTextField("deviceCorrelationIdSetInClient", + Objects.toString(options.isDeviceCorrelationIdSetInClient())); + } + if (options.isEnableSessionImage() != null) { + form.serializeTextField("enableSessionImage", Objects.toString(options.isEnableSessionImage())); + } + if (options.getLivenessModelVersion() != null) { + form.serializeTextField("livenessModelVersion", Objects.toString(options.getLivenessModelVersion())); + } + if (options.isReturnVerifyImageHash() != null) { + form.serializeTextField("returnVerifyImageHash", Objects.toString(options.isReturnVerifyImageHash())); + } + if (options.getVerifyConfidenceThreshold() != null) { + form.serializeTextField("verifyConfidenceThreshold", + Objects.toString(options.getVerifyConfidenceThreshold())); + } + if (options.getVerifyImage() != null && options.getVerifyImage().getContent() != null) { + form.serializeFileField("verifyImage", options.getVerifyImage().getContent(), + options.getVerifyImage().getContentType(), options.getVerifyImage().getFilename()); + } + if (options.getDeviceCorrelationId() != null) { + form.serializeTextField("deviceCorrelationId", options.getDeviceCorrelationId()); + } + if (options.getAuthTokenTimeToLiveInSeconds() != null) { + form.serializeTextField("authTokenTimeToLiveInSeconds", + Objects.toString(options.getAuthTokenTimeToLiveInSeconds())); + } + return createLivenessWithVerifySessionWithResponse(form.end().getRequestBody(), requestOptions).getValue() + .toObject(LivenessWithVerifySession.class); + } + + /** + * Delete all session related information for matching the specified session id. + * + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. + * + * @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(); + } + + /** + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for + * more details. + * + * @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 detect liveness with verify. + */ + @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); + } + /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * @@ -1312,58 +787,26 @@ public BinaryData getSessionImage(String sessionImageId) { }; /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. + * Create a new detect liveness session. * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-session for * more details. * - * @param body Body parameter. + * @param options Options parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the 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. + * @return session result of detect liveness. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - CreateLivenessWithVerifySessionResult createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent body) { - // Generated convenience method for createLivenessWithVerifySessionWithResponse + public LivenessSession createLivenessSession(CreateLivenessSessionOptions options) { + // Generated convenience method for createLivenessSessionWithResponse RequestOptions requestOptions = new RequestOptions(); - return createLivenessWithVerifySessionWithResponse(BinaryData.fromObject(body), requestOptions).getValue() - .toObject(CreateLivenessWithVerifySessionResult.class); - } - - /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for - * more details. - * - * @param parameters Liveness with verify session parameter. - * @param verifyImage Verify image to be submitted during the 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CreateLivenessWithVerifySessionResult - createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent parameters, BinaryData verifyImage) { - if (verifyImage == null) { - return createLivenessWithVerifySession(parameters); - } - VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); - CreateLivenessWithVerifySessionMultipartContent realParameters - = new CreateLivenessWithVerifySessionMultipartContent(parameters, verifyImageFileDetails); - return this.createLivenessWithVerifySessionWithVerifyImage(realParameters); + return createLivenessSessionWithResponse(BinaryData.fromObject(options), requestOptions).getValue() + .toObject(LivenessSession.class); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java index a828992e6e17..a44d8683486d 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/FaceSessionClientBuilder.java @@ -74,37 +74,37 @@ public FaceSessionClientBuilder() { } /* - * The HTTP pipeline to send requests through. + * The HTTP client used to send the request. */ @Generated - private HttpPipeline pipeline; + private HttpClient httpClient; /** * {@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; + public FaceSessionClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP client used to send the request. + * The HTTP pipeline to send requests through. */ @Generated - private HttpClient httpClient; + private HttpPipeline pipeline; /** * {@inheritDoc}. */ @Generated @Override - public FaceSessionClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + 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; } @@ -283,6 +283,13 @@ private FaceSessionClientImpl buildInnerClient() { return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -345,11 +352,4 @@ public FaceSessionClient buildClient() { } private static final ClientLogger LOGGER = new ClientLogger(FaceSessionClientBuilder.class); - - @Generated - private void validateClient() { - // This method is invoked from 'buildInnerClient'/'buildClient' method. - // Developer can customize this method, to validate that the necessary conditions are met for the new client. - Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationAsyncClient.java index 785f3f5b362b..7734e9d4ede3 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationAsyncClient.java @@ -1,60 +1,48 @@ // 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.administration; -import com.azure.ai.vision.face.FaceServiceVersion; import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.util.serializer.SerializerAdapter; - -import java.util.Objects; /** - * Initializes a new instance of the asynchronous FaceAdministrationAsyncClient type. + * Initializes a new instance of the asynchronous FaceAdministrationClient type. */ @ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) public final class FaceAdministrationAsyncClient { - private final HttpPipeline pipeline; - private final SerializerAdapter serializerAdapter; - private final String endpoint; - private final FaceServiceVersion serviceVersion; + @Generated + private final FaceAdministrationClientImpl serviceClient; - FaceAdministrationAsyncClient(HttpPipeline pipeline, SerializerAdapter serializerAdapter, String endpoint, - FaceServiceVersion serviceVersion) { - this.pipeline = pipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.serviceVersion = serviceVersion; + /** + * Initializes an instance of FaceAdministrationAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceAdministrationAsyncClient(FaceAdministrationClientImpl serviceClient) { + this.serviceClient = serviceClient; } /** - * Creates a new instance of LargeFaceListAsyncClient. + * Gets an instance of LargeFaceListAsyncClient class. * - * @param largeFaceListId the ID of LargeFaceList. - * @return a new instance of LargeFaceListAsyncClient. + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @return an instance of LargeFaceListAsyncClient class. */ public LargeFaceListAsyncClient getLargeFaceListAsyncClient(String largeFaceListId) { - Objects.requireNonNull(largeFaceListId, "'largeFaceListId' cannot be null."); - - FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(this.pipeline, this.serializerAdapter, - this.endpoint, largeFaceListId, null, serviceVersion); - return new LargeFaceListAsyncClient(client.getLargeFaceLists()); + return new LargeFaceListAsyncClient(serviceClient.getLargeFaceList(largeFaceListId)); } /** - * Creates a new instance of LargePersonGroupAsyncClient. + * Gets an instance of LargePersonGroupAsyncClient class. * - * @param largePersonGroupId the ID of LargePersonGroup. - * @return a new instance of LargePersonGroupAsyncClient. + * @param largePersonGroupId ID of the container. + * @return an instance of LargePersonGroupAsyncClient class. */ public LargePersonGroupAsyncClient getLargePersonGroupAsyncClient(String largePersonGroupId) { - Objects.requireNonNull(largePersonGroupId, "'largePersonGroupId' cannot be null."); - - FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(this.pipeline, this.serializerAdapter, - this.endpoint, null, largePersonGroupId, serviceVersion); - return new LargePersonGroupAsyncClient(client.getLargePersonGroups()); + return new LargePersonGroupAsyncClient(serviceClient.getLargePersonGroup(largePersonGroupId)); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClient.java index 6779b58eb3af..20b1503bd7f7 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClient.java @@ -1,15 +1,11 @@ // 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.administration; -import com.azure.ai.vision.face.FaceServiceVersion; import com.azure.ai.vision.face.implementation.FaceAdministrationClientImpl; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.util.serializer.SerializerAdapter; - -import java.util.Objects; /** * Initializes a new instance of the synchronous FaceAdministrationClient type. @@ -17,44 +13,36 @@ @ServiceClient(builder = FaceAdministrationClientBuilder.class) public final class FaceAdministrationClient { - private final HttpPipeline pipeline; - private final SerializerAdapter serializerAdapter; - private final String endpoint; - private final FaceServiceVersion serviceVersion; + @Generated + private final FaceAdministrationClientImpl serviceClient; - FaceAdministrationClient(HttpPipeline pipeline, SerializerAdapter serializerAdapter, String endpoint, - FaceServiceVersion serviceVersion) { - this.pipeline = pipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.serviceVersion = serviceVersion; + /** + * Initializes an instance of FaceAdministrationClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + FaceAdministrationClient(FaceAdministrationClientImpl serviceClient) { + this.serviceClient = serviceClient; } /** - * Creates a new instance of LargeFaceListClient. + * Gets an instance of LargeFaceListClient class. * - * @param largeFaceListId the ID of LargeFaceList. - * @return a new instance of LargeFaceListClient. + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @return an instance of LargeFaceListClient class. */ public LargeFaceListClient getLargeFaceListClient(String largeFaceListId) { - Objects.requireNonNull(largeFaceListId, "'largeFaceListId' cannot be null."); - - FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(this.pipeline, this.serializerAdapter, - this.endpoint, largeFaceListId, null, serviceVersion); - return new LargeFaceListClient(client.getLargeFaceLists()); + return new LargeFaceListClient(serviceClient.getLargeFaceList(largeFaceListId)); } /** - * Creates a new instance of LargePersonGroupClient. + * Gets an instance of LargePersonGroupClient class. * - * @param largePersonGroupId the ID of LargePersonGroup. - * @return a new instance of LargePersonGroupClient. + * @param largePersonGroupId ID of the container. + * @return an instance of LargePersonGroupClient class. */ public LargePersonGroupClient getLargePersonGroupClient(String largePersonGroupId) { - Objects.requireNonNull(largePersonGroupId, "'largePersonGroupId' cannot be null."); - - FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(this.pipeline, this.serializerAdapter, - this.endpoint, null, largePersonGroupId, serviceVersion); - return new LargePersonGroupClient(client.getLargePersonGroups()); + return new LargePersonGroupClient(serviceClient.getLargePersonGroup(largePersonGroupId)); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClientBuilder.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClientBuilder.java index 12db5144cdea..b92a884891c7 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClientBuilder.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/FaceAdministrationClientBuilder.java @@ -51,8 +51,8 @@ FaceAdministrationClient.class, FaceAdministrationAsyncClient.class, LargeFaceListClient.class, - LargePersonGroupClient.class, LargeFaceListAsyncClient.class, + LargePersonGroupClient.class, LargePersonGroupAsyncClient.class }) public final class FaceAdministrationClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, @@ -82,37 +82,37 @@ public FaceAdministrationClientBuilder() { } /* - * The HTTP pipeline to send requests through. + * The HTTP client used to send the request. */ @Generated - private HttpPipeline pipeline; + private HttpClient httpClient; /** * {@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; + public FaceAdministrationClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP client used to send the request. + * The HTTP pipeline to send requests through. */ @Generated - private HttpClient httpClient; + private HttpPipeline pipeline; /** * {@inheritDoc}. */ @Generated @Override - public FaceAdministrationClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + 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; } @@ -239,40 +239,6 @@ public FaceAdministrationClientBuilder endpoint(String endpoint) { return this; } - /* - * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - */ - @Generated - private String largeFaceListId; - - /** - * Sets Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - * - * @param largeFaceListId the largeFaceListId value. - * @return the FaceAdministrationClientBuilder. - */ - FaceAdministrationClientBuilder largeFaceListId(String largeFaceListId) { - this.largeFaceListId = largeFaceListId; - return this; - } - - /* - * ID of the container. - */ - @Generated - private String largePersonGroupId; - - /** - * Sets ID of the container. - * - * @param largePersonGroupId the largePersonGroupId value. - * @return the FaceAdministrationClientBuilder. - */ - FaceAdministrationClientBuilder largePersonGroupId(String largePersonGroupId) { - this.largePersonGroupId = largePersonGroupId; - return this; - } - /* * Service version */ @@ -320,18 +286,16 @@ 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, this.largeFaceListId, this.largePersonGroupId, localServiceVersion); + FaceAdministrationClientImpl client = new FaceAdministrationClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } + @Generated private void validateClient() { // This method is invoked from 'buildInnerClient'/'buildClient' method. // Developer can customize this method, to validate that the necessary conditions are met for the new client. Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); - // Objects.requireNonNull(largeFaceListId, "'largeFaceListId' cannot be null."); - // Objects.requireNonNull(largePersonGroupId, "'largePersonGroupId' cannot be null."); } @Generated @@ -376,39 +340,13 @@ private HttpPipeline createHttpPipeline() { } /** - * Builds an instance of LargeFaceListAsyncClient class. - * - * @return an instance of LargeFaceListAsyncClient. - */ - LargeFaceListAsyncClient buildLargeFaceListAsyncClient() { - return new LargeFaceListAsyncClient(buildInnerClient().getLargeFaceLists()); - } - - /** - * Builds an instance of LargePersonGroupAsyncClient class. - * - * @return an instance of LargePersonGroupAsyncClient. - */ - LargePersonGroupAsyncClient buildLargePersonGroupAsyncClient() { - return new LargePersonGroupAsyncClient(buildInnerClient().getLargePersonGroups()); - } - - /** - * Builds an instance of LargeFaceListClient class. - * - * @return an instance of LargeFaceListClient. - */ - LargeFaceListClient buildLargeFaceListClient() { - return new LargeFaceListClient(buildInnerClient().getLargeFaceLists()); - } - - /** - * Builds an instance of LargePersonGroupClient class. + * Builds an instance of FaceAdministrationAsyncClient class. * - * @return an instance of LargePersonGroupClient. + * @return an instance of FaceAdministrationAsyncClient. */ - LargePersonGroupClient buildLargePersonGroupClient() { - return new LargePersonGroupClient(buildInnerClient().getLargePersonGroups()); + @Generated + public FaceAdministrationAsyncClient buildAsyncClient() { + return new FaceAdministrationAsyncClient(buildInnerClient()); } /** @@ -416,27 +354,9 @@ LargePersonGroupClient buildLargePersonGroupClient() { * * @return an instance of FaceAdministrationClient. */ + @Generated public FaceAdministrationClient buildClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FaceServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); - return new FaceAdministrationClient(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); - } - - /** - * Builds an instance of FaceAdministrationAsyncClient class. - * - * @return an instance of FaceAdministrationAsyncClient. - */ - public FaceAdministrationAsyncClient buildAsyncClient() { - this.validateClient(); - HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - FaceServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : FaceServiceVersion.getLatest(); - return new FaceAdministrationAsyncClient(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, localServiceVersion); + return new FaceAdministrationClient(buildInnerClient()); } private static final ClientLogger LOGGER = new ClientLogger(FaceAdministrationClientBuilder.class); diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListAsyncClient.java index abecb39a0ac6..3f679b181368 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListAsyncClient.java @@ -3,11 +3,11 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.vision.face.administration; -import com.azure.ai.vision.face.implementation.LargeFaceListsImpl; -import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1; -import com.azure.ai.vision.face.implementation.models.CreateRequest1; -import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1; -import com.azure.ai.vision.face.implementation.models.UpdateRequest1; +import com.azure.ai.vision.face.implementation.LargeFaceListImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest2; +import com.azure.ai.vision.face.implementation.models.CreateRequest; +import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest; import com.azure.ai.vision.face.models.AddFaceResult; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceRecognitionModel; @@ -34,13 +34,13 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the asynchronous FaceAdministrationClient type. + * Initializes a new instance of the asynchronous LargeFaceList type. */ @ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) public final class LargeFaceListAsyncClient { @Generated - private final LargeFaceListsImpl serviceClient; + private final LargeFaceListImpl serviceClient; /** * Initializes an instance of LargeFaceListAsyncClient class. @@ -48,7 +48,7 @@ public final class LargeFaceListAsyncClient { * @param serviceClient the service client implementation. */ @Generated - LargeFaceListAsyncClient(LargeFaceListsImpl serviceClient) { + LargeFaceListAsyncClient(LargeFaceListImpl serviceClient) { this.serviceClient = serviceClient; } @@ -70,7 +70,7 @@ public final class LargeFaceListAsyncClient { * } * * - * @param createRequest1 The createRequest1 parameter. + * @param createRequest The createRequest 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. @@ -80,8 +80,8 @@ public final class LargeFaceListAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { - return this.serviceClient.createWithResponseAsync(createRequest1, requestOptions); + public Mono> createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(createRequest, requestOptions); } /** @@ -155,7 +155,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) * } * * - * @param updateRequest1 The updateRequest1 parameter. + * @param updateRequest The updateRequest 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. @@ -165,8 +165,8 @@ public Mono> getWithResponse(RequestOptions requestOptions) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponseAsync(updateRequest1, requestOptions); + public Mono> updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(updateRequest, requestOptions); } /** @@ -303,7 +303,7 @@ public PollerFlux beginTrain(RequestOptions requestOptio * } * * - * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 parameter. + * @param addFaceFromUrlRequest2 The addFaceFromUrlRequest2 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. @@ -313,9 +313,9 @@ public PollerFlux beginTrain(RequestOptions requestOptio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest1, + Mono> addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions) { - return this.serviceClient.addFaceFromUrlImplWithResponseAsync(addFaceFromUrlRequest1, requestOptions); + return this.serviceClient.addFaceFromUrlImplWithResponseAsync(addFaceFromUrlRequest2, requestOptions); } /** @@ -429,7 +429,7 @@ public Mono> getFaceWithResponse(String persistedFaceId, Re * * * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest1 The updateFaceRequest1 parameter. + * @param updateFaceRequest The updateFaceRequest 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. @@ -439,9 +439,9 @@ public Mono> getFaceWithResponse(String persistedFaceId, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest1, + public Mono> updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest, RequestOptions requestOptions) { - return this.serviceClient.updateFaceWithResponseAsync(persistedFaceId, updateFaceRequest1, requestOptions); + return this.serviceClient.updateFaceWithResponseAsync(persistedFaceId, updateFaceRequest, requestOptions); } /** @@ -511,10 +511,10 @@ public Mono> getFacesWithResponse(RequestOptions requestOpt public Mono create(String name, String userData, FaceRecognitionModel recognitionModel) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest1 createRequest1Obj - = new CreateRequest1(name).setUserData(userData).setRecognitionModel(recognitionModel); - BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); - return createWithResponse(createRequest1, requestOptions).flatMap(FluxUtil::toMono); + CreateRequest createRequestObj + = new CreateRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + return createWithResponse(createRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -538,9 +538,9 @@ public Mono create(String name, String userData, FaceRecognitionModel reco public Mono create(String name) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest1 createRequest1Obj = new CreateRequest1(name); - BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); - return createWithResponse(createRequest1, requestOptions).flatMap(FluxUtil::toMono); + CreateRequest createRequestObj = new CreateRequest(name); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + return createWithResponse(createRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -628,9 +628,9 @@ public Mono get() { public Mono update(String name, String userData) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest1 updateRequest1Obj = new UpdateRequest1().setName(name).setUserData(userData); - BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); - return updateWithResponse(updateRequest1, requestOptions).flatMap(FluxUtil::toMono); + UpdateRequest updateRequestObj = new UpdateRequest().setName(name).setUserData(userData); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + return updateWithResponse(updateRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -649,9 +649,9 @@ public Mono update(String name, String userData) { public Mono update() { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); - BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); - return updateWithResponse(updateRequest1, requestOptions).flatMap(FluxUtil::toMono); + UpdateRequest updateRequestObj = new UpdateRequest(); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + return updateWithResponse(updateRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -779,8 +779,8 @@ Mono addFaceFromUrlImpl(String url, List targetFace, Fac String userData) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); - BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + AddFaceFromUrlRequest2 addFaceFromUrlRequest2Obj = new AddFaceFromUrlRequest2(url); + BinaryData addFaceFromUrlRequest2 = BinaryData.fromObject(addFaceFromUrlRequest2Obj); if (targetFace != null) { requestOptions.addQueryParam("targetFace", JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), @@ -792,7 +792,7 @@ Mono addFaceFromUrlImpl(String url, List targetFace, Fac if (userData != null) { requestOptions.addQueryParam("userData", userData, false); } - return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest1, requestOptions).flatMap(FluxUtil::toMono) + return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest2, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); } @@ -816,9 +816,9 @@ Mono addFaceFromUrlImpl(String url, List targetFace, Fac Mono addFaceFromUrlImpl(String url) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); - BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); - return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest1, requestOptions).flatMap(FluxUtil::toMono) + AddFaceFromUrlRequest2 addFaceFromUrlRequest2Obj = new AddFaceFromUrlRequest2(url); + BinaryData addFaceFromUrlRequest2 = BinaryData.fromObject(addFaceFromUrlRequest2Obj); + return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest2, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); } @@ -1041,9 +1041,9 @@ public Mono getFace(String persistedFaceId) { public Mono updateFace(String persistedFaceId, String userData) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1().setUserData(userData); - BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); - return updateFaceWithResponse(persistedFaceId, updateFaceRequest1, requestOptions).flatMap(FluxUtil::toMono); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest().setUserData(userData); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + return updateFaceWithResponse(persistedFaceId, updateFaceRequest, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -1064,9 +1064,9 @@ public Mono updateFace(String persistedFaceId, String userData) { public Mono updateFace(String persistedFaceId) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); - BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); - return updateFaceWithResponse(persistedFaceId, updateFaceRequest1, requestOptions).flatMap(FluxUtil::toMono); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + return updateFaceWithResponse(persistedFaceId, updateFaceRequest, requestOptions).flatMap(FluxUtil::toMono); } /** diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListClient.java index 89cc2752c875..6910ec3d7e2e 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargeFaceListClient.java @@ -3,11 +3,11 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.vision.face.administration; -import com.azure.ai.vision.face.implementation.LargeFaceListsImpl; -import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1; -import com.azure.ai.vision.face.implementation.models.CreateRequest1; -import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1; -import com.azure.ai.vision.face.implementation.models.UpdateRequest1; +import com.azure.ai.vision.face.implementation.LargeFaceListImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest2; +import com.azure.ai.vision.face.implementation.models.CreateRequest; +import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest; import com.azure.ai.vision.face.models.AddFaceResult; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceRecognitionModel; @@ -32,13 +32,13 @@ import java.util.List; /** - * Initializes a new instance of the synchronous FaceAdministrationClient type. + * Initializes a new instance of the synchronous LargeFaceList type. */ @ServiceClient(builder = FaceAdministrationClientBuilder.class) public final class LargeFaceListClient { @Generated - private final LargeFaceListsImpl serviceClient; + private final LargeFaceListImpl serviceClient; /** * Initializes an instance of LargeFaceListClient class. @@ -46,7 +46,7 @@ public final class LargeFaceListClient { * @param serviceClient the service client implementation. */ @Generated - LargeFaceListClient(LargeFaceListsImpl serviceClient) { + LargeFaceListClient(LargeFaceListImpl serviceClient) { this.serviceClient = serviceClient; } @@ -68,7 +68,7 @@ public final class LargeFaceListClient { * } * * - * @param createRequest1 The createRequest1 parameter. + * @param createRequest The createRequest 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. @@ -78,8 +78,8 @@ public final class LargeFaceListClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { - return this.serviceClient.createWithResponse(createRequest1, requestOptions); + public Response createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { + return this.serviceClient.createWithResponse(createRequest, requestOptions); } /** @@ -152,7 +152,7 @@ public Response getWithResponse(RequestOptions requestOptions) { * } * * - * @param updateRequest1 The updateRequest1 parameter. + * @param updateRequest The updateRequest 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. @@ -162,8 +162,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponse(updateRequest1, requestOptions); + public Response updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(updateRequest, requestOptions); } /** @@ -300,7 +300,7 @@ public SyncPoller beginTrain(RequestOptions requestOptio * } * * - * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 parameter. + * @param addFaceFromUrlRequest2 The addFaceFromUrlRequest2 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. @@ -310,9 +310,9 @@ public SyncPoller beginTrain(RequestOptions requestOptio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest1, + Response addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions) { - return this.serviceClient.addFaceFromUrlImplWithResponse(addFaceFromUrlRequest1, requestOptions); + return this.serviceClient.addFaceFromUrlImplWithResponse(addFaceFromUrlRequest2, requestOptions); } /** @@ -426,7 +426,7 @@ public Response getFaceWithResponse(String persistedFaceId, RequestO * * * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest1 The updateFaceRequest1 parameter. + * @param updateFaceRequest The updateFaceRequest 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. @@ -436,9 +436,9 @@ public Response getFaceWithResponse(String persistedFaceId, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest1, + public Response updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest, RequestOptions requestOptions) { - return this.serviceClient.updateFaceWithResponse(persistedFaceId, updateFaceRequest1, requestOptions); + return this.serviceClient.updateFaceWithResponse(persistedFaceId, updateFaceRequest, requestOptions); } /** @@ -507,10 +507,10 @@ public Response getFacesWithResponse(RequestOptions requestOptions) public void create(String name, String userData, FaceRecognitionModel recognitionModel) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest1 createRequest1Obj - = new CreateRequest1(name).setUserData(userData).setRecognitionModel(recognitionModel); - BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); - createWithResponse(createRequest1, requestOptions).getValue(); + CreateRequest createRequestObj + = new CreateRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + createWithResponse(createRequest, requestOptions).getValue(); } /** @@ -533,9 +533,9 @@ public void create(String name, String userData, FaceRecognitionModel recognitio public void create(String name) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest1 createRequest1Obj = new CreateRequest1(name); - BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); - createWithResponse(createRequest1, requestOptions).getValue(); + CreateRequest createRequestObj = new CreateRequest(name); + BinaryData createRequest = BinaryData.fromObject(createRequestObj); + createWithResponse(createRequest, requestOptions).getValue(); } /** @@ -619,9 +619,9 @@ public LargeFaceList get() { public void update(String name, String userData) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest1 updateRequest1Obj = new UpdateRequest1().setName(name).setUserData(userData); - BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); - updateWithResponse(updateRequest1, requestOptions).getValue(); + UpdateRequest updateRequestObj = new UpdateRequest().setName(name).setUserData(userData); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + updateWithResponse(updateRequest, requestOptions).getValue(); } /** @@ -639,9 +639,9 @@ public void update(String name, String userData) { public void update() { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); - BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); - updateWithResponse(updateRequest1, requestOptions).getValue(); + UpdateRequest updateRequestObj = new UpdateRequest(); + BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); + updateWithResponse(updateRequest, requestOptions).getValue(); } /** @@ -858,8 +858,8 @@ AddFaceResult addFaceFromUrlImpl(String url, List targetFace, FaceDetec String userData) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); - BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + AddFaceFromUrlRequest2 addFaceFromUrlRequest2Obj = new AddFaceFromUrlRequest2(url); + BinaryData addFaceFromUrlRequest2 = BinaryData.fromObject(addFaceFromUrlRequest2Obj); if (targetFace != null) { requestOptions.addQueryParam("targetFace", JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), @@ -871,7 +871,7 @@ AddFaceResult addFaceFromUrlImpl(String url, List targetFace, FaceDetec if (userData != null) { requestOptions.addQueryParam("userData", userData, false); } - return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest1, requestOptions).getValue() + return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest2, requestOptions).getValue() .toObject(AddFaceResult.class); } @@ -895,9 +895,9 @@ AddFaceResult addFaceFromUrlImpl(String url, List targetFace, FaceDetec AddFaceResult addFaceFromUrlImpl(String url) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); - BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); - return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest1, requestOptions).getValue() + AddFaceFromUrlRequest2 addFaceFromUrlRequest2Obj = new AddFaceFromUrlRequest2(url); + BinaryData addFaceFromUrlRequest2 = BinaryData.fromObject(addFaceFromUrlRequest2Obj); + return addFaceFromUrlImplWithResponse(addFaceFromUrlRequest2, requestOptions).getValue() .toObject(AddFaceResult.class); } @@ -1023,9 +1023,9 @@ public LargeFaceListFace getFace(String persistedFaceId) { public void updateFace(String persistedFaceId, String userData) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1().setUserData(userData); - BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); - updateFaceWithResponse(persistedFaceId, updateFaceRequest1, requestOptions).getValue(); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest().setUserData(userData); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + updateFaceWithResponse(persistedFaceId, updateFaceRequest, requestOptions).getValue(); } /** @@ -1045,9 +1045,9 @@ public void updateFace(String persistedFaceId, String userData) { public void updateFace(String persistedFaceId) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); - BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); - updateFaceWithResponse(persistedFaceId, updateFaceRequest1, requestOptions).getValue(); + UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); + BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); + updateFaceWithResponse(persistedFaceId, updateFaceRequest, requestOptions).getValue(); } /** diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupAsyncClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupAsyncClient.java index 7acdd051e154..3213386488e7 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupAsyncClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupAsyncClient.java @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.vision.face.administration; -import com.azure.ai.vision.face.implementation.LargePersonGroupsImpl; -import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.LargePersonGroupImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1; import com.azure.ai.vision.face.implementation.models.CreatePersonRequest; -import com.azure.ai.vision.face.implementation.models.CreateRequest; -import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest; +import com.azure.ai.vision.face.implementation.models.CreateRequest1; +import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1; import com.azure.ai.vision.face.implementation.models.UpdatePersonRequest; -import com.azure.ai.vision.face.implementation.models.UpdateRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest1; import com.azure.ai.vision.face.models.AddFaceResult; import com.azure.ai.vision.face.models.CreatePersonResult; import com.azure.ai.vision.face.models.FaceDetectionModel; @@ -38,13 +38,13 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the asynchronous FaceAdministrationClient type. + * Initializes a new instance of the asynchronous LargePersonGroup type. */ @ServiceClient(builder = FaceAdministrationClientBuilder.class, isAsync = true) public final class LargePersonGroupAsyncClient { @Generated - private final LargePersonGroupsImpl serviceClient; + private final LargePersonGroupImpl serviceClient; /** * Initializes an instance of LargePersonGroupAsyncClient class. @@ -52,7 +52,7 @@ public final class LargePersonGroupAsyncClient { * @param serviceClient the service client implementation. */ @Generated - LargePersonGroupAsyncClient(LargePersonGroupsImpl serviceClient) { + LargePersonGroupAsyncClient(LargePersonGroupImpl serviceClient) { this.serviceClient = serviceClient; } @@ -74,7 +74,7 @@ public final class LargePersonGroupAsyncClient { * } * * - * @param createRequest The createRequest parameter. + * @param createRequest1 The createRequest1 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. @@ -84,8 +84,8 @@ public final class LargePersonGroupAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { - return this.serviceClient.createWithResponseAsync(createRequest, requestOptions); + public Mono> createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { + return this.serviceClient.createWithResponseAsync(createRequest1, requestOptions); } /** @@ -157,7 +157,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) * } * * - * @param updateRequest The updateRequest parameter. + * @param updateRequest1 The updateRequest1 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. @@ -167,8 +167,8 @@ public Mono> getWithResponse(RequestOptions requestOptions) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponseAsync(updateRequest, requestOptions); + public Mono> updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponseAsync(updateRequest1, requestOptions); } /** @@ -483,7 +483,7 @@ public Mono> getPersonsWithResponse(RequestOptions requestO * * * @param personId ID of the person. - * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 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. @@ -493,9 +493,9 @@ public Mono> getPersonsWithResponse(RequestOptions requestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest, + Mono> addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions) { - return this.serviceClient.addFaceFromUrlImplWithResponseAsync(personId, addFaceFromUrlRequest, requestOptions); + return this.serviceClient.addFaceFromUrlImplWithResponseAsync(personId, addFaceFromUrlRequest1, requestOptions); } /** @@ -624,7 +624,7 @@ public Mono> getFaceWithResponse(String personId, String pe * * @param personId ID of the person. * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest The updateFaceRequest parameter. + * @param updateFaceRequest1 The updateFaceRequest1 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. @@ -635,8 +635,8 @@ public Mono> getFaceWithResponse(String personId, String pe @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateFaceWithResponse(String personId, String persistedFaceId, - BinaryData updateFaceRequest, RequestOptions requestOptions) { - return this.serviceClient.updateFaceWithResponseAsync(personId, persistedFaceId, updateFaceRequest, + BinaryData updateFaceRequest1, RequestOptions requestOptions) { + return this.serviceClient.updateFaceWithResponseAsync(personId, persistedFaceId, updateFaceRequest1, requestOptions); } @@ -666,10 +666,10 @@ public Mono> updateFaceWithResponse(String personId, String persi public Mono create(String name, String userData, FaceRecognitionModel recognitionModel) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest createRequestObj - = new CreateRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); - BinaryData createRequest = BinaryData.fromObject(createRequestObj); - return createWithResponse(createRequest, requestOptions).flatMap(FluxUtil::toMono); + CreateRequest1 createRequest1Obj + = new CreateRequest1(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + return createWithResponse(createRequest1, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -693,9 +693,9 @@ public Mono create(String name, String userData, FaceRecognitionModel reco public Mono create(String name) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest createRequestObj = new CreateRequest(name); - BinaryData createRequest = BinaryData.fromObject(createRequestObj); - return createWithResponse(createRequest, requestOptions).flatMap(FluxUtil::toMono); + CreateRequest1 createRequest1Obj = new CreateRequest1(name); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + return createWithResponse(createRequest1, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -783,9 +783,9 @@ public Mono get() { public Mono update(String name, String userData) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest updateRequestObj = new UpdateRequest().setName(name).setUserData(userData); - BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); - return updateWithResponse(updateRequest, requestOptions).flatMap(FluxUtil::toMono); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1().setName(name).setUserData(userData); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + return updateWithResponse(updateRequest1, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -804,9 +804,9 @@ public Mono update(String name, String userData) { public Mono update() { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest updateRequestObj = new UpdateRequest(); - BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); - return updateWithResponse(updateRequest, requestOptions).flatMap(FluxUtil::toMono); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + return updateWithResponse(updateRequest1, requestOptions).flatMap(FluxUtil::toMono); } /** @@ -1247,8 +1247,8 @@ Mono addFaceFromUrlImpl(String personId, String url, List addFaceFromUrlImpl(String personId, String url, List protocolMethodData.toObject(AddFaceResult.class)); } @@ -1286,9 +1287,10 @@ Mono addFaceFromUrlImpl(String personId, String url, List addFaceFromUrlImpl(String personId, String url) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest addFaceFromUrlRequestObj = new AddFaceFromUrlRequest(url); - BinaryData addFaceFromUrlRequest = BinaryData.fromObject(addFaceFromUrlRequestObj); - return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest, requestOptions).flatMap(FluxUtil::toMono) + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest1, requestOptions) + .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AddFaceResult.class)); } @@ -1432,9 +1434,9 @@ public Mono getFace(String personId, String persiste public Mono updateFace(String personId, String persistedFaceId, String userData) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest().setUserData(userData); - BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); - return updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest, requestOptions) + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1().setUserData(userData); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + return updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest1, requestOptions) .flatMap(FluxUtil::toMono); } @@ -1458,9 +1460,9 @@ public Mono updateFace(String personId, String persistedFaceId, String use public Mono updateFace(String personId, String persistedFaceId) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); - BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); - return updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest, requestOptions) + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + return updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest1, requestOptions) .flatMap(FluxUtil::toMono); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupClient.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupClient.java index f02eed463e50..ae1347e37762 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupClient.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/LargePersonGroupClient.java @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.vision.face.administration; -import com.azure.ai.vision.face.implementation.LargePersonGroupsImpl; -import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest; +import com.azure.ai.vision.face.implementation.LargePersonGroupImpl; +import com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1; import com.azure.ai.vision.face.implementation.models.CreatePersonRequest; -import com.azure.ai.vision.face.implementation.models.CreateRequest; -import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest; +import com.azure.ai.vision.face.implementation.models.CreateRequest1; +import com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1; import com.azure.ai.vision.face.implementation.models.UpdatePersonRequest; -import com.azure.ai.vision.face.implementation.models.UpdateRequest; +import com.azure.ai.vision.face.implementation.models.UpdateRequest1; import com.azure.ai.vision.face.models.AddFaceResult; import com.azure.ai.vision.face.models.CreatePersonResult; import com.azure.ai.vision.face.models.FaceDetectionModel; @@ -36,13 +36,13 @@ import java.util.List; /** - * Initializes a new instance of the synchronous FaceAdministrationClient type. + * Initializes a new instance of the synchronous LargePersonGroup type. */ @ServiceClient(builder = FaceAdministrationClientBuilder.class) public final class LargePersonGroupClient { @Generated - private final LargePersonGroupsImpl serviceClient; + private final LargePersonGroupImpl serviceClient; /** * Initializes an instance of LargePersonGroupClient class. @@ -50,7 +50,7 @@ public final class LargePersonGroupClient { * @param serviceClient the service client implementation. */ @Generated - LargePersonGroupClient(LargePersonGroupsImpl serviceClient) { + LargePersonGroupClient(LargePersonGroupImpl serviceClient) { this.serviceClient = serviceClient; } @@ -72,7 +72,7 @@ public final class LargePersonGroupClient { * } * * - * @param createRequest The createRequest parameter. + * @param createRequest1 The createRequest1 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. @@ -82,8 +82,8 @@ public final class LargePersonGroupClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { - return this.serviceClient.createWithResponse(createRequest, requestOptions); + public Response createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { + return this.serviceClient.createWithResponse(createRequest1, requestOptions); } /** @@ -155,7 +155,7 @@ public Response getWithResponse(RequestOptions requestOptions) { * } * * - * @param updateRequest The updateRequest parameter. + * @param updateRequest1 The updateRequest1 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. @@ -165,8 +165,8 @@ public Response getWithResponse(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { - return this.serviceClient.updateWithResponse(updateRequest, requestOptions); + public Response updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { + return this.serviceClient.updateWithResponse(updateRequest1, requestOptions); } /** @@ -480,7 +480,7 @@ public Response getPersonsWithResponse(RequestOptions requestOptions * * * @param personId ID of the person. - * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 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. @@ -490,9 +490,9 @@ public Response getPersonsWithResponse(RequestOptions requestOptions */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest, + Response addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions) { - return this.serviceClient.addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest, requestOptions); + return this.serviceClient.addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest1, requestOptions); } /** @@ -620,7 +620,7 @@ public Response getFaceWithResponse(String personId, String persiste * * @param personId ID of the person. * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest The updateFaceRequest parameter. + * @param updateFaceRequest1 The updateFaceRequest1 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. @@ -630,9 +630,9 @@ public Response getFaceWithResponse(String personId, String persiste */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateFaceWithResponse(String personId, String persistedFaceId, BinaryData updateFaceRequest, + public Response updateFaceWithResponse(String personId, String persistedFaceId, BinaryData updateFaceRequest1, RequestOptions requestOptions) { - return this.serviceClient.updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest, requestOptions); + return this.serviceClient.updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest1, requestOptions); } /** @@ -660,10 +660,10 @@ public Response updateFaceWithResponse(String personId, String persistedFa public void create(String name, String userData, FaceRecognitionModel recognitionModel) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest createRequestObj - = new CreateRequest(name).setUserData(userData).setRecognitionModel(recognitionModel); - BinaryData createRequest = BinaryData.fromObject(createRequestObj); - createWithResponse(createRequest, requestOptions).getValue(); + CreateRequest1 createRequest1Obj + = new CreateRequest1(name).setUserData(userData).setRecognitionModel(recognitionModel); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + createWithResponse(createRequest1, requestOptions).getValue(); } /** @@ -686,9 +686,9 @@ public void create(String name, String userData, FaceRecognitionModel recognitio public void create(String name) { // Generated convenience method for createWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateRequest createRequestObj = new CreateRequest(name); - BinaryData createRequest = BinaryData.fromObject(createRequestObj); - createWithResponse(createRequest, requestOptions).getValue(); + CreateRequest1 createRequest1Obj = new CreateRequest1(name); + BinaryData createRequest1 = BinaryData.fromObject(createRequest1Obj); + createWithResponse(createRequest1, requestOptions).getValue(); } /** @@ -772,9 +772,9 @@ public LargePersonGroup get() { public void update(String name, String userData) { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest updateRequestObj = new UpdateRequest().setName(name).setUserData(userData); - BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); - updateWithResponse(updateRequest, requestOptions).getValue(); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1().setName(name).setUserData(userData); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + updateWithResponse(updateRequest1, requestOptions).getValue(); } /** @@ -792,9 +792,9 @@ public void update(String name, String userData) { public void update() { // Generated convenience method for updateWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateRequest updateRequestObj = new UpdateRequest(); - BinaryData updateRequest = BinaryData.fromObject(updateRequestObj); - updateWithResponse(updateRequest, requestOptions).getValue(); + UpdateRequest1 updateRequest1Obj = new UpdateRequest1(); + BinaryData updateRequest1 = BinaryData.fromObject(updateRequest1Obj); + updateWithResponse(updateRequest1, requestOptions).getValue(); } /** @@ -1229,8 +1229,8 @@ AddFaceResult addFaceFromUrlImpl(String personId, String url, List targ FaceDetectionModel detectionModel, String userData) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest addFaceFromUrlRequestObj = new AddFaceFromUrlRequest(url); - BinaryData addFaceFromUrlRequest = BinaryData.fromObject(addFaceFromUrlRequestObj); + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); if (targetFace != null) { requestOptions.addQueryParam("targetFace", JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(targetFace, CollectionFormat.CSV), @@ -1242,7 +1242,7 @@ AddFaceResult addFaceFromUrlImpl(String personId, String url, List targ if (userData != null) { requestOptions.addQueryParam("userData", userData, false); } - return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest, requestOptions).getValue() + return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest1, requestOptions).getValue() .toObject(AddFaceResult.class); } @@ -1268,9 +1268,9 @@ AddFaceResult addFaceFromUrlImpl(String personId, String url, List targ AddFaceResult addFaceFromUrlImpl(String personId, String url) { // Generated convenience method for addFaceFromUrlImplWithResponse RequestOptions requestOptions = new RequestOptions(); - AddFaceFromUrlRequest addFaceFromUrlRequestObj = new AddFaceFromUrlRequest(url); - BinaryData addFaceFromUrlRequest = BinaryData.fromObject(addFaceFromUrlRequestObj); - return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest, requestOptions).getValue() + AddFaceFromUrlRequest1 addFaceFromUrlRequest1Obj = new AddFaceFromUrlRequest1(url); + BinaryData addFaceFromUrlRequest1 = BinaryData.fromObject(addFaceFromUrlRequest1Obj); + return addFaceFromUrlImplWithResponse(personId, addFaceFromUrlRequest1, requestOptions).getValue() .toObject(AddFaceResult.class); } @@ -1410,9 +1410,9 @@ public LargePersonGroupPersonFace getFace(String personId, String persistedFaceI public void updateFace(String personId, String persistedFaceId, String userData) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest().setUserData(userData); - BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); - updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest, requestOptions).getValue(); + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1().setUserData(userData); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest1, requestOptions).getValue(); } /** @@ -1434,9 +1434,9 @@ public void updateFace(String personId, String persistedFaceId, String userData) public void updateFace(String personId, String persistedFaceId) { // Generated convenience method for updateFaceWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateFaceRequest updateFaceRequestObj = new UpdateFaceRequest(); - BinaryData updateFaceRequest = BinaryData.fromObject(updateFaceRequestObj); - updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest, requestOptions).getValue(); + UpdateFaceRequest1 updateFaceRequest1Obj = new UpdateFaceRequest1(); + BinaryData updateFaceRequest1 = BinaryData.fromObject(updateFaceRequest1Obj); + updateFaceWithResponse(personId, persistedFaceId, updateFaceRequest1, requestOptions).getValue(); } @Generated diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/package-info.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/package-info.java index 13e0efce74c9..11224269663f 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/package-info.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/administration/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. /** * - * Package containing the classes for FaceAdministrationClient. + * Package containing the classes for LargeFaceList. * */ package com.azure.ai.vision.face.administration; diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/ClientUtils.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/ClientUtils.java old mode 100755 new mode 100644 index 329ff0b15533..f3dcf266b9b9 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/ClientUtils.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/ClientUtils.java @@ -3,15 +3,15 @@ package com.azure.ai.vision.face.implementation; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceRecognitionModel; import com.azure.core.http.rest.RequestOptions; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - public final class ClientUtils { public static void addRequiredQueryParameterForDetection(RequestOptions requestOptions, FaceDetectionModel detectionModel, FaceRecognitionModel recognitionModel, boolean returnFaceId) { diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java index 195a761e1454..81693b2ae8ce 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceAdministrationClientImpl.java @@ -11,6 +11,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +import java.util.Objects; /** * Initializes a new instance of the FaceAdministrationClient type. @@ -32,34 +33,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - */ - private final String largeFaceListId; - - /** - * Gets Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - * - * @return the largeFaceListId value. - */ - public String getLargeFaceListId() { - return this.largeFaceListId; - } - - /** - * ID of the container. - */ - private final String largePersonGroupId; - - /** - * Gets ID of the container. - * - * @return the largePersonGroupId value. - */ - public String getLargePersonGroupId() { - return this.largePersonGroupId; - } - /** * Service version. */ @@ -102,48 +75,16 @@ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** - * The LargeFaceListsImpl object to access its operations. - */ - private final LargeFaceListsImpl largeFaceLists; - - /** - * Gets the LargeFaceListsImpl object to access its operations. - * - * @return the LargeFaceListsImpl object. - */ - public LargeFaceListsImpl getLargeFaceLists() { - return this.largeFaceLists; - } - - /** - * The LargePersonGroupsImpl object to access its operations. - */ - private final LargePersonGroupsImpl largePersonGroups; - - /** - * Gets the LargePersonGroupsImpl object to access its operations. - * - * @return the LargePersonGroupsImpl object. - */ - public LargePersonGroupsImpl getLargePersonGroups() { - return this.largePersonGroups; - } - /** * Initializes an instance of FaceAdministrationClient client. * * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: * https://{resource-name}.cognitiveservices.azure.com). - * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - * @param largePersonGroupId ID of the container. * @param serviceVersion Service version. */ - public FaceAdministrationClientImpl(String endpoint, String largeFaceListId, String largePersonGroupId, - FaceServiceVersion serviceVersion) { + public FaceAdministrationClientImpl(String endpoint, FaceServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largeFaceListId, largePersonGroupId, - serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -152,14 +93,10 @@ public FaceAdministrationClientImpl(String endpoint, String largeFaceListId, Str * @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 largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - * @param largePersonGroupId ID of the container. * @param serviceVersion Service version. */ - public FaceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, String largeFaceListId, - String largePersonGroupId, FaceServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largeFaceListId, - largePersonGroupId, serviceVersion); + public FaceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -169,19 +106,35 @@ public FaceAdministrationClientImpl(HttpPipeline httpPipeline, String endpoint, * @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 largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. - * @param largePersonGroupId ID of the container. * @param serviceVersion Service version. */ public FaceAdministrationClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String largeFaceListId, String largePersonGroupId, FaceServiceVersion serviceVersion) { + FaceServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.largeFaceListId = largeFaceListId; - this.largePersonGroupId = largePersonGroupId; this.serviceVersion = serviceVersion; - this.largeFaceLists = new LargeFaceListsImpl(this); - this.largePersonGroups = new LargePersonGroupsImpl(this); + } + + /** + * Gets an instance of LargeFaceListImpl class. + * + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @return an instance of LargeFaceListImpl class. + */ + public LargeFaceListImpl getLargeFaceList(String largeFaceListId) { + Objects.requireNonNull(largeFaceListId, "'largeFaceListId' cannot be null."); + return new LargeFaceListImpl(httpPipeline, serializerAdapter, endpoint, largeFaceListId, serviceVersion); + } + + /** + * Gets an instance of LargePersonGroupImpl class. + * + * @param largePersonGroupId ID of the container. + * @return an instance of LargePersonGroupImpl class. + */ + public LargePersonGroupImpl getLargePersonGroup(String largePersonGroupId) { + Objects.requireNonNull(largePersonGroupId, "'largePersonGroupId' cannot be null."); + return new LargePersonGroupImpl(httpPipeline, serializerAdapter, endpoint, largePersonGroupId, serviceVersion); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java index 0f60b72bfc6c..90a64421507e 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/FaceSessionClientImpl.java @@ -152,7 +152,7 @@ public FaceSessionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serial @Host("{endpoint}/face/{apiVersion}") @ServiceInterface(name = "FaceSessionClient") public interface FaceSessionClientService { - @Post("/detectLiveness/singleModal/sessions") + @Post("/detectLiveness-sessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -160,10 +160,10 @@ public interface FaceSessionClientService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createLivenessSession(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); - @Post("/detectLiveness/singleModal/sessions") + @Post("/detectLiveness-sessions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -171,11 +171,11 @@ Mono> createLivenessSession(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(HttpResponseException.class) Response createLivenessSessionSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); - @Delete("/detectLiveness/singleModal/sessions/{sessionId}") - @ExpectedResponses({ 200 }) + @Delete("/detectLiveness-sessions/{sessionId}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @@ -184,8 +184,8 @@ Mono> deleteLivenessSession(@HostParam("endpoint") String endpoin @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/detectLiveness/singleModal/sessions/{sessionId}") - @ExpectedResponses({ 200 }) + @Delete("/detectLiveness-sessions/{sessionId}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @@ -194,7 +194,7 @@ 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}") + @Get("/detectLiveness-sessions/{sessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -204,7 +204,7 @@ Mono> getLivenessSessionResult(@HostParam("endpoint") Strin @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/detectLiveness/singleModal/sessions/{sessionId}") + @Get("/detectLiveness-sessions/{sessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -214,94 +214,32 @@ Response getLivenessSessionResultSync(@HostParam("endpoint") String @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") + // @Multipart not supported by RestProxy + @Post("/detectLivenessWithVerify-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("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, - 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("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, 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 body, RequestOptions requestOptions, Context context); - - // @Multipart not supported by RestProxy - @Post("/detectLivenessWithVerify/singleModal/sessions") + @Post("/detectLivenessWithVerify-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, + Response createLivenessWithVerifySessionSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, RequestOptions requestOptions, Context context); - @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") - @ExpectedResponses({ 200 }) + @Delete("/detectLivenessWithVerify-sessions/{sessionId}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @@ -310,8 +248,8 @@ Mono> deleteLivenessWithVerifySession(@HostParam("endpoint") Stri @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") - @ExpectedResponses({ 200 }) + @Delete("/detectLivenessWithVerify-sessions/{sessionId}") + @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @@ -320,7 +258,7 @@ Response deleteLivenessWithVerifySessionSync(@HostParam("endpoint") String @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @Get("/detectLivenessWithVerify-sessions/{sessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -330,7 +268,7 @@ Mono> getLivenessWithVerifySessionResult(@HostParam("endpoi @HostParam("apiVersion") String apiVersion, @PathParam("sessionId") String sessionId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/detectLivenessWithVerify/singleModal/sessions/{sessionId}") + @Get("/detectLivenessWithVerify-sessions/{sessionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -340,46 +278,6 @@ Response getLivenessWithVerifySessionResultSync(@HostParam("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); - @Post("/detect") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -404,7 +302,7 @@ Response detectFromSessionImageSync(@HostParam("endpoint") String en @BodyParam("application/json") BinaryData detectFromSessionImageRequest, RequestOptions requestOptions, Context context); - @Get("/session/sessionImages/{sessionImageId}") + @Get("/sessionImages/{sessionImageId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -414,7 +312,7 @@ Mono> getSessionImage(@HostParam("endpoint") String endpoin @HostParam("apiVersion") String apiVersion, @PathParam("sessionImageId") String sessionImageId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/session/sessionImages/{sessionImageId}") + @Get("/sessionImages/{sessionImageId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @@ -436,10 +334,9 @@ Response getSessionImageSync(@HostParam("endpoint") String endpoint, * {@code * { * livenessOperationMode: String(Passive/PassiveActive) (Required) - * sendResultsToClient: Boolean (Optional) * deviceCorrelationIdSetInClient: Boolean (Optional) * enableSessionImage: Boolean (Optional) - * livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional) + * livenessModelVersion: String(2024-11-15) (Optional) * deviceCorrelationId: String (Optional) * authTokenTimeToLiveInSeconds: Integer (Optional) * } @@ -453,26 +350,55 @@ Response getSessionImageSync(@HostParam("endpoint") String endpoint, * { * sessionId: String (Required) * authToken: String (Required) + * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * modelVersion: String(2024-11-15) (Optional) + * results (Required): { + * attempts (Required): [ + * (Required){ + * attemptId: int (Required) + * attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * result (Optional): { + * livenessDecision: String(uncertain/realface/spoofface) (Optional) + * targets (Required): { + * color (Required): { + * faceRectangle (Required): { + * top: int (Required) + * left: int (Required) + * width: int (Required) + * height: int (Required) + * } + * } + * } + * digest: String (Required) + * sessionImageId: String (Optional) + * } + * error (Optional): { + * code: String (Required) + * message: String (Required) + * targets (Required): (recursive schema, see targets above) + * } + * } + * ] + * } * } * } * * - * @param body Body parameter. + * @param options Options 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 liveness session creation along with {@link Response} on successful completion of - * {@link Mono}. + * @return session result of detect liveness along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createLivenessSessionWithResponseAsync(BinaryData body, + public Mono> createLivenessSessionWithResponseAsync(BinaryData options, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createLivenessSession(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); + this.getServiceVersion().getVersion(), contentType, accept, options, requestOptions, context)); } /** @@ -486,10 +412,9 @@ public Mono> createLivenessSessionWithResponseAsync(BinaryD * {@code * { * livenessOperationMode: String(Passive/PassiveActive) (Required) - * sendResultsToClient: Boolean (Optional) * deviceCorrelationIdSetInClient: Boolean (Optional) * enableSessionImage: Boolean (Optional) - * livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional) + * livenessModelVersion: String(2024-11-15) (Optional) * deviceCorrelationId: String (Optional) * authTokenTimeToLiveInSeconds: Integer (Optional) * } @@ -503,24 +428,54 @@ public Mono> createLivenessSessionWithResponseAsync(BinaryD * { * sessionId: String (Required) * authToken: String (Required) + * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * modelVersion: String(2024-11-15) (Optional) + * results (Required): { + * attempts (Required): [ + * (Required){ + * attemptId: int (Required) + * attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required) + * result (Optional): { + * livenessDecision: String(uncertain/realface/spoofface) (Optional) + * targets (Required): { + * color (Required): { + * faceRectangle (Required): { + * top: int (Required) + * left: int (Required) + * width: int (Required) + * height: int (Required) + * } + * } + * } + * digest: String (Required) + * sessionImageId: String (Optional) + * } + * error (Optional): { + * code: String (Required) + * message: String (Required) + * targets (Required): (recursive schema, see targets above) + * } + * } + * ] + * } * } * } * * - * @param body Body parameter. + * @param options Options 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 liveness session creation along with {@link Response}. + * @return session result of detect liveness along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createLivenessSessionWithResponse(BinaryData body, RequestOptions requestOptions) { + public Response createLivenessSessionWithResponse(BinaryData options, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; return service.createLivenessSessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, - accept, body, requestOptions, Context.NONE); + accept, options, requestOptions, Context.NONE); } /** @@ -574,59 +529,37 @@ public Response deleteLivenessSessionWithResponse(String sessionId, Reques *
      * {@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(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): {
+     *                                 top: int (Required)
+     *                                 left: int (Required)
+     *                                 width: int (Required)
+     *                                 height: int (Required)
+     *                             }
+     *                         }
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
@@ -656,59 +589,37 @@ public Mono> getLivenessSessionResultWithResponseAsync(Stri
      * 
      * {@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(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): {
+     *                                 top: int (Required)
+     *                                 left: int (Required)
+     *                                 width: int (Required)
+     *                                 height: int (Required)
+     *                             }
+     *                         }
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
@@ -730,166 +641,164 @@ public Response getLivenessSessionResultWithResponse(String sessionI
     }
 
     /**
-     * Lists sessions for /detectLiveness/SingleModal.
+     * Create a new liveness session with verify. Provide the verify image during session creation.
      * 
-     * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for
-     * more details.
-     * 

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} + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image + * for more details. *

Response Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         id: String (Required)
-     *         createdDateTime: OffsetDateTime (Required)
-     *         sessionStartDateTime: OffsetDateTime (Optional)
-     *         sessionExpired: boolean (Required)
-     *         deviceCorrelationId: String (Optional)
-     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
      *     }
-     * ]
+     * }
      * }
      * 
* + * @param body Request content 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 the response body along with {@link Response} on successful completion of {@link Mono}. + * @return session result of detect liveness with verify along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLivenessSessionsWithResponseAsync(RequestOptions requestOptions) { + public Mono> createLivenessWithVerifySessionWithResponseAsync(BinaryData body, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLivenessSessions(this.getEndpoint(), - this.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createLivenessWithVerifySession(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); } /** - * Lists sessions for /detectLiveness/SingleModal. + * Create a new liveness session with verify. Provide the verify image during session creation. * - * Please refer to https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-sessions for - * more details. - *

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} + * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image + * for more details. *

Response Body Schema

* *
      * {@code
-     * [
-     *      (Required){
-     *         id: String (Required)
-     *         createdDateTime: OffsetDateTime (Required)
-     *         sessionStartDateTime: OffsetDateTime (Optional)
-     *         sessionExpired: boolean (Required)
-     *         deviceCorrelationId: String (Optional)
-     *         authTokenTimeToLiveInSeconds: Integer (Optional)
+     * {
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
+     *                 }
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
+     *                     }
+     *                     verifyImageHash: String (Optional)
+     *                 }
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
+     *                 }
+     *             }
+     *         ]
      *     }
-     * ]
+     * }
      * }
      * 
* + * @param body Request content 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 the response body along with {@link Response}. + * @return session result of detect liveness with verify along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLivenessSessionsWithResponse(RequestOptions requestOptions) { + public Response createLivenessWithVerifySessionWithResponse(BinaryData body, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return service.getLivenessSessionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, - requestOptions, Context.NONE); + return service.createLivenessWithVerifySessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + contentType, accept, body, requestOptions, Context.NONE); } /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - *

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

+ * Delete all session related information for matching the specified session id. * - *
-     * {@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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
+ * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. * * @param sessionId The unique ID to reference this session. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -897,85 +806,22 @@ public Response getLivenessSessionsWithResponse(RequestOptions reque * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLivenessSessionAuditEntriesWithResponseAsync(String sessionId, + public Mono> deleteLivenessWithVerifySessionWithResponseAsync(String sessionId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLivenessSessionAuditEntries(this.getEndpoint(), + return FluxUtil.withContext(context -> service.deleteLivenessWithVerifySession(this.getEndpoint(), this.getServiceVersion().getVersion(), sessionId, accept, requestOptions, context)); } /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-session-audit-entries for more - * details. - *

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

+ * Delete all session related information for matching the specified session id. * - *
-     * {@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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
+ * Please refer to + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for + * more details. * * @param sessionId The unique ID to reference this session. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -983,336 +829,67 @@ public Mono> getLivenessSessionAuditEntriesWithResponseAsyn * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request 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}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLivenessSessionAuditEntriesWithResponse(String sessionId, - RequestOptions requestOptions) { + public Response deleteLivenessWithVerifySessionWithResponse(String sessionId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLivenessSessionAuditEntriesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + return service.deleteLivenessWithVerifySessionSync(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. - * * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for + * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for * more details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     livenessOperationMode: String(Passive/PassiveActive) (Required)
-     *     sendResultsToClient: Boolean (Optional)
-     *     deviceCorrelationIdSetInClient: Boolean (Optional)
-     *     enableSessionImage: Boolean (Optional)
-     *     livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *     deviceCorrelationId: String (Optional)
-     *     authTokenTimeToLiveInSeconds: Integer (Optional)
-     *     returnVerifyImageHash: Boolean (Optional)
-     *     verifyConfidenceThreshold: Double (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 body Body 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 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 body, - RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createLivenessWithVerifySession(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); - } - - /** - * Create a new liveness session with verify. Client device submits VerifyImage during the - * /detectLivenessWithVerify/singleModal call. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session for - * more details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     livenessOperationMode: String(Passive/PassiveActive) (Required)
-     *     sendResultsToClient: Boolean (Optional)
-     *     deviceCorrelationIdSetInClient: Boolean (Optional)
-     *     enableSessionImage: Boolean (Optional)
-     *     livenessSingleModalModel: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *     deviceCorrelationId: String (Optional)
-     *     authTokenTimeToLiveInSeconds: Integer (Optional)
-     *     returnVerifyImageHash: Boolean (Optional)
-     *     verifyConfidenceThreshold: Double (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 body Body 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 liveness session with verify creation with verify image provided along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createLivenessWithVerifySessionWithResponse(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createLivenessWithVerifySessionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - contentType, accept, body, requestOptions, Context.NONE); - } - - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. - *

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 body Request content 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 body, - 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, body, requestOptions, context)); - } - - /** - * Create a new liveness session with verify. Provide the verify image during session creation. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/create-liveness-with-verify-session-with-verify-image - * for more details. - *

Response Body Schema

+ *

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 body Request content 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 body, - RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.createLivenessWithVerifySessionWithVerifyImageSync(this.getEndpoint(), - this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, Context.NONE); - } - - /** - * Delete all session related information for matching the specified session id. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for - * more details. - * - * @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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/delete-liveness-with-verify-session for - * more details. - * - * @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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-result for - * more details. - *

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)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
      *                 }
-     *                 modelVersionUsed: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     verifyImageHash: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
@@ -1344,59 +921,49 @@ public Mono> getLivenessWithVerifySessionResultWithResponse
      * 
      * {@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)
+     *     sessionId: String (Required)
+     *     authToken: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     modelVersion: String(2024-11-15) (Optional)
+     *     results (Required): {
+     *         verifyReferences (Required): [
+     *              (Required){
+     *                 referenceType: String(Color/Infrared/Depth) (Required)
+     *                 faceRectangle (Required): {
+     *                     top: int (Required)
+     *                     left: int (Required)
+     *                     width: int (Required)
+     *                     height: int (Required)
      *                 }
-     *                 modelVersionUsed: String(2022-10-15-preview.04/2023-12-20-preview.06) (Optional)
-     *                 verifyResult (Optional): {
-     *                     verifyImage (Required): {
-     *                         faceRectangle (Required): (recursive schema, see faceRectangle above)
-     *                         qualityForRecognition: String(low/medium/high) (Required)
+     *                 qualityForRecognition: String(low/medium/high) (Required)
+     *             }
+     *         ]
+     *         attempts (Required): [
+     *              (Required){
+     *                 attemptId: int (Required)
+     *                 attemptStatus: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *                 result (Optional): {
+     *                     livenessDecision: String(uncertain/realface/spoofface) (Optional)
+     *                     targets (Required): {
+     *                         color (Required): {
+     *                             faceRectangle (Required): (recursive schema, see faceRectangle above)
+     *                         }
+     *                     }
+     *                     digest: String (Required)
+     *                     sessionImageId: String (Optional)
+     *                     verifyResult (Optional): {
+     *                         matchConfidence: double (Required)
+     *                         isIdentical: boolean (Required)
      *                     }
-     *                     matchConfidence: double (Required)
-     *                     isIdentical: boolean (Required)
+     *                     verifyImageHash: String (Optional)
      *                 }
-     *                  (Optional): {
-     *                     String: BinaryData (Required)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     targets (Required): (recursive schema, see targets above)
      *                 }
      *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
+     *         ]
      *     }
      * }
      * }
@@ -1418,272 +985,6 @@ public Response getLivenessWithVerifySessionResultWithResponse(Strin
             sessionId, accept, requestOptions, Context.NONE);
     }
 
-    /**
-     * Lists sessions for /detectLivenessWithVerify/SingleModal.
-     * 
-     * Please refer to
-     * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more
-     * details.
-     * 

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. - * - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-sessions for more - * details. - *

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); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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)); - } - - /** - * Please refer to - * https://learn.microsoft.com/rest/api/face/liveness-session-operations/get-liveness-with-verify-session-audit-entries - * for more details. - *

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(2022-10-15-preview.04/2023-12-20-preview.06) (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: BinaryData (Required)
-     *                 }
-     *             }
-     *             statusCode: int (Required)
-     *             latencyInMilliseconds: long (Required)
-     *         }
-     *         digest: String (Required)
-     *         sessionImageId: String (Optional)
-     *         verifyImageHash: String (Optional)
-     *     }
-     * ]
-     * }
-     * 
- * - * @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 response body 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); - } - /** * Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. * diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListsImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListImpl.java similarity index 85% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListsImpl.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListImpl.java index 06740b10fb4d..c5540457885a 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListsImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargeFaceListImpl.java @@ -25,6 +25,10 @@ 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; @@ -36,51 +40,146 @@ 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; /** - * An instance of this class provides access to all the operations defined in LargeFaceLists. + * Initializes a new instance of the LargeFaceList type. */ -public final class LargeFaceListsImpl { +public final class LargeFaceListImpl { /** * The proxy service used to perform REST calls. */ - private final LargeFaceListsService service; + private final LargeFaceListService service; /** - * The service client containing this operation class. + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). */ - private final FaceAdministrationClientImpl client; + private final String endpoint; /** - * Initializes an instance of LargeFaceListsImpl. + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). * - * @param client the instance of the service client containing this operation class. + * @return the endpoint value. */ - LargeFaceListsImpl(FaceAdministrationClientImpl client) { - this.service - = RestProxy.create(LargeFaceListsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; + public String getEndpoint() { + return this.endpoint; } + /** + * Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + */ + private final String largeFaceListId; + + /** + * Gets Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * + * @return the largeFaceListId value. + */ + public String getLargeFaceListId() { + return this.largeFaceListId; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + /** * Gets Service version. * * @return the serviceVersion value. */ public FaceServiceVersion getServiceVersion() { - return client.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 interface defining all the services for FaceAdministrationClientLargeFaceLists to be used by the proxy - * service to perform REST calls. + * 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 LargeFaceList client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param serviceVersion Service version. + */ + public LargeFaceListImpl(String endpoint, String largeFaceListId, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largeFaceListId, serviceVersion); + } + + /** + * Initializes an instance of LargeFaceList 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 largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param serviceVersion Service version. + */ + public LargeFaceListImpl(HttpPipeline httpPipeline, String endpoint, String largeFaceListId, + FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largeFaceListId, serviceVersion); + } + + /** + * Initializes an instance of LargeFaceList 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 largeFaceListId Valid character is letter in lower case or digit or '-' or '_', maximum length is 64. + * @param serviceVersion Service version. + */ + public LargeFaceListImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + String largeFaceListId, FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.largeFaceListId = largeFaceListId; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(LargeFaceListService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for LargeFaceList to be used by the proxy service to perform REST calls. */ @Host("{endpoint}/face/{apiVersion}") - @ServiceInterface(name = "FaceAdministrationCl") - public interface LargeFaceListsService { + @ServiceInterface(name = "LargeFaceList") + public interface LargeFaceListService { @Put("/largefacelists/{largeFaceListId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -89,7 +188,7 @@ public interface LargeFaceListsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest, RequestOptions requestOptions, Context context); @Put("/largefacelists/{largeFaceListId}") @@ -100,7 +199,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest, RequestOptions requestOptions, Context context); @Delete("/largefacelists/{largeFaceListId}") @@ -151,7 +250,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @HostParam( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest, RequestOptions requestOptions, Context context); @Patch("/largefacelists/{largeFaceListId}") @@ -162,7 +261,7 @@ Mono> update(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest, RequestOptions requestOptions, Context context); @Get("/largefacelists") @@ -234,7 +333,7 @@ Response trainSync(@HostParam("endpoint") String endpoint, @HostParam("api Mono> addFaceFromUrlImpl(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions, Context context); @Post("/largefacelists/{largeFaceListId}/persistedfaces") @@ -246,7 +345,7 @@ Mono> addFaceFromUrlImpl(@HostParam("endpoint") String endp Response addFaceFromUrlImplSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions, Context context); @Post("/largefacelists/{largeFaceListId}/persistedfaces") @@ -326,7 +425,7 @@ Response getFaceSync(@HostParam("endpoint") String endpoint, Mono> updateFace(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateFaceRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateFaceRequest, RequestOptions requestOptions, Context context); @Patch("/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}") @@ -338,7 +437,7 @@ Mono> updateFace(@HostParam("endpoint") String endpoint, Response updateFaceSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largeFaceListId") String largeFaceListId, @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateFaceRequest1, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateFaceRequest, RequestOptions requestOptions, Context context); @Get("/largefacelists/{largeFaceListId}/persistedfaces") @@ -380,7 +479,7 @@ Response getFacesSync(@HostParam("endpoint") String endpoint, * } *
* - * @param createRequest1 The createRequest1 parameter. + * @param createRequest The createRequest 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. @@ -389,12 +488,11 @@ Response getFacesSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(BinaryData createRequest1, RequestOptions requestOptions) { + public Mono> createWithResponseAsync(BinaryData createRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.create(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, createRequest1, requestOptions, context)); + return FluxUtil.withContext(context -> service.create(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, createRequest, requestOptions, context)); } /** @@ -415,7 +513,7 @@ public Mono> createWithResponseAsync(BinaryData createRequest1, R * } *
* - * @param createRequest1 The createRequest1 parameter. + * @param createRequest The createRequest 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. @@ -424,11 +522,11 @@ public Mono> createWithResponseAsync(BinaryData createRequest1, R * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { + public Response createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, createRequest1, requestOptions, Context.NONE); + return service.createSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + contentType, accept, createRequest, requestOptions, Context.NONE); } /** @@ -447,9 +545,8 @@ public Response createWithResponse(BinaryData createRequest1, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.delete(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), accept, requestOptions, context)); } /** @@ -468,8 +565,8 @@ public Mono> deleteWithResponseAsync(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, Context.NONE); + return service.deleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + accept, requestOptions, Context.NONE); } /** @@ -507,9 +604,8 @@ public Response deleteWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), accept, requestOptions, context)); } /** @@ -546,8 +642,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + accept, requestOptions, Context.NONE); } /** @@ -564,7 +660,7 @@ public Response getWithResponse(RequestOptions requestOptions) { * } *
* - * @param updateRequest1 The updateRequest1 parameter. + * @param updateRequest The updateRequest 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. @@ -573,12 +669,11 @@ public Response getWithResponse(RequestOptions requestOptions) { * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(BinaryData updateRequest1, RequestOptions requestOptions) { + public Mono> updateWithResponseAsync(BinaryData updateRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.update(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, updateRequest1, requestOptions, context)); + return FluxUtil.withContext(context -> service.update(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, updateRequest, requestOptions, context)); } /** @@ -595,7 +690,7 @@ public Mono> updateWithResponseAsync(BinaryData updateRequest1, R * } *
* - * @param updateRequest1 The updateRequest1 parameter. + * @param updateRequest The updateRequest 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. @@ -604,11 +699,11 @@ public Mono> updateWithResponseAsync(BinaryData updateRequest1, R * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { + public Response updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, updateRequest1, requestOptions, Context.NONE); + return service.updateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + contentType, accept, updateRequest, requestOptions, Context.NONE); } /** @@ -653,8 +748,8 @@ public Response updateWithResponse(BinaryData updateRequest1, RequestOptio @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLargeFaceListsWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLargeFaceLists(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getLargeFaceLists(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -699,8 +794,8 @@ public Mono> getLargeFaceListsWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getLargeFaceListsWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLargeFaceListsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); + return service.getLargeFaceListsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } /** @@ -731,9 +826,8 @@ public Response getLargeFaceListsWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTrainingStatusWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTrainingStatus(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargeFaceListId(), accept, requestOptions, - context)); + return FluxUtil.withContext(context -> service.getTrainingStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargeFaceListId(), accept, requestOptions, context)); } /** @@ -764,8 +858,8 @@ public Mono> getTrainingStatusWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getTrainingStatusWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getTrainingStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, Context.NONE); + return service.getTrainingStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), accept, requestOptions, Context.NONE); } /** @@ -784,9 +878,8 @@ public Response getTrainingStatusWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) private Mono> trainWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.train(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.train(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), accept, requestOptions, context)); } /** @@ -805,8 +898,8 @@ private Mono> trainWithResponseAsync(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) private Response trainWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.trainSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, Context.NONE); + return service.trainSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + accept, requestOptions, Context.NONE); } /** @@ -823,16 +916,16 @@ private Response trainWithResponse(RequestOptions requestOptions) { * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTrainAsync(RequestOptions requestOptions) { + public PollerFlux beginTrainWithModelAsync(RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.trainWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); } /** @@ -849,16 +942,16 @@ public PollerFlux beginTrainAsync(RequestOptions request * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTrain(RequestOptions requestOptions) { + public SyncPoller beginTrainWithModel(RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.trainWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); } /** @@ -875,16 +968,16 @@ public SyncPoller beginTrain(RequestOptions requestOptio * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTrainWithModelAsync(RequestOptions requestOptions) { + public PollerFlux beginTrainAsync(RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.trainWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** @@ -901,16 +994,16 @@ public PollerFlux beginTrainWithModelAsync(RequestOpti * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTrainWithModel(RequestOptions requestOptions) { + public SyncPoller beginTrain(RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.trainWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** @@ -952,7 +1045,7 @@ public SyncPoller beginTrainWithModel(RequestOptions r * } * * - * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 parameter. + * @param addFaceFromUrlRequest2 The addFaceFromUrlRequest2 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. @@ -961,13 +1054,13 @@ public SyncPoller beginTrainWithModel(RequestOptions r * @return response body for adding face along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> addFaceFromUrlImplWithResponseAsync(BinaryData addFaceFromUrlRequest1, + public Mono> addFaceFromUrlImplWithResponseAsync(BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.addFaceFromUrlImpl(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargeFaceListId(), contentType, accept, - addFaceFromUrlRequest1, requestOptions, context)); + return FluxUtil.withContext( + context -> service.addFaceFromUrlImpl(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, addFaceFromUrlRequest2, requestOptions, context)); } /** @@ -1009,7 +1102,7 @@ public Mono> addFaceFromUrlImplWithResponseAsync(BinaryData * } * * - * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 parameter. + * @param addFaceFromUrlRequest2 The addFaceFromUrlRequest2 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. @@ -1018,13 +1111,12 @@ public Mono> addFaceFromUrlImplWithResponseAsync(BinaryData * @return response body for adding face along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest1, + public Response addFaceFromUrlImplWithResponse(BinaryData addFaceFromUrlRequest2, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.addFaceFromUrlImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, addFaceFromUrlRequest1, requestOptions, - Context.NONE); + return service.addFaceFromUrlImplSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, addFaceFromUrlRequest2, requestOptions, Context.NONE); } /** @@ -1077,9 +1169,9 @@ public Mono> addFaceImplWithResponseAsync(BinaryData imageC RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.addFaceImpl(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, imageContent, requestOptions, context)); + return FluxUtil + .withContext(context -> service.addFaceImpl(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, imageContent, requestOptions, context)); } /** @@ -1131,8 +1223,8 @@ public Mono> addFaceImplWithResponseAsync(BinaryData imageC public Response addFaceImplWithResponse(BinaryData imageContent, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return service.addFaceImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), contentType, accept, imageContent, requestOptions, Context.NONE); + return service.addFaceImplSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), contentType, accept, imageContent, requestOptions, Context.NONE); } /** @@ -1150,9 +1242,9 @@ public Response addFaceImplWithResponse(BinaryData imageContent, Req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteFaceWithResponseAsync(String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), persistedFaceId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.deleteFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), persistedFaceId, accept, requestOptions, context)); } /** @@ -1170,8 +1262,8 @@ public Mono> deleteFaceWithResponseAsync(String persistedFaceId, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteFaceWithResponse(String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), persistedFaceId, accept, requestOptions, Context.NONE); + return service.deleteFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), persistedFaceId, accept, requestOptions, Context.NONE); } /** @@ -1199,9 +1291,9 @@ public Response deleteFaceWithResponse(String persistedFaceId, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFaceWithResponseAsync(String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), persistedFaceId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), persistedFaceId, accept, requestOptions, context)); } /** @@ -1229,8 +1321,8 @@ public Mono> getFaceWithResponseAsync(String persistedFaceI @ServiceMethod(returns = ReturnType.SINGLE) public Response getFaceWithResponse(String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), persistedFaceId, accept, requestOptions, Context.NONE); + return service.getFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargeFaceListId(), + persistedFaceId, accept, requestOptions, Context.NONE); } /** @@ -1247,7 +1339,7 @@ public Response getFaceWithResponse(String persistedFaceId, RequestO * * * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest1 The updateFaceRequest1 parameter. + * @param updateFaceRequest The updateFaceRequest 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. @@ -1256,13 +1348,13 @@ public Response getFaceWithResponse(String persistedFaceId, RequestO * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateFaceWithResponseAsync(String persistedFaceId, BinaryData updateFaceRequest1, + public Mono> updateFaceWithResponseAsync(String persistedFaceId, BinaryData updateFaceRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateFace(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargeFaceListId(), persistedFaceId, - contentType, accept, updateFaceRequest1, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargeFaceListId(), persistedFaceId, contentType, accept, + updateFaceRequest, requestOptions, context)); } /** @@ -1279,7 +1371,7 @@ public Mono> updateFaceWithResponseAsync(String persistedFaceId, * * * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest1 The updateFaceRequest1 parameter. + * @param updateFaceRequest The updateFaceRequest 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. @@ -1288,12 +1380,12 @@ public Mono> updateFaceWithResponseAsync(String persistedFaceId, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest1, + public Response updateFaceWithResponse(String persistedFaceId, BinaryData updateFaceRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), persistedFaceId, contentType, accept, updateFaceRequest1, requestOptions, + return service.updateFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), persistedFaceId, contentType, accept, updateFaceRequest, requestOptions, Context.NONE); } @@ -1335,9 +1427,8 @@ public Response updateFaceWithResponse(String persistedFaceId, BinaryData @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFacesWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getFaces(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getFaces(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargeFaceListId(), accept, requestOptions, context)); } /** @@ -1378,7 +1469,7 @@ public Mono> getFacesWithResponseAsync(RequestOptions reque @ServiceMethod(returns = ReturnType.SINGLE) public Response getFacesWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFacesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargeFaceListId(), accept, requestOptions, Context.NONE); + return service.getFacesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargeFaceListId(), accept, requestOptions, Context.NONE); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupsImpl.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupImpl.java similarity index 87% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupsImpl.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupImpl.java index 851591b35e01..e4814d06c22c 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupsImpl.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/LargePersonGroupImpl.java @@ -25,6 +25,10 @@ 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; @@ -36,51 +40,148 @@ 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; /** - * An instance of this class provides access to all the operations defined in LargePersonGroups. + * Initializes a new instance of the LargePersonGroup type. */ -public final class LargePersonGroupsImpl { +public final class LargePersonGroupImpl { /** * The proxy service used to perform REST calls. */ - private final LargePersonGroupsService service; + private final LargePersonGroupService service; /** - * The service client containing this operation class. + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). */ - private final FaceAdministrationClientImpl client; + private final String endpoint; /** - * Initializes an instance of LargePersonGroupsImpl. + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). * - * @param client the instance of the service client containing this operation class. + * @return the endpoint value. */ - LargePersonGroupsImpl(FaceAdministrationClientImpl client) { - this.service - = RestProxy.create(LargePersonGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; + public String getEndpoint() { + return this.endpoint; } + /** + * ID of the container. + */ + private final String largePersonGroupId; + + /** + * Gets ID of the container. + * + * @return the largePersonGroupId value. + */ + public String getLargePersonGroupId() { + return this.largePersonGroupId; + } + + /** + * Service version. + */ + private final FaceServiceVersion serviceVersion; + /** * Gets Service version. * * @return the serviceVersion value. */ public FaceServiceVersion getServiceVersion() { - return client.getServiceVersion(); + return this.serviceVersion; } /** - * The interface defining all the services for FaceAdministrationClientLargePersonGroups to be used by the proxy - * service to perform REST calls. + * 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 LargePersonGroup client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://{resource-name}.cognitiveservices.azure.com). + * @param largePersonGroupId ID of the container. + * @param serviceVersion Service version. + */ + public LargePersonGroupImpl(String endpoint, String largePersonGroupId, FaceServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largePersonGroupId, serviceVersion); + } + + /** + * Initializes an instance of LargePersonGroup 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 largePersonGroupId ID of the container. + * @param serviceVersion Service version. + */ + public LargePersonGroupImpl(HttpPipeline httpPipeline, String endpoint, String largePersonGroupId, + FaceServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, largePersonGroupId, + serviceVersion); + } + + /** + * Initializes an instance of LargePersonGroup 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 largePersonGroupId ID of the container. + * @param serviceVersion Service version. + */ + public LargePersonGroupImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + String largePersonGroupId, FaceServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.largePersonGroupId = largePersonGroupId; + this.serviceVersion = serviceVersion; + this.service = RestProxy.create(LargePersonGroupService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for LargePersonGroup to be used by the proxy service to perform REST + * calls. */ @Host("{endpoint}/face/{apiVersion}") - @ServiceInterface(name = "FaceAdministrationCl") - public interface LargePersonGroupsService { + @ServiceInterface(name = "LargePersonGroup") + public interface LargePersonGroupService { @Put("/largepersongroups/{largePersonGroupId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -89,7 +190,7 @@ public interface LargePersonGroupsService { @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> create(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest1, RequestOptions requestOptions, Context context); @Put("/largepersongroups/{largePersonGroupId}") @@ -100,7 +201,7 @@ Mono> create(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Response createSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createRequest1, RequestOptions requestOptions, Context context); @Delete("/largepersongroups/{largePersonGroupId}") @@ -151,7 +252,7 @@ Response getSync(@HostParam("endpoint") String endpoint, @HostParam( @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> update(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest1, RequestOptions requestOptions, Context context); @Patch("/largepersongroups/{largePersonGroupId}") @@ -162,7 +263,7 @@ Mono> update(@HostParam("endpoint") String endpoint, @HostParam(" @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateRequest1, RequestOptions requestOptions, Context context); @Get("/largepersongroups") @@ -346,7 +447,7 @@ Response getPersonsSync(@HostParam("endpoint") String endpoint, Mono> addFaceFromUrlImpl(@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/json") BinaryData addFaceFromUrlRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions, Context context); @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") @@ -358,7 +459,7 @@ Mono> addFaceFromUrlImpl(@HostParam("endpoint") String endp Response addFaceFromUrlImplSync(@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/json") BinaryData addFaceFromUrlRequest, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions, Context context); @Post("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces") @@ -439,7 +540,7 @@ Mono> updateFace(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData updateFaceRequest, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData updateFaceRequest1, RequestOptions requestOptions, Context context); @Patch("/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}") @@ -452,7 +553,7 @@ Response updateFaceSync(@HostParam("endpoint") String endpoint, @HostParam("apiVersion") String apiVersion, @PathParam("largePersonGroupId") String largePersonGroupId, @PathParam("personId") String personId, @PathParam("persistedFaceId") String persistedFaceId, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData updateFaceRequest, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData updateFaceRequest1, RequestOptions requestOptions, Context context); } @@ -474,7 +575,7 @@ Response updateFaceSync(@HostParam("endpoint") String endpoint, * } * * - * @param createRequest The createRequest parameter. + * @param createRequest1 The createRequest1 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. @@ -483,12 +584,11 @@ Response updateFaceSync(@HostParam("endpoint") String endpoint, * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync(BinaryData createRequest, RequestOptions requestOptions) { + public Mono> createWithResponseAsync(BinaryData createRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.create(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), contentType, accept, createRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.create(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, createRequest1, requestOptions, context)); } /** @@ -509,7 +609,7 @@ public Mono> createWithResponseAsync(BinaryData createRequest, Re * } * * - * @param createRequest The createRequest parameter. + * @param createRequest1 The createRequest1 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. @@ -518,11 +618,11 @@ public Mono> createWithResponseAsync(BinaryData createRequest, Re * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(BinaryData createRequest, RequestOptions requestOptions) { + public Response createWithResponse(BinaryData createRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), contentType, accept, createRequest, requestOptions, Context.NONE); + return service.createSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, createRequest1, requestOptions, Context.NONE); } /** @@ -539,9 +639,8 @@ public Response createWithResponse(BinaryData createRequest, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.delete(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, context)); } /** @@ -558,8 +657,8 @@ public Mono> deleteWithResponseAsync(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, Context.NONE); + return service.deleteSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, Context.NONE); } /** @@ -597,9 +696,8 @@ public Response deleteWithResponse(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.get(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, context)); } /** @@ -637,8 +735,8 @@ public Mono> getWithResponseAsync(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, Context.NONE); + return service.getSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), + accept, requestOptions, Context.NONE); } /** @@ -655,7 +753,7 @@ public Response getWithResponse(RequestOptions requestOptions) { * } * * - * @param updateRequest The updateRequest parameter. + * @param updateRequest1 The updateRequest1 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. @@ -664,12 +762,11 @@ public Response getWithResponse(RequestOptions requestOptions) { * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWithResponseAsync(BinaryData updateRequest, RequestOptions requestOptions) { + public Mono> updateWithResponseAsync(BinaryData updateRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.update(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), contentType, accept, updateRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.update(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, updateRequest1, requestOptions, context)); } /** @@ -686,7 +783,7 @@ public Mono> updateWithResponseAsync(BinaryData updateRequest, Re * } * * - * @param updateRequest The updateRequest parameter. + * @param updateRequest1 The updateRequest1 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. @@ -695,11 +792,11 @@ public Mono> updateWithResponseAsync(BinaryData updateRequest, Re * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(BinaryData updateRequest, RequestOptions requestOptions) { + public Response updateWithResponse(BinaryData updateRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), contentType, accept, updateRequest, requestOptions, Context.NONE); + return service.updateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, updateRequest1, requestOptions, Context.NONE); } /** @@ -744,8 +841,8 @@ public Response updateWithResponse(BinaryData updateRequest, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLargePersonGroupsWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getLargePersonGroups(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getLargePersonGroups(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -790,8 +887,8 @@ public Mono> getLargePersonGroupsWithResponseAsync(RequestO @ServiceMethod(returns = ReturnType.SINGLE) public Response getLargePersonGroupsWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLargePersonGroupsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - accept, requestOptions, Context.NONE); + return service.getLargePersonGroupsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, Context.NONE); } /** @@ -825,9 +922,8 @@ public Response getLargePersonGroupsWithResponse(RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getTrainingStatusWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getTrainingStatus(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), accept, requestOptions, - context)); + return FluxUtil.withContext(context -> service.getTrainingStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), accept, requestOptions, context)); } /** @@ -861,8 +957,8 @@ public Mono> getTrainingStatusWithResponseAsync(RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) public Response getTrainingStatusWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getTrainingStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, Context.NONE); + return service.getTrainingStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, Context.NONE); } /** @@ -882,9 +978,8 @@ public Response getTrainingStatusWithResponse(RequestOptions request @ServiceMethod(returns = ReturnType.SINGLE) private Mono> trainWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.train(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.train(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, context)); } /** @@ -904,8 +999,8 @@ private Mono> trainWithResponseAsync(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) private Response trainWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.trainSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, Context.NONE); + return service.trainSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, Context.NONE); } /** @@ -923,16 +1018,16 @@ private Response trainWithResponse(RequestOptions requestOptions) { * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTrainAsync(RequestOptions requestOptions) { + public PollerFlux beginTrainWithModelAsync(RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.trainWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); } /** @@ -950,16 +1045,16 @@ public PollerFlux beginTrainAsync(RequestOptions request * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTrain(RequestOptions requestOptions) { + public SyncPoller beginTrainWithModel(RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.trainWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); } /** @@ -977,16 +1072,16 @@ public SyncPoller beginTrain(RequestOptions requestOptio * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginTrainWithModelAsync(RequestOptions requestOptions) { + public PollerFlux beginTrainAsync(RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.trainWithResponseAsync(requestOptions), - new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** @@ -1004,16 +1099,16 @@ public PollerFlux beginTrainWithModelAsync(RequestOpti * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginTrainWithModel(RequestOptions requestOptions) { + public SyncPoller beginTrain(RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.trainWithResponse(requestOptions), - new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) - .setEndpoint("{endpoint}/face/{apiVersion}".replace("{endpoint}", this.client.getEndpoint()) - .replace("{apiVersion}", this.client.getServiceVersion().getVersion())) + 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.client.getServiceVersion().getVersion())), - TypeReference.createInstance(FaceTrainingResult.class), TypeReference.createInstance(Void.class)); + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** @@ -1057,9 +1152,9 @@ public Mono> createPersonWithResponseAsync(BinaryData creat RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createPerson(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), contentType, accept, - createPersonRequest, requestOptions, context)); + return FluxUtil + .withContext(context -> service.createPerson(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, createPersonRequest, requestOptions, context)); } /** @@ -1103,9 +1198,8 @@ public Response createPersonWithResponse(BinaryData createPersonRequ RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createPersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), contentType, accept, createPersonRequest, requestOptions, - Context.NONE); + return service.createPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), contentType, accept, createPersonRequest, requestOptions, Context.NONE); } /** @@ -1124,9 +1218,9 @@ public Response createPersonWithResponse(BinaryData createPersonRequ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deletePersonWithResponseAsync(String personId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deletePerson(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.deletePerson(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, accept, requestOptions, context)); } /** @@ -1145,8 +1239,8 @@ public Mono> deletePersonWithResponseAsync(String personId, Reque @ServiceMethod(returns = ReturnType.SINGLE) public Response deletePersonWithResponse(String personId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deletePersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, accept, requestOptions, Context.NONE); + return service.deletePersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, accept, requestOptions, Context.NONE); } /** @@ -1179,9 +1273,9 @@ public Response deletePersonWithResponse(String personId, RequestOptions r @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPersonWithResponseAsync(String personId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getPerson(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getPerson(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, accept, requestOptions, context)); } /** @@ -1213,8 +1307,8 @@ public Mono> getPersonWithResponseAsync(String personId, Re @ServiceMethod(returns = ReturnType.SINGLE) public Response getPersonWithResponse(String personId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getPersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, accept, requestOptions, Context.NONE); + return service.getPersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, accept, requestOptions, Context.NONE); } /** @@ -1246,9 +1340,9 @@ public Mono> updatePersonWithResponseAsync(String personId, Binar RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updatePerson(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), personId, contentType, - accept, updatePersonRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.updatePerson(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), personId, contentType, accept, + updatePersonRequest, requestOptions, context)); } /** @@ -1280,8 +1374,8 @@ public Response updatePersonWithResponse(String personId, BinaryData updat RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updatePersonSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, contentType, accept, updatePersonRequest, requestOptions, + return service.updatePersonSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, contentType, accept, updatePersonRequest, requestOptions, Context.NONE); } @@ -1328,9 +1422,8 @@ public Response updatePersonWithResponse(String personId, BinaryData updat @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getPersonsWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getPersons(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getPersons(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), accept, requestOptions, context)); } /** @@ -1376,8 +1469,8 @@ public Mono> getPersonsWithResponseAsync(RequestOptions req @ServiceMethod(returns = ReturnType.SINGLE) public Response getPersonsWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getPersonsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), accept, requestOptions, Context.NONE); + return service.getPersonsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), accept, requestOptions, Context.NONE); } /** @@ -1421,7 +1514,7 @@ public Response getPersonsWithResponse(RequestOptions requestOptions * * * @param personId ID of the person. - * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 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. @@ -1431,12 +1524,12 @@ public Response getPersonsWithResponse(RequestOptions requestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addFaceFromUrlImplWithResponseAsync(String personId, - BinaryData addFaceFromUrlRequest, RequestOptions requestOptions) { + BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.addFaceFromUrlImpl(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), personId, contentType, - accept, addFaceFromUrlRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.addFaceFromUrlImpl(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), personId, contentType, accept, + addFaceFromUrlRequest1, requestOptions, context)); } /** @@ -1480,7 +1573,7 @@ public Mono> addFaceFromUrlImplWithResponseAsync(String per * * * @param personId ID of the person. - * @param addFaceFromUrlRequest The addFaceFromUrlRequest parameter. + * @param addFaceFromUrlRequest1 The addFaceFromUrlRequest1 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. @@ -1489,12 +1582,12 @@ public Mono> addFaceFromUrlImplWithResponseAsync(String per * @return response body for adding face along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest, + public Response addFaceFromUrlImplWithResponse(String personId, BinaryData addFaceFromUrlRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.addFaceFromUrlImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, contentType, accept, addFaceFromUrlRequest, requestOptions, + return service.addFaceFromUrlImplSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, contentType, accept, addFaceFromUrlRequest1, requestOptions, Context.NONE); } @@ -1550,9 +1643,9 @@ public Mono> addFaceImplWithResponseAsync(String personId, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.addFaceImpl(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), personId, contentType, - accept, imageContent, requestOptions, context)); + return FluxUtil + .withContext(context -> service.addFaceImpl(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, contentType, accept, imageContent, requestOptions, context)); } /** @@ -1607,9 +1700,8 @@ public Response addFaceImplWithResponse(String personId, BinaryData RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return service.addFaceImplSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, contentType, accept, imageContent, requestOptions, - Context.NONE); + return service.addFaceImplSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, contentType, accept, imageContent, requestOptions, Context.NONE); } /** @@ -1633,9 +1725,9 @@ public Response addFaceImplWithResponse(String personId, BinaryData public Mono> deleteFaceWithResponseAsync(String personId, String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.deleteFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, context)); } /** @@ -1659,8 +1751,8 @@ public Mono> deleteFaceWithResponseAsync(String personId, String public Response deleteFaceWithResponse(String personId, String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.deleteFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, Context.NONE); + return service.deleteFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, Context.NONE); } /** @@ -1692,9 +1784,9 @@ public Response deleteFaceWithResponse(String personId, String persistedFa public Mono> getFaceWithResponseAsync(String personId, String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getFace(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getFace(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, context)); } /** @@ -1725,8 +1817,8 @@ public Mono> getFaceWithResponseAsync(String personId, Stri public Response getFaceWithResponse(String personId, String persistedFaceId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, Context.NONE); + return service.getFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, persistedFaceId, accept, requestOptions, Context.NONE); } /** @@ -1745,7 +1837,7 @@ public Response getFaceWithResponse(String personId, String persiste * * @param personId ID of the person. * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest The updateFaceRequest parameter. + * @param updateFaceRequest1 The updateFaceRequest1 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. @@ -1755,12 +1847,12 @@ public Response getFaceWithResponse(String personId, String persiste */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateFaceWithResponseAsync(String personId, String persistedFaceId, - BinaryData updateFaceRequest, RequestOptions requestOptions) { + BinaryData updateFaceRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateFace(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), this.client.getLargePersonGroupId(), personId, - persistedFaceId, contentType, accept, updateFaceRequest, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateFace(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getLargePersonGroupId(), personId, persistedFaceId, contentType, + accept, updateFaceRequest1, requestOptions, context)); } /** @@ -1779,7 +1871,7 @@ public Mono> updateFaceWithResponseAsync(String personId, String * * @param personId ID of the person. * @param persistedFaceId Face ID of the face. - * @param updateFaceRequest The updateFaceRequest parameter. + * @param updateFaceRequest1 The updateFaceRequest1 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. @@ -1788,12 +1880,12 @@ public Mono> updateFaceWithResponseAsync(String personId, String * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateFaceWithResponse(String personId, String persistedFaceId, BinaryData updateFaceRequest, + public Response updateFaceWithResponse(String personId, String persistedFaceId, BinaryData updateFaceRequest1, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateFaceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), - this.client.getLargePersonGroupId(), personId, persistedFaceId, contentType, accept, updateFaceRequest, + return service.updateFaceSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getLargePersonGroupId(), personId, persistedFaceId, contentType, accept, updateFaceRequest1, requestOptions, Context.NONE); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest2.java similarity index 75% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest2.java index 7da8010e90b4..eb228c87fc7c 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/AddFaceFromUrlRequest2.java @@ -12,10 +12,10 @@ import java.io.IOException; /** - * The AddFaceFromUrlRequest model. + * The AddFaceFromUrlRequest2 model. */ @Immutable -public final class AddFaceFromUrlRequest implements JsonSerializable { +public final class AddFaceFromUrlRequest2 implements JsonSerializable { /* * URL of input image. @@ -24,12 +24,12 @@ public final class AddFaceFromUrlRequest implements JsonSerializable { String url = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -76,7 +76,7 @@ public static AddFaceFromUrlRequest fromJson(JsonReader jsonReader) throws IOExc reader.skipChildren(); } } - return new AddFaceFromUrlRequest(url); + return new AddFaceFromUrlRequest2(url); }); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java deleted file mode 100644 index bf475b73292b..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionContent.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionMultipartContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionMultipartContent.java deleted file mode 100644 index 4901bcb04ff2..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/CreateLivenessWithVerifySessionMultipartContent.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.CreateLivenessWithVerifySessionContent; -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; - -/** - * Request of liveness with verify session creation. - */ -@Immutable -public final class CreateLivenessWithVerifySessionMultipartContent { - - /* - * The parameters for creating session. - */ - @Generated - private final CreateLivenessWithVerifySessionContent parameters; - - /* - * The image stream for verify. Content-Disposition header field for this part must have filename. - */ - @Generated - private final VerifyImageFileDetails verifyImage; - - /** - * Get the parameters property: The parameters for creating session. - * - * @return the parameters value. - */ - @Generated - public CreateLivenessWithVerifySessionContent 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; - } - - /** - * Creates an instance of CreateLivenessWithVerifySessionMultipartContent class. - * - * @param parameters the parameters value to set. - * @param verifyImage the verifyImage value to set. - */ - @Generated - public CreateLivenessWithVerifySessionMultipartContent(CreateLivenessWithVerifySessionContent parameters, - VerifyImageFileDetails verifyImage) { - this.parameters = parameters; - this.verifyImage = verifyImage; - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlImplOptions.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlImplOptions.java index b658737d977a..1e618b8a1e90 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlImplOptions.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/DetectFromUrlImplOptions.java @@ -16,12 +16,6 @@ @Fluent public final class DetectFromUrlImplOptions { - /* - * URL of input image. - */ - @Generated - private final String url; - /* * The 'detectionModel' associated with the detected faceIds. Supported 'detectionModel' values include * 'detection_01', 'detection_02' and 'detection_03'. The default value is 'detection_01'. 'detection_03' is @@ -71,6 +65,12 @@ public final class DetectFromUrlImplOptions { @Generated private Integer faceIdTimeToLive; + /* + * URL of input image. + */ + @Generated + private final String url; + /** * Creates an instance of DetectFromUrlImplOptions class. * @@ -81,16 +81,6 @@ public DetectFromUrlImplOptions(String url) { this.url = url; } - /** - * Get the url property: URL of input image. - * - * @return the url value. - */ - @Generated - public String getUrl() { - return this.url; - } - /** * Get the detectionModel property: The 'detectionModel' associated with the detected faceIds. Supported * 'detectionModel' values include 'detection_01', 'detection_02' and 'detection_03'. The default value is @@ -268,4 +258,14 @@ public DetectFromUrlImplOptions setFaceIdTimeToLive(Integer faceIdTimeToLive) { this.faceIdTimeToLive = faceIdTimeToLive; return this; } + + /** + * Get the url property: URL of input image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java deleted file mode 100644 index 5baa92df06c0..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditLivenessResponseInfo.java +++ /dev/null @@ -1,127 +0,0 @@ -// 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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Audit entry for a response in the session. - */ -@Immutable -public final class AuditLivenessResponseInfo implements JsonSerializable { - - /* - * The response body. The schema of this field will depend on the request.url and request.method used by the client. - */ - @Generated - private final LivenessResponseBody body; - - /* - * The HTTP status code returned to the client. - */ - @Generated - private final int statusCode; - - /* - * The server measured latency for this request in milliseconds. - */ - @Generated - 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 - private AuditLivenessResponseInfo(LivenessResponseBody body, int statusCode, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("body", this.body); - jsonWriter.writeIntField("statusCode", this.statusCode); - jsonWriter.writeLongField("latencyInMilliseconds", this.latencyInMilliseconds); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AuditLivenessResponseInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AuditLivenessResponseInfo if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AuditLivenessResponseInfo. - */ - @Generated - public static AuditLivenessResponseInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LivenessResponseBody body = null; - int statusCode = 0; - long latencyInMilliseconds = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("body".equals(fieldName)) { - body = LivenessResponseBody.fromJson(reader); - } else if ("statusCode".equals(fieldName)) { - statusCode = reader.getInt(); - } else if ("latencyInMilliseconds".equals(fieldName)) { - latencyInMilliseconds = reader.getLong(); - } else { - reader.skipChildren(); - } - } - return new AuditLivenessResponseInfo(body, statusCode, latencyInMilliseconds); - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java deleted file mode 100644 index b01607537f25..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/AuditRequestInfo.java +++ /dev/null @@ -1,169 +0,0 @@ -// 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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Audit entry for a request in the session. - */ -@Immutable -public final class AuditRequestInfo implements JsonSerializable { - - /* - * The relative URL and query of the liveness request. - */ - @Generated - private final String url; - - /* - * The HTTP method of the request (i.e., GET, POST, DELETE). - */ - @Generated - private final String method; - - /* - * The length of the request body in bytes. - */ - @Generated - private Long contentLength; - - /* - * The content type of the request. - */ - @Generated - private final String contentType; - - /* - * The user agent used to submit the request. - */ - @Generated - 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 - private AuditRequestInfo(String url, String method, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("url", this.url); - jsonWriter.writeStringField("method", this.method); - jsonWriter.writeStringField("contentType", this.contentType); - jsonWriter.writeNumberField("contentLength", this.contentLength); - jsonWriter.writeStringField("userAgent", this.userAgent); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of AuditRequestInfo from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AuditRequestInfo if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AuditRequestInfo. - */ - @Generated - public static AuditRequestInfo fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String url = null; - String method = null; - String contentType = null; - Long contentLength = null; - String userAgent = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("url".equals(fieldName)) { - url = reader.getString(); - } else if ("method".equals(fieldName)) { - method = reader.getString(); - } else if ("contentType".equals(fieldName)) { - contentType = reader.getString(); - } else if ("contentLength".equals(fieldName)) { - contentLength = reader.getNullable(JsonReader::getLong); - } else if ("userAgent".equals(fieldName)) { - userAgent = reader.getString(); - } else { - reader.skipChildren(); - } - } - AuditRequestInfo deserializedAuditRequestInfo = new AuditRequestInfo(url, method, contentType); - deserializedAuditRequestInfo.contentLength = contentLength; - deserializedAuditRequestInfo.userAgent = userAgent; - return deserializedAuditRequestInfo; - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionOptions.java similarity index 62% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionOptions.java index aac886809d00..6e812c0c20f3 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionContent.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionOptions.java @@ -15,7 +15,7 @@ * Request model for creating liveness session. */ @Fluent -public final class CreateLivenessSessionContent implements JsonSerializable { +public final class CreateLivenessSessionOptions implements JsonSerializable { /* * Type of liveness mode the client should follow. @@ -24,20 +24,24 @@ public final class CreateLivenessSessionContent implements JsonSerializable { LivenessOperationMode livenessOperationMode = null; - Boolean sendResultsToClient = null; Boolean deviceCorrelationIdSetInClient = null; Boolean enableSessionImage = null; - LivenessModel livenessSingleModalModel = null; + LivenessModel livenessModelVersion = null; String deviceCorrelationId = null; Integer authTokenTimeToLiveInSeconds = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -219,14 +239,12 @@ public static CreateLivenessSessionContent fromJson(JsonReader jsonReader) throw reader.nextToken(); if ("livenessOperationMode".equals(fieldName)) { livenessOperationMode = LivenessOperationMode.fromString(reader.getString()); - } else if ("sendResultsToClient".equals(fieldName)) { - sendResultsToClient = reader.getNullable(JsonReader::getBoolean); } else if ("deviceCorrelationIdSetInClient".equals(fieldName)) { deviceCorrelationIdSetInClient = reader.getNullable(JsonReader::getBoolean); } else if ("enableSessionImage".equals(fieldName)) { enableSessionImage = reader.getNullable(JsonReader::getBoolean); - } else if ("livenessSingleModalModel".equals(fieldName)) { - livenessSingleModalModel = LivenessModel.fromString(reader.getString()); + } else if ("livenessModelVersion".equals(fieldName)) { + livenessModelVersion = LivenessModel.fromString(reader.getString()); } else if ("deviceCorrelationId".equals(fieldName)) { deviceCorrelationId = reader.getString(); } else if ("authTokenTimeToLiveInSeconds".equals(fieldName)) { @@ -235,74 +253,14 @@ public static CreateLivenessSessionContent fromJson(JsonReader jsonReader) throw reader.skipChildren(); } } - CreateLivenessSessionContent deserializedCreateLivenessSessionContent - = new CreateLivenessSessionContent(livenessOperationMode); - deserializedCreateLivenessSessionContent.sendResultsToClient = sendResultsToClient; - deserializedCreateLivenessSessionContent.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; - deserializedCreateLivenessSessionContent.enableSessionImage = enableSessionImage; - deserializedCreateLivenessSessionContent.livenessSingleModalModel = livenessSingleModalModel; - deserializedCreateLivenessSessionContent.deviceCorrelationId = deviceCorrelationId; - deserializedCreateLivenessSessionContent.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - return deserializedCreateLivenessSessionContent; + CreateLivenessSessionOptions deserializedCreateLivenessSessionOptions + = new CreateLivenessSessionOptions(livenessOperationMode); + deserializedCreateLivenessSessionOptions.deviceCorrelationIdSetInClient = deviceCorrelationIdSetInClient; + deserializedCreateLivenessSessionOptions.enableSessionImage = enableSessionImage; + deserializedCreateLivenessSessionOptions.livenessModelVersion = livenessModelVersion; + deserializedCreateLivenessSessionOptions.deviceCorrelationId = deviceCorrelationId; + deserializedCreateLivenessSessionOptions.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; + return deserializedCreateLivenessSessionOptions; }); } - - /* - * Whether or not store the session image. - */ - @Generated - private Boolean enableSessionImage; - - /* - * The model version used for liveness classification. This is an optional parameter, and if this is not specified, - * then the latest supported model version will be chosen - */ - @Generated - private LivenessModel livenessSingleModalModel; - - /** - * Get the enableSessionImage property: Whether or not store the session image. - * - * @return the enableSessionImage value. - */ - @Generated - public Boolean isEnableSessionImage() { - return this.enableSessionImage; - } - - /** - * Set the enableSessionImage property: Whether or not store the session image. - * - * @param enableSessionImage the enableSessionImage value to set. - * @return the CreateLivenessSessionContent object itself. - */ - @Generated - public CreateLivenessSessionContent setEnableSessionImage(Boolean enableSessionImage) { - this.enableSessionImage = enableSessionImage; - return this; - } - - /** - * Get the livenessSingleModalModel property: The model version used for liveness classification. This is an - * optional parameter, and if this is not specified, then the latest supported model version will be chosen. - * - * @return the livenessSingleModalModel value. - */ - @Generated - public LivenessModel getLivenessSingleModalModel() { - return this.livenessSingleModalModel; - } - - /** - * Set the livenessSingleModalModel property: The model version used for liveness classification. This is an - * optional parameter, and if this is not specified, then the latest supported model version will be chosen. - * - * @param livenessSingleModalModel the livenessSingleModalModel value to set. - * @return the CreateLivenessSessionContent object itself. - */ - @Generated - public CreateLivenessSessionContent setLivenessSingleModalModel(LivenessModel livenessSingleModalModel) { - this.livenessSingleModalModel = livenessSingleModalModel; - return this; - } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java deleted file mode 100644 index 1b410ca78445..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessSessionResult.java +++ /dev/null @@ -1,109 +0,0 @@ -// 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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Response of liveness session creation. - */ -@Immutable -public final class CreateLivenessSessionResult implements JsonSerializable { - - /* - * 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 - 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 - 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 - private CreateLivenessSessionResult(String sessionId, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sessionId", this.sessionId); - jsonWriter.writeStringField("authToken", this.authToken); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CreateLivenessSessionResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CreateLivenessSessionResult if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CreateLivenessSessionResult. - */ - @Generated - public static CreateLivenessSessionResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String sessionId = null; - String authToken = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("sessionId".equals(fieldName)) { - sessionId = reader.getString(); - } else if ("authToken".equals(fieldName)) { - authToken = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new CreateLivenessSessionResult(sessionId, authToken); - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java index fcd6d226adca..50e6322c9d6a 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionContent.java @@ -5,18 +5,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; /** - * Request for creating liveness with verify session. + * Request of liveness with verify session creation. */ @Fluent -public final class CreateLivenessWithVerifySessionContent - implements JsonSerializable { +public final class CreateLivenessWithVerifySessionContent { /* * Type of liveness mode the client should follow. @@ -24,15 +18,6 @@ public final class CreateLivenessWithVerifySessionContent @Generated 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 - 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. @@ -51,41 +36,52 @@ public final class CreateLivenessWithVerifySessionContent * then the latest supported model version will be chosen */ @Generated - private LivenessModel livenessSingleModalModel; + private LivenessModel livenessModelVersion; /* - * 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. + * Whether or not return the verify image hash. */ @Generated - private String deviceCorrelationId; + private Boolean returnVerifyImageHash; /* - * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + * Threshold for confidence of the face verification. Please refer to the documentation for more details. + * https://learn.microsoft.com/legal/cognitive-services/face/characteristics-and-limitations?context=%2Fazure%2Fai- + * services%2Fcomputer-vision%2Fcontext%2Fcontext#recognition-confidence-score */ @Generated - private Integer authTokenTimeToLiveInSeconds; + private Double verifyConfidenceThreshold; /* - * Whether or not return the verify image hash. + * The image stream for verify. Content-Disposition header field for this part must have filename. */ @Generated - private Boolean returnVerifyImageHash; + private final VerifyImageFileDetails verifyImage; /* - * Threshold for confidence of the face verification. + * 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 - private Double verifyConfidenceThreshold; + private String deviceCorrelationId; + + /* + * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + */ + @Generated + private Integer authTokenTimeToLiveInSeconds; /** * Creates an instance of CreateLivenessWithVerifySessionContent class. * * @param livenessOperationMode the livenessOperationMode value to set. + * @param verifyImage the verifyImage value to set. */ @Generated - public CreateLivenessWithVerifySessionContent(LivenessOperationMode livenessOperationMode) { + public CreateLivenessWithVerifySessionContent(LivenessOperationMode livenessOperationMode, + VerifyImageFileDetails verifyImage) { this.livenessOperationMode = livenessOperationMode; + this.verifyImage = verifyImage; } /** @@ -98,34 +94,6 @@ 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 CreateLivenessWithVerifySessionContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionContent 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 @@ -176,204 +144,136 @@ public CreateLivenessWithVerifySessionContent setEnableSessionImage(Boolean enab } /** - * Get the livenessSingleModalModel property: The model version used for liveness classification. This is an - * optional parameter, and if this is not specified, then the latest supported model version will be chosen. + * Get the livenessModelVersion property: The model version used for liveness classification. This is an optional + * parameter, and if this is not specified, then the latest supported model version will be chosen. * - * @return the livenessSingleModalModel value. + * @return the livenessModelVersion value. */ @Generated - public LivenessModel getLivenessSingleModalModel() { - return this.livenessSingleModalModel; + public LivenessModel getLivenessModelVersion() { + return this.livenessModelVersion; } /** - * Set the livenessSingleModalModel property: The model version used for liveness classification. This is an - * optional parameter, and if this is not specified, then the latest supported model version will be chosen. + * Set the livenessModelVersion property: The model version used for liveness classification. This is an optional + * parameter, and if this is not specified, then the latest supported model version will be chosen. * - * @param livenessSingleModalModel the livenessSingleModalModel value to set. + * @param livenessModelVersion the livenessModelVersion value to set. * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionContent setLivenessSingleModalModel(LivenessModel livenessSingleModalModel) { - this.livenessSingleModalModel = livenessSingleModalModel; + public CreateLivenessWithVerifySessionContent setLivenessModelVersion(LivenessModel livenessModelVersion) { + this.livenessModelVersion = livenessModelVersion; 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. + * Get the returnVerifyImageHash property: Whether or not return the verify image hash. * - * @return the deviceCorrelationId value. + * @return the returnVerifyImageHash value. */ @Generated - public String getDeviceCorrelationId() { - return this.deviceCorrelationId; + public Boolean isReturnVerifyImageHash() { + return this.returnVerifyImageHash; } /** - * 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. + * Set the returnVerifyImageHash property: Whether or not return the verify image hash. * - * @param deviceCorrelationId the deviceCorrelationId value to set. + * @param returnVerifyImageHash the returnVerifyImageHash value to set. * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionContent setDeviceCorrelationId(String deviceCorrelationId) { - this.deviceCorrelationId = deviceCorrelationId; + public CreateLivenessWithVerifySessionContent setReturnVerifyImageHash(Boolean returnVerifyImageHash) { + this.returnVerifyImageHash = returnVerifyImageHash; return this; } /** - * Get the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. - * Default value is 600. + * Get the verifyConfidenceThreshold property: Threshold for confidence of the face verification. Please refer to + * the documentation for more details. + * https://learn.microsoft.com/legal/cognitive-services/face/characteristics-and-limitations?context=%2Fazure%2Fai-services%2Fcomputer-vision%2Fcontext%2Fcontext#recognition-confidence-score. * - * @return the authTokenTimeToLiveInSeconds value. + * @return the verifyConfidenceThreshold value. */ @Generated - public Integer getAuthTokenTimeToLiveInSeconds() { - return this.authTokenTimeToLiveInSeconds; + public Double getVerifyConfidenceThreshold() { + return this.verifyConfidenceThreshold; } /** - * Set the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. - * Default value is 600. + * Set the verifyConfidenceThreshold property: Threshold for confidence of the face verification. Please refer to + * the documentation for more details. + * https://learn.microsoft.com/legal/cognitive-services/face/characteristics-and-limitations?context=%2Fazure%2Fai-services%2Fcomputer-vision%2Fcontext%2Fcontext#recognition-confidence-score. * - * @param authTokenTimeToLiveInSeconds the authTokenTimeToLiveInSeconds value to set. + * @param verifyConfidenceThreshold the verifyConfidenceThreshold value to set. * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionContent - setAuthTokenTimeToLiveInSeconds(Integer authTokenTimeToLiveInSeconds) { - this.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; + public CreateLivenessWithVerifySessionContent setVerifyConfidenceThreshold(Double verifyConfidenceThreshold) { + this.verifyConfidenceThreshold = verifyConfidenceThreshold; return this; } /** - * Get the returnVerifyImageHash property: Whether or not return the verify image hash. + * Get the verifyImage property: The image stream for verify. Content-Disposition header field for this part must + * have filename. * - * @return the returnVerifyImageHash value. + * @return the verifyImage value. */ @Generated - public Boolean isReturnVerifyImageHash() { - return this.returnVerifyImageHash; + public VerifyImageFileDetails getVerifyImage() { + return this.verifyImage; } /** - * Set the returnVerifyImageHash property: Whether or not return the verify image hash. - * - * @param returnVerifyImageHash the returnVerifyImageHash value to set. - * @return the CreateLivenessWithVerifySessionContent object itself. - */ - @Generated - public CreateLivenessWithVerifySessionContent setReturnVerifyImageHash(Boolean returnVerifyImageHash) { - this.returnVerifyImageHash = returnVerifyImageHash; - return this; - } - - /** - * Get the verifyConfidenceThreshold property: Threshold for confidence of the face verification. + * 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 verifyConfidenceThreshold value. + * @return the deviceCorrelationId value. */ @Generated - public Double getVerifyConfidenceThreshold() { - return this.verifyConfidenceThreshold; + public String getDeviceCorrelationId() { + return this.deviceCorrelationId; } /** - * Set the verifyConfidenceThreshold property: Threshold for confidence of the face verification. + * 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 verifyConfidenceThreshold the verifyConfidenceThreshold value to set. + * @param deviceCorrelationId the deviceCorrelationId value to set. * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public CreateLivenessWithVerifySessionContent setVerifyConfidenceThreshold(Double verifyConfidenceThreshold) { - this.verifyConfidenceThreshold = verifyConfidenceThreshold; + public CreateLivenessWithVerifySessionContent setDeviceCorrelationId(String deviceCorrelationId) { + this.deviceCorrelationId = deviceCorrelationId; return this; } /** - * {@inheritDoc} + * 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 - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("livenessOperationMode", - this.livenessOperationMode == null ? null : this.livenessOperationMode.toString()); - jsonWriter.writeBooleanField("sendResultsToClient", this.sendResultsToClient); - jsonWriter.writeBooleanField("deviceCorrelationIdSetInClient", this.deviceCorrelationIdSetInClient); - jsonWriter.writeBooleanField("enableSessionImage", this.enableSessionImage); - jsonWriter.writeStringField("livenessSingleModalModel", - this.livenessSingleModalModel == null ? null : this.livenessSingleModalModel.toString()); - jsonWriter.writeStringField("deviceCorrelationId", this.deviceCorrelationId); - jsonWriter.writeNumberField("authTokenTimeToLiveInSeconds", this.authTokenTimeToLiveInSeconds); - jsonWriter.writeBooleanField("returnVerifyImageHash", this.returnVerifyImageHash); - jsonWriter.writeNumberField("verifyConfidenceThreshold", this.verifyConfidenceThreshold); - return jsonWriter.writeEndObject(); + public Integer getAuthTokenTimeToLiveInSeconds() { + return this.authTokenTimeToLiveInSeconds; } /** - * Reads an instance of CreateLivenessWithVerifySessionContent from the JsonReader. + * Set the authTokenTimeToLiveInSeconds property: Seconds the session should last for. Range is 60 to 86400 seconds. + * Default value is 600. * - * @param jsonReader The JsonReader being read. - * @return An instance of CreateLivenessWithVerifySessionContent if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CreateLivenessWithVerifySessionContent. + * @param authTokenTimeToLiveInSeconds the authTokenTimeToLiveInSeconds value to set. + * @return the CreateLivenessWithVerifySessionContent object itself. */ @Generated - public static CreateLivenessWithVerifySessionContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LivenessOperationMode livenessOperationMode = null; - Boolean sendResultsToClient = null; - Boolean deviceCorrelationIdSetInClient = null; - Boolean enableSessionImage = null; - LivenessModel livenessSingleModalModel = null; - String deviceCorrelationId = null; - Integer authTokenTimeToLiveInSeconds = null; - Boolean returnVerifyImageHash = null; - Double verifyConfidenceThreshold = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("livenessOperationMode".equals(fieldName)) { - livenessOperationMode = LivenessOperationMode.fromString(reader.getString()); - } else if ("sendResultsToClient".equals(fieldName)) { - sendResultsToClient = reader.getNullable(JsonReader::getBoolean); - } else if ("deviceCorrelationIdSetInClient".equals(fieldName)) { - deviceCorrelationIdSetInClient = reader.getNullable(JsonReader::getBoolean); - } else if ("enableSessionImage".equals(fieldName)) { - enableSessionImage = reader.getNullable(JsonReader::getBoolean); - } else if ("livenessSingleModalModel".equals(fieldName)) { - livenessSingleModalModel = LivenessModel.fromString(reader.getString()); - } else if ("deviceCorrelationId".equals(fieldName)) { - deviceCorrelationId = reader.getString(); - } else if ("authTokenTimeToLiveInSeconds".equals(fieldName)) { - authTokenTimeToLiveInSeconds = reader.getNullable(JsonReader::getInt); - } else if ("returnVerifyImageHash".equals(fieldName)) { - returnVerifyImageHash = reader.getNullable(JsonReader::getBoolean); - } else if ("verifyConfidenceThreshold".equals(fieldName)) { - verifyConfidenceThreshold = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - CreateLivenessWithVerifySessionContent deserializedCreateLivenessWithVerifySessionContent - = new CreateLivenessWithVerifySessionContent(livenessOperationMode); - deserializedCreateLivenessWithVerifySessionContent.sendResultsToClient = sendResultsToClient; - deserializedCreateLivenessWithVerifySessionContent.deviceCorrelationIdSetInClient - = deviceCorrelationIdSetInClient; - deserializedCreateLivenessWithVerifySessionContent.enableSessionImage = enableSessionImage; - deserializedCreateLivenessWithVerifySessionContent.livenessSingleModalModel = livenessSingleModalModel; - deserializedCreateLivenessWithVerifySessionContent.deviceCorrelationId = deviceCorrelationId; - deserializedCreateLivenessWithVerifySessionContent.authTokenTimeToLiveInSeconds - = authTokenTimeToLiveInSeconds; - deserializedCreateLivenessWithVerifySessionContent.returnVerifyImageHash = returnVerifyImageHash; - deserializedCreateLivenessWithVerifySessionContent.verifyConfidenceThreshold = verifyConfidenceThreshold; - return deserializedCreateLivenessWithVerifySessionContent; - }); + public CreateLivenessWithVerifySessionContent + setAuthTokenTimeToLiveInSeconds(Integer authTokenTimeToLiveInSeconds) { + this.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; + return this; } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java deleted file mode 100644 index 2dd365aefc33..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/CreateLivenessWithVerifySessionResult.java +++ /dev/null @@ -1,133 +0,0 @@ -// 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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Response of liveness session with verify creation with verify image provided. - */ -@Immutable -public final class CreateLivenessWithVerifySessionResult - implements JsonSerializable { - - /* - * 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 - 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 - private final String authToken; - - /* - * The detail of face for verification. - */ - @Generated - private LivenessWithVerifyImage verifyImage; - - /** - * Creates an instance of CreateLivenessWithVerifySessionResult class. - * - * @param sessionId the sessionId value to set. - * @param authToken the authToken value to set. - */ - @Generated - private CreateLivenessWithVerifySessionResult(String sessionId, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("sessionId", this.sessionId); - jsonWriter.writeStringField("authToken", this.authToken); - jsonWriter.writeJsonField("verifyImage", this.verifyImage); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CreateLivenessWithVerifySessionResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CreateLivenessWithVerifySessionResult if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CreateLivenessWithVerifySessionResult. - */ - @Generated - public static CreateLivenessWithVerifySessionResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String sessionId = null; - String authToken = null; - LivenessWithVerifyImage verifyImage = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("sessionId".equals(fieldName)) { - sessionId = reader.getString(); - } else if ("authToken".equals(fieldName)) { - authToken = reader.getString(); - } else if ("verifyImage".equals(fieldName)) { - verifyImage = LivenessWithVerifyImage.fromJson(reader); - } else { - reader.skipChildren(); - } - } - CreateLivenessWithVerifySessionResult deserializedCreateLivenessWithVerifySessionResult - = new CreateLivenessWithVerifySessionResult(sessionId, authToken); - deserializedCreateLivenessWithVerifySessionResult.verifyImage = verifyImage; - return deserializedCreateLivenessWithVerifySessionResult; - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectOptions.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectOptions.java old mode 100755 new mode 100644 index b54b2dbbfc71..213b3b0a2ba3 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectOptions.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/DetectOptions.java @@ -3,10 +3,10 @@ package com.azure.ai.vision.face.models; -import com.azure.core.annotation.Fluent; - import java.util.List; +import com.azure.core.annotation.Fluent; + /** * Options for detectFromUrl API. */ diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java deleted file mode 100644 index a51cf1b8789b..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/FaceSessionStatus.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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 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 - 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/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessColorDecisionTarget.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessColorDecisionTarget.java new file mode 100644 index 000000000000..312709c4bd76 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessColorDecisionTarget.java @@ -0,0 +1,82 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The target from color image used for liveness classification. + */ +@Immutable +public final class LivenessColorDecisionTarget implements JsonSerializable { + + /* + * The face region where the liveness classification was made on. + */ + @Generated + private final FaceRectangle faceRectangle; + + /** + * Creates an instance of LivenessColorDecisionTarget class. + * + * @param faceRectangle the faceRectangle value to set. + */ + @Generated + private LivenessColorDecisionTarget(FaceRectangle faceRectangle) { + this.faceRectangle = faceRectangle; + } + + /** + * 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; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("faceRectangle", this.faceRectangle); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessColorDecisionTarget from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessColorDecisionTarget if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessColorDecisionTarget. + */ + @Generated + public static LivenessColorDecisionTarget fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FaceRectangle faceRectangle = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("faceRectangle".equals(fieldName)) { + faceRectangle = FaceRectangle.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new LivenessColorDecisionTarget(faceRectangle); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessDecisionTargets.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessDecisionTargets.java new file mode 100644 index 000000000000..5ac0b20018f7 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessDecisionTargets.java @@ -0,0 +1,82 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The targets used for liveness classification. + */ +@Immutable +public final class LivenessDecisionTargets implements JsonSerializable { + + /* + * The target from color image used for liveness classification. + */ + @Generated + private final LivenessColorDecisionTarget color; + + /** + * Creates an instance of LivenessDecisionTargets class. + * + * @param color the color value to set. + */ + @Generated + private LivenessDecisionTargets(LivenessColorDecisionTarget color) { + this.color = color; + } + + /** + * Get the color property: The target from color image used for liveness classification. + * + * @return the color value. + */ + @Generated + public LivenessColorDecisionTarget getColor() { + return this.color; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("color", this.color); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessDecisionTargets from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessDecisionTargets if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessDecisionTargets. + */ + @Generated + public static LivenessDecisionTargets fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LivenessColorDecisionTarget color = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("color".equals(fieldName)) { + color = LivenessColorDecisionTarget.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new LivenessDecisionTargets(color); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessError.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessError.java new file mode 100644 index 000000000000..f36f158ad32c --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessError.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The error of the liveness classification. + */ +@Immutable +public final class LivenessError implements JsonSerializable { + + /* + * The error code. + */ + @Generated + private final String code; + + /* + * The error message. + */ + @Generated + private final String message; + + /* + * Targets used for liveness classification. + */ + @Generated + private final LivenessDecisionTargets targets; + + /** + * Creates an instance of LivenessError class. + * + * @param code the code value to set. + * @param message the message value to set. + * @param targets the targets value to set. + */ + @Generated + private LivenessError(String code, String message, LivenessDecisionTargets targets) { + this.code = code; + this.message = message; + this.targets = targets; + } + + /** + * Get the code property: The error code. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: The error message. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the targets property: Targets used for liveness classification. + * + * @return the targets value. + */ + @Generated + public LivenessDecisionTargets getTargets() { + return this.targets; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeJsonField("targets", this.targets); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessError if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessError. + */ + @Generated + public static LivenessError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + LivenessDecisionTargets targets = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("targets".equals(fieldName)) { + targets = LivenessDecisionTargets.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new LivenessError(code, message, targets); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java index 857334e3bc2b..f5c9016398cf 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessModel.java @@ -13,10 +13,10 @@ public final class LivenessModel extends ExpandableStringEnum { /** - * Static value 2022-10-15-preview.04 for LivenessModel. + * Static value 2024-11-15 for LivenessModel. */ @Generated - public static final LivenessModel V2022_10_15_PREVIEW_04 = fromString("2022-10-15-preview.04"); + public static final LivenessModel V2024_11_15 = fromString("2024-11-15"); /** * Creates a new instance of LivenessModel value. @@ -48,10 +48,4 @@ public static LivenessModel fromString(String name) { public static Collection values() { return values(LivenessModel.class); } - - /** - * Static value 2023-12-20-preview.06 for LivenessModel. - */ - @Generated - public static final LivenessModel V2023_12_20_PREVIEW_06 = fromString("2023-12-20-preview.06"); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java deleted file mode 100644 index 84aa94c55ba9..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessOutputsTarget.java +++ /dev/null @@ -1,153 +0,0 @@ -// 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.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The liveness classification for target face. - */ -@Immutable -public final class LivenessOutputsTarget implements JsonSerializable { - - /* - * The face region where the liveness classification was made on. - */ - @Generated - private final FaceRectangle faceRectangle; - - /* - * The file name which contains the face rectangle where the liveness classification was made on. - */ - @Generated - 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 - private final int timeOffsetWithinFile; - - /* - * The image type which contains the face rectangle where the liveness classification was made on. - */ - @Generated - 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 - private LivenessOutputsTarget(FaceRectangle faceRectangle, String fileName, int timeOffsetWithinFile, - 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("faceRectangle", this.faceRectangle); - jsonWriter.writeStringField("fileName", this.fileName); - jsonWriter.writeIntField("timeOffsetWithinFile", this.timeOffsetWithinFile); - jsonWriter.writeStringField("imageType", this.imageType == null ? null : this.imageType.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LivenessOutputsTarget from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LivenessOutputsTarget if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LivenessOutputsTarget. - */ - @Generated - public static LivenessOutputsTarget fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FaceRectangle faceRectangle = null; - String fileName = null; - int timeOffsetWithinFile = 0; - FaceImageType imageType = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("faceRectangle".equals(fieldName)) { - faceRectangle = FaceRectangle.fromJson(reader); - } else if ("fileName".equals(fieldName)) { - fileName = reader.getString(); - } else if ("timeOffsetWithinFile".equals(fieldName)) { - timeOffsetWithinFile = reader.getInt(); - } else if ("imageType".equals(fieldName)) { - imageType = FaceImageType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return new LivenessOutputsTarget(faceRectangle, fileName, timeOffsetWithinFile, imageType); - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java deleted file mode 100644 index 211faac83f10..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResponseBody.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * The response body of detect liveness API call. - */ -@Immutable -public final class LivenessResponseBody implements JsonSerializable { - - /* - * The liveness classification for the target face. - */ - @Generated - private FaceLivenessDecision livenessDecision; - - /* - * Specific targets used for liveness classification. - */ - @Generated - private LivenessOutputsTarget target; - - /* - * The model version used for liveness classification. - */ - @Generated - private LivenessModel modelVersionUsed; - - /* - * The face verification output. Only available when the request is liveness with verify. - */ - @Generated - private LivenessWithVerifyOutputs verifyResult; - - /* - * The response body of detect liveness API call. - */ - @Generated - 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: The response body of detect liveness API call. - * - * @return the additionalProperties value. - */ - @Generated - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("livenessDecision", - this.livenessDecision == null ? null : this.livenessDecision.toString()); - jsonWriter.writeJsonField("target", this.target); - jsonWriter.writeStringField("modelVersionUsed", - this.modelVersionUsed == null ? null : this.modelVersionUsed.toString()); - jsonWriter.writeJsonField("verifyResult", this.verifyResult); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeFieldName(additionalProperty.getKey()); - if (additionalProperty.getValue() == null) { - jsonWriter.writeNull(); - } else { - additionalProperty.getValue().writeTo(jsonWriter); - } - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LivenessResponseBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LivenessResponseBody if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the LivenessResponseBody. - */ - @Generated - public static LivenessResponseBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LivenessResponseBody deserializedLivenessResponseBody = new LivenessResponseBody(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("livenessDecision".equals(fieldName)) { - deserializedLivenessResponseBody.livenessDecision - = FaceLivenessDecision.fromString(reader.getString()); - } else if ("target".equals(fieldName)) { - deserializedLivenessResponseBody.target = LivenessOutputsTarget.fromJson(reader); - } else if ("modelVersionUsed".equals(fieldName)) { - deserializedLivenessResponseBody.modelVersionUsed = LivenessModel.fromString(reader.getString()); - } else if ("verifyResult".equals(fieldName)) { - deserializedLivenessResponseBody.verifyResult = LivenessWithVerifyOutputs.fromJson(reader); - } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - additionalProperties.put(fieldName, - reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); - } - } - deserializedLivenessResponseBody.additionalProperties = additionalProperties; - return deserializedLivenessResponseBody; - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResult.java new file mode 100644 index 000000000000..a97a35d5c9c1 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessResult.java @@ -0,0 +1,154 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The results of the liveness classification. + */ +@Immutable +public final class LivenessResult implements JsonSerializable { + + /* + * The liveness classification for the target face. + */ + @Generated + private FaceLivenessDecision livenessDecision; + + /* + * Targets used for liveness classification. + */ + @Generated + private final LivenessDecisionTargets targets; + + /* + * 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 + private final String digest; + + /* + * The image ID of the session request. + */ + @Generated + private String sessionImageId; + + /** + * Creates an instance of LivenessResult class. + * + * @param targets the targets value to set. + * @param digest the digest value to set. + */ + @Generated + private LivenessResult(LivenessDecisionTargets targets, String digest) { + this.targets = targets; + this.digest = digest; + } + + /** + * Get the livenessDecision property: The liveness classification for the target face. + * + * @return the livenessDecision value. + */ + @Generated + public FaceLivenessDecision getLivenessDecision() { + return this.livenessDecision; + } + + /** + * Get the targets property: Targets used for liveness classification. + * + * @return the targets value. + */ + @Generated + public LivenessDecisionTargets getTargets() { + return this.targets; + } + + /** + * 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; + } + + /** + * Get the sessionImageId property: The image ID of the session request. + * + * @return the sessionImageId value. + */ + @Generated + public String getSessionImageId() { + return this.sessionImageId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("targets", this.targets); + jsonWriter.writeStringField("digest", this.digest); + jsonWriter.writeStringField("livenessDecision", + this.livenessDecision == null ? null : this.livenessDecision.toString()); + jsonWriter.writeStringField("sessionImageId", this.sessionImageId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessResult. + */ + @Generated + public static LivenessResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LivenessDecisionTargets targets = null; + String digest = null; + FaceLivenessDecision livenessDecision = null; + String sessionImageId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("targets".equals(fieldName)) { + targets = LivenessDecisionTargets.fromJson(reader); + } else if ("digest".equals(fieldName)) { + digest = reader.getString(); + } else if ("livenessDecision".equals(fieldName)) { + livenessDecision = FaceLivenessDecision.fromString(reader.getString()); + } else if ("sessionImageId".equals(fieldName)) { + sessionImageId = reader.getString(); + } else { + reader.skipChildren(); + } + } + LivenessResult deserializedLivenessResult = new LivenessResult(targets, digest); + deserializedLivenessResult.livenessDecision = livenessDecision; + deserializedLivenessResult.sessionImageId = sessionImageId; + return deserializedLivenessResult; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java index 79f5a40e7a43..858c16703217 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSession.java @@ -5,14 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; /** * Session result of detect liveness. @@ -24,146 +21,99 @@ public final class LivenessSession implements JsonSerializable * The unique ID to reference this session. */ @Generated - private String id; + private String sessionId; /* - * DateTime when this session was created. + * 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 - private final OffsetDateTime createdDateTime; + private final String authToken; /* - * DateTime when this session was started by the client. - */ - @Generated - private OffsetDateTime sessionStartDateTime; - - /* - * Whether or not the session is expired. - */ - @Generated - 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 - private String deviceCorrelationId; - - /* - * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. + * The current status of the session. */ @Generated - private Integer authTokenTimeToLiveInSeconds; + private final OperationState status; /* - * The current status of the session. + * The model version used for liveness classification. This is an optional parameter, and if this is not specified, + * then the latest supported model version will be chosen */ @Generated - private final FaceSessionStatus status; + private LivenessModel modelVersion; /* - * The latest session audit result only populated if status == 'ResultAvailable'. + * The results of the liveness session. */ @Generated - private LivenessSessionAuditEntry result; + private final LivenessSessionResults results; /** * Creates an instance of LivenessSession class. * - * @param createdDateTime the createdDateTime value to set. - * @param sessionExpired the sessionExpired value to set. + * @param authToken the authToken value to set. * @param status the status value to set. + * @param results the results value to set. */ @Generated - private LivenessSession(OffsetDateTime createdDateTime, boolean sessionExpired, FaceSessionStatus status) { - this.createdDateTime = createdDateTime; - this.sessionExpired = sessionExpired; + private LivenessSession(String authToken, OperationState status, LivenessSessionResults results) { + this.authToken = authToken; this.status = status; + this.results = results; } /** - * 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. + * Get the sessionId property: The unique ID to reference this session. * - * @return the sessionStartDateTime value. + * @return the sessionId value. */ @Generated - public OffsetDateTime getSessionStartDateTime() { - return this.sessionStartDateTime; + public String getSessionId() { + return this.sessionId; } /** - * Get the sessionExpired property: Whether or not the session is expired. + * 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 sessionExpired value. + * @return the authToken value. */ @Generated - public boolean isSessionExpired() { - return this.sessionExpired; + public String getAuthToken() { + return this.authToken; } /** - * 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. + * Get the status property: The current status of the session. * - * @return the authTokenTimeToLiveInSeconds value. + * @return the status value. */ @Generated - public Integer getAuthTokenTimeToLiveInSeconds() { - return this.authTokenTimeToLiveInSeconds; + public OperationState getStatus() { + return this.status; } /** - * Get the status property: The current status of the session. + * Get the modelVersion property: The model version used for liveness classification. This is an optional parameter, + * and if this is not specified, then the latest supported model version will be chosen. * - * @return the status value. + * @return the modelVersion value. */ @Generated - public FaceSessionStatus getStatus() { - return this.status; + public LivenessModel getModelVersion() { + return this.modelVersion; } /** - * Get the result property: The latest session audit result only populated if status == 'ResultAvailable'. + * Get the results property: The results of the liveness session. * - * @return the result value. + * @return the results value. */ @Generated - public LivenessSessionAuditEntry getResult() { - return this.result; + public LivenessSessionResults getResults() { + return this.results; } /** @@ -173,17 +123,10 @@ public LivenessSessionAuditEntry getResult() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("createdDateTime", - this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); - jsonWriter.writeBooleanField("sessionExpired", this.sessionExpired); + jsonWriter.writeStringField("authToken", this.authToken); jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("sessionStartDateTime", - this.sessionStartDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sessionStartDateTime)); - jsonWriter.writeStringField("deviceCorrelationId", this.deviceCorrelationId); - jsonWriter.writeNumberField("authTokenTimeToLiveInSeconds", this.authTokenTimeToLiveInSeconds); - jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeJsonField("results", this.results); + jsonWriter.writeStringField("modelVersion", this.modelVersion == null ? null : this.modelVersion.toString()); return jsonWriter.writeEndObject(); } @@ -199,45 +142,31 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static LivenessSession fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String id = null; - OffsetDateTime createdDateTime = null; - boolean sessionExpired = false; - FaceSessionStatus status = null; - OffsetDateTime sessionStartDateTime = null; - String deviceCorrelationId = null; - Integer authTokenTimeToLiveInSeconds = null; - LivenessSessionAuditEntry result = null; + String sessionId = null; + String authToken = null; + OperationState status = null; + LivenessSessionResults results = null; + LivenessModel modelVersion = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("createdDateTime".equals(fieldName)) { - createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("sessionExpired".equals(fieldName)) { - sessionExpired = reader.getBoolean(); + if ("sessionId".equals(fieldName)) { + sessionId = reader.getString(); + } else if ("authToken".equals(fieldName)) { + authToken = reader.getString(); } else if ("status".equals(fieldName)) { - status = FaceSessionStatus.fromString(reader.getString()); - } else if ("sessionStartDateTime".equals(fieldName)) { - sessionStartDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("deviceCorrelationId".equals(fieldName)) { - deviceCorrelationId = reader.getString(); - } else if ("authTokenTimeToLiveInSeconds".equals(fieldName)) { - authTokenTimeToLiveInSeconds = reader.getNullable(JsonReader::getInt); - } else if ("result".equals(fieldName)) { - result = LivenessSessionAuditEntry.fromJson(reader); + status = OperationState.fromString(reader.getString()); + } else if ("results".equals(fieldName)) { + results = LivenessSessionResults.fromJson(reader); + } else if ("modelVersion".equals(fieldName)) { + modelVersion = LivenessModel.fromString(reader.getString()); } else { reader.skipChildren(); } } - LivenessSession deserializedLivenessSession = new LivenessSession(createdDateTime, sessionExpired, status); - deserializedLivenessSession.id = id; - deserializedLivenessSession.sessionStartDateTime = sessionStartDateTime; - deserializedLivenessSession.deviceCorrelationId = deviceCorrelationId; - deserializedLivenessSession.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - deserializedLivenessSession.result = result; + LivenessSession deserializedLivenessSession = new LivenessSession(authToken, status, results); + deserializedLivenessSession.sessionId = sessionId; + deserializedLivenessSession.modelVersion = modelVersion; return deserializedLivenessSession; }); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAttempt.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAttempt.java new file mode 100644 index 000000000000..a3bbc19574c9 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAttempt.java @@ -0,0 +1,148 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The liveness session attempt. + */ +@Immutable +public final class LivenessSessionAttempt implements JsonSerializable { + + /* + * The attempt ID, start from 1. + */ + @Generated + private final int attemptId; + + /* + * The status of the attempt. + */ + @Generated + private final OperationState attemptStatus; + + /* + * The result of the liveness call, will be null if there is error. + */ + @Generated + private LivenessResult result; + + /* + * The error of the liveness call, will be null if there is result. + */ + @Generated + private LivenessError error; + + /** + * Creates an instance of LivenessSessionAttempt class. + * + * @param attemptId the attemptId value to set. + * @param attemptStatus the attemptStatus value to set. + */ + @Generated + private LivenessSessionAttempt(int attemptId, OperationState attemptStatus) { + this.attemptId = attemptId; + this.attemptStatus = attemptStatus; + } + + /** + * Get the attemptId property: The attempt ID, start from 1. + * + * @return the attemptId value. + */ + @Generated + public int getAttemptId() { + return this.attemptId; + } + + /** + * Get the attemptStatus property: The status of the attempt. + * + * @return the attemptStatus value. + */ + @Generated + public OperationState getAttemptStatus() { + return this.attemptStatus; + } + + /** + * Get the result property: The result of the liveness call, will be null if there is error. + * + * @return the result value. + */ + @Generated + public LivenessResult getResult() { + return this.result; + } + + /** + * Get the error property: The error of the liveness call, will be null if there is result. + * + * @return the error value. + */ + @Generated + public LivenessError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("attemptId", this.attemptId); + jsonWriter.writeStringField("attemptStatus", this.attemptStatus == null ? null : this.attemptStatus.toString()); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessSessionAttempt from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessSessionAttempt if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessSessionAttempt. + */ + @Generated + public static LivenessSessionAttempt fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int attemptId = 0; + OperationState attemptStatus = null; + LivenessResult result = null; + LivenessError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("attemptId".equals(fieldName)) { + attemptId = reader.getInt(); + } else if ("attemptStatus".equals(fieldName)) { + attemptStatus = OperationState.fromString(reader.getString()); + } else if ("result".equals(fieldName)) { + result = LivenessResult.fromJson(reader); + } else if ("error".equals(fieldName)) { + error = LivenessError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + LivenessSessionAttempt deserializedLivenessSessionAttempt + = new LivenessSessionAttempt(attemptId, attemptStatus); + deserializedLivenessSessionAttempt.result = result; + deserializedLivenessSessionAttempt.error = error; + return deserializedLivenessSessionAttempt; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java deleted file mode 100644 index da128ec2a44f..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionAuditEntry.java +++ /dev/null @@ -1,300 +0,0 @@ -// 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.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Audit entry for a request in session. - */ -@Immutable -public final class LivenessSessionAuditEntry implements JsonSerializable { - - /* - * 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 - 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 - private final String sessionId; - - /* - * The unique requestId that is returned by the service to the client in the 'apim-request-id' header. - */ - @Generated - private final String requestId; - - /* - * The unique clientRequestId that is sent by the client in the 'client-request-id' header. - */ - @Generated - private final String clientRequestId; - - /* - * The UTC DateTime that the request was received. - */ - @Generated - private final OffsetDateTime receivedDateTime; - - /* - * The request of this entry. - */ - @Generated - private final AuditRequestInfo request; - - /* - * The response of this entry. - */ - @Generated - 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 - 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 - private LivenessSessionAuditEntry(long id, String sessionId, String requestId, String clientRequestId, - OffsetDateTime receivedDateTime, AuditRequestInfo request, AuditLivenessResponseInfo response, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("id", this.id); - jsonWriter.writeStringField("sessionId", this.sessionId); - jsonWriter.writeStringField("requestId", this.requestId); - jsonWriter.writeStringField("clientRequestId", this.clientRequestId); - jsonWriter.writeStringField("receivedDateTime", - this.receivedDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.receivedDateTime)); - jsonWriter.writeJsonField("request", this.request); - jsonWriter.writeJsonField("response", this.response); - jsonWriter.writeStringField("digest", this.digest); - jsonWriter.writeStringField("sessionImageId", this.sessionImageId); - jsonWriter.writeStringField("verifyImageHash", this.verifyImageHash); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LivenessSessionAuditEntry from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LivenessSessionAuditEntry if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LivenessSessionAuditEntry. - */ - @Generated - public static LivenessSessionAuditEntry fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long id = 0L; - String sessionId = null; - String requestId = null; - String clientRequestId = null; - OffsetDateTime receivedDateTime = null; - AuditRequestInfo request = null; - AuditLivenessResponseInfo response = null; - String digest = null; - String sessionImageId = null; - String verifyImageHash = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getLong(); - } else if ("sessionId".equals(fieldName)) { - sessionId = reader.getString(); - } else if ("requestId".equals(fieldName)) { - requestId = reader.getString(); - } else if ("clientRequestId".equals(fieldName)) { - clientRequestId = reader.getString(); - } else if ("receivedDateTime".equals(fieldName)) { - receivedDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("request".equals(fieldName)) { - request = AuditRequestInfo.fromJson(reader); - } else if ("response".equals(fieldName)) { - response = AuditLivenessResponseInfo.fromJson(reader); - } else if ("digest".equals(fieldName)) { - digest = reader.getString(); - } else if ("sessionImageId".equals(fieldName)) { - sessionImageId = reader.getString(); - } else if ("verifyImageHash".equals(fieldName)) { - verifyImageHash = reader.getString(); - } else { - reader.skipChildren(); - } - } - LivenessSessionAuditEntry deserializedLivenessSessionAuditEntry = new LivenessSessionAuditEntry(id, - sessionId, requestId, clientRequestId, receivedDateTime, request, response, digest); - deserializedLivenessSessionAuditEntry.sessionImageId = sessionImageId; - deserializedLivenessSessionAuditEntry.verifyImageHash = verifyImageHash; - return deserializedLivenessSessionAuditEntry; - }); - } - - /* - * The image ID of the session request. - */ - @Generated - private String sessionImageId; - - /* - * The sha256 hash of the verify-image in the request. - */ - @Generated - private String verifyImageHash; - - /** - * Get the sessionImageId property: The image ID of the session request. - * - * @return the sessionImageId value. - */ - @Generated - public String getSessionImageId() { - return this.sessionImageId; - } - - /** - * Get the verifyImageHash property: The sha256 hash of the verify-image in the request. - * - * @return the verifyImageHash value. - */ - @Generated - public String getVerifyImageHash() { - return this.verifyImageHash; - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java deleted file mode 100644 index e66463f0ca51..000000000000 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionItem.java +++ /dev/null @@ -1,202 +0,0 @@ -// 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.azure.core.util.CoreUtils; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Session data returned for enumeration. - */ -@Immutable -public final class LivenessSessionItem implements JsonSerializable { - - /* - * The unique ID to reference this session. - */ - @Generated - private String id; - - /* - * DateTime when this session was created. - */ - @Generated - private final OffsetDateTime createdDateTime; - - /* - * DateTime when this session was started by the client. - */ - @Generated - private OffsetDateTime sessionStartDateTime; - - /* - * Whether or not the session is expired. - */ - @Generated - 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 - private String deviceCorrelationId; - - /* - * Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600. - */ - @Generated - private Integer authTokenTimeToLiveInSeconds; - - /** - * Creates an instance of LivenessSessionItem class. - * - * @param createdDateTime the createdDateTime value to set. - * @param sessionExpired the sessionExpired value to set. - */ - @Generated - private LivenessSessionItem(OffsetDateTime createdDateTime, 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; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("createdDateTime", - this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); - jsonWriter.writeBooleanField("sessionExpired", this.sessionExpired); - jsonWriter.writeStringField("sessionStartDateTime", - this.sessionStartDateTime == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.sessionStartDateTime)); - jsonWriter.writeStringField("deviceCorrelationId", this.deviceCorrelationId); - jsonWriter.writeNumberField("authTokenTimeToLiveInSeconds", this.authTokenTimeToLiveInSeconds); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LivenessSessionItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LivenessSessionItem if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LivenessSessionItem. - */ - @Generated - public static LivenessSessionItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - OffsetDateTime createdDateTime = null; - boolean sessionExpired = false; - OffsetDateTime sessionStartDateTime = null; - String deviceCorrelationId = null; - Integer authTokenTimeToLiveInSeconds = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("createdDateTime".equals(fieldName)) { - createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("sessionExpired".equals(fieldName)) { - sessionExpired = reader.getBoolean(); - } else if ("sessionStartDateTime".equals(fieldName)) { - sessionStartDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("deviceCorrelationId".equals(fieldName)) { - deviceCorrelationId = reader.getString(); - } else if ("authTokenTimeToLiveInSeconds".equals(fieldName)) { - authTokenTimeToLiveInSeconds = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - LivenessSessionItem deserializedLivenessSessionItem - = new LivenessSessionItem(createdDateTime, sessionExpired); - deserializedLivenessSessionItem.id = id; - deserializedLivenessSessionItem.sessionStartDateTime = sessionStartDateTime; - deserializedLivenessSessionItem.deviceCorrelationId = deviceCorrelationId; - deserializedLivenessSessionItem.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - return deserializedLivenessSessionItem; - }); - } -} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionResults.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionResults.java new file mode 100644 index 000000000000..be454296c88c --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessSessionResults.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The results of the liveness session. + */ +@Immutable +public final class LivenessSessionResults implements JsonSerializable { + + /* + * The attempts data of underlying liveness call with the session. + */ + @Generated + private final List attempts; + + /** + * Creates an instance of LivenessSessionResults class. + * + * @param attempts the attempts value to set. + */ + @Generated + private LivenessSessionResults(List attempts) { + this.attempts = attempts; + } + + /** + * Get the attempts property: The attempts data of underlying liveness call with the session. + * + * @return the attempts value. + */ + @Generated + public List getAttempts() { + return this.attempts; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("attempts", this.attempts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessSessionResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessSessionResults if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessSessionResults. + */ + @Generated + public static LivenessSessionResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List attempts = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("attempts".equals(fieldName)) { + attempts = reader.readArray(reader1 -> LivenessSessionAttempt.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new LivenessSessionResults(attempts); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java index 155cd96c2565..69344214dc31 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyOutputs.java @@ -17,12 +17,6 @@ @Immutable public final class LivenessWithVerifyOutputs implements JsonSerializable { - /* - * The detail of face for verification. - */ - @Generated - private final LivenessWithVerifyImage verifyImage; - /* * The target face liveness face and comparison image face verification confidence. */ @@ -38,28 +32,15 @@ public final class LivenessWithVerifyOutputs implements JsonSerializable { - LivenessWithVerifyImage verifyImage = null; double matchConfidence = 0.0; boolean isIdentical = false; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("verifyImage".equals(fieldName)) { - verifyImage = LivenessWithVerifyImage.fromJson(reader); - } else if ("matchConfidence".equals(fieldName)) { + if ("matchConfidence".equals(fieldName)) { matchConfidence = reader.getDouble(); } else if ("isIdentical".equals(fieldName)) { isIdentical = reader.getBoolean(); @@ -122,7 +99,7 @@ public static LivenessWithVerifyOutputs fromJson(JsonReader jsonReader) throws I reader.skipChildren(); } } - return new LivenessWithVerifyOutputs(verifyImage, matchConfidence, isIdentical); + return new LivenessWithVerifyOutputs(matchConfidence, isIdentical); }); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyReference.java similarity index 63% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyReference.java index 4784c4932add..d685c8423b3c 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyImage.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyReference.java @@ -15,7 +15,13 @@ * The detail of face for verification. */ @Immutable -public final class LivenessWithVerifyImage implements JsonSerializable { +public final class LivenessWithVerifyReference implements JsonSerializable { + + /* + * The image type which contains the face rectangle where the liveness classification was made on. + */ + @Generated + private final FaceImageType referenceType; /* * The face region where the comparison image's classification was made. @@ -30,17 +36,31 @@ public final class LivenessWithVerifyImage implements JsonSerializable { + FaceImageType referenceType = null; FaceRectangle faceRectangle = null; QualityForRecognition qualityForRecognition = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("faceRectangle".equals(fieldName)) { + if ("referenceType".equals(fieldName)) { + referenceType = FaceImageType.fromString(reader.getString()); + } else if ("faceRectangle".equals(fieldName)) { faceRectangle = FaceRectangle.fromJson(reader); } else if ("qualityForRecognition".equals(fieldName)) { qualityForRecognition = QualityForRecognition.fromString(reader.getString()); @@ -99,7 +123,7 @@ public static LivenessWithVerifyImage fromJson(JsonReader jsonReader) throws IOE reader.skipChildren(); } } - return new LivenessWithVerifyImage(faceRectangle, qualityForRecognition); + return new LivenessWithVerifyReference(referenceType, faceRectangle, qualityForRecognition); }); } } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyResult.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyResult.java new file mode 100644 index 000000000000..297ba0e90424 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifyResult.java @@ -0,0 +1,198 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The results of the liveness with verify call. + */ +@Immutable +public final class LivenessWithVerifyResult implements JsonSerializable { + + /* + * The liveness classification for the target face. + */ + @Generated + private FaceLivenessDecision livenessDecision; + + /* + * Targets used for liveness classification. + */ + @Generated + private final LivenessDecisionTargets targets; + + /* + * 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 + private final String digest; + + /* + * The image ID of the session request. + */ + @Generated + private String sessionImageId; + + /* + * The face verification output. Only available when the request is liveness with verify. + */ + @Generated + private LivenessWithVerifyOutputs verifyResult; + + /* + * The sha256 hash of the verify-image in the request. + */ + @Generated + private String verifyImageHash; + + /** + * Creates an instance of LivenessWithVerifyResult class. + * + * @param targets the targets value to set. + * @param digest the digest value to set. + */ + @Generated + private LivenessWithVerifyResult(LivenessDecisionTargets targets, String digest) { + this.targets = targets; + this.digest = digest; + } + + /** + * Get the livenessDecision property: The liveness classification for the target face. + * + * @return the livenessDecision value. + */ + @Generated + public FaceLivenessDecision getLivenessDecision() { + return this.livenessDecision; + } + + /** + * Get the targets property: Targets used for liveness classification. + * + * @return the targets value. + */ + @Generated + public LivenessDecisionTargets getTargets() { + return this.targets; + } + + /** + * 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; + } + + /** + * Get the sessionImageId property: The image ID of the session request. + * + * @return the sessionImageId value. + */ + @Generated + public String getSessionImageId() { + return this.sessionImageId; + } + + /** + * 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 verifyImageHash property: The sha256 hash of the verify-image in the request. + * + * @return the verifyImageHash value. + */ + @Generated + public String getVerifyImageHash() { + return this.verifyImageHash; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("targets", this.targets); + jsonWriter.writeStringField("digest", this.digest); + jsonWriter.writeStringField("livenessDecision", + this.livenessDecision == null ? null : this.livenessDecision.toString()); + jsonWriter.writeStringField("sessionImageId", this.sessionImageId); + jsonWriter.writeJsonField("verifyResult", this.verifyResult); + jsonWriter.writeStringField("verifyImageHash", this.verifyImageHash); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessWithVerifyResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessWithVerifyResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessWithVerifyResult. + */ + @Generated + public static LivenessWithVerifyResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LivenessDecisionTargets targets = null; + String digest = null; + FaceLivenessDecision livenessDecision = null; + String sessionImageId = null; + LivenessWithVerifyOutputs verifyResult = null; + String verifyImageHash = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("targets".equals(fieldName)) { + targets = LivenessDecisionTargets.fromJson(reader); + } else if ("digest".equals(fieldName)) { + digest = reader.getString(); + } else if ("livenessDecision".equals(fieldName)) { + livenessDecision = FaceLivenessDecision.fromString(reader.getString()); + } else if ("sessionImageId".equals(fieldName)) { + sessionImageId = reader.getString(); + } else if ("verifyResult".equals(fieldName)) { + verifyResult = LivenessWithVerifyOutputs.fromJson(reader); + } else if ("verifyImageHash".equals(fieldName)) { + verifyImageHash = reader.getString(); + } else { + reader.skipChildren(); + } + } + LivenessWithVerifyResult deserializedLivenessWithVerifyResult + = new LivenessWithVerifyResult(targets, digest); + deserializedLivenessWithVerifyResult.livenessDecision = livenessDecision; + deserializedLivenessWithVerifyResult.sessionImageId = sessionImageId; + deserializedLivenessWithVerifyResult.verifyResult = verifyResult; + deserializedLivenessWithVerifyResult.verifyImageHash = verifyImageHash; + return deserializedLivenessWithVerifyResult; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java index e4f177a95cf8..1792173d562e 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySession.java @@ -5,14 +5,11 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; /** * Session result of detect liveness with verify. @@ -24,147 +21,100 @@ public final class LivenessWithVerifySession implements JsonSerializable { - String id = null; - OffsetDateTime createdDateTime = null; - boolean sessionExpired = false; - FaceSessionStatus status = null; - OffsetDateTime sessionStartDateTime = null; - String deviceCorrelationId = null; - Integer authTokenTimeToLiveInSeconds = null; - LivenessSessionAuditEntry result = null; + String sessionId = null; + String authToken = null; + OperationState status = null; + LivenessWithVerifySessionResults results = null; + LivenessModel modelVersion = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("createdDateTime".equals(fieldName)) { - createdDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("sessionExpired".equals(fieldName)) { - sessionExpired = reader.getBoolean(); + if ("sessionId".equals(fieldName)) { + sessionId = reader.getString(); + } else if ("authToken".equals(fieldName)) { + authToken = reader.getString(); } else if ("status".equals(fieldName)) { - status = FaceSessionStatus.fromString(reader.getString()); - } else if ("sessionStartDateTime".equals(fieldName)) { - sessionStartDateTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("deviceCorrelationId".equals(fieldName)) { - deviceCorrelationId = reader.getString(); - } else if ("authTokenTimeToLiveInSeconds".equals(fieldName)) { - authTokenTimeToLiveInSeconds = reader.getNullable(JsonReader::getInt); - } else if ("result".equals(fieldName)) { - result = LivenessSessionAuditEntry.fromJson(reader); + status = OperationState.fromString(reader.getString()); + } else if ("results".equals(fieldName)) { + results = LivenessWithVerifySessionResults.fromJson(reader); + } else if ("modelVersion".equals(fieldName)) { + modelVersion = LivenessModel.fromString(reader.getString()); } else { reader.skipChildren(); } } LivenessWithVerifySession deserializedLivenessWithVerifySession - = new LivenessWithVerifySession(createdDateTime, sessionExpired, status); - deserializedLivenessWithVerifySession.id = id; - deserializedLivenessWithVerifySession.sessionStartDateTime = sessionStartDateTime; - deserializedLivenessWithVerifySession.deviceCorrelationId = deviceCorrelationId; - deserializedLivenessWithVerifySession.authTokenTimeToLiveInSeconds = authTokenTimeToLiveInSeconds; - deserializedLivenessWithVerifySession.result = result; + = new LivenessWithVerifySession(authToken, status, results); + deserializedLivenessWithVerifySession.sessionId = sessionId; + deserializedLivenessWithVerifySession.modelVersion = modelVersion; return deserializedLivenessWithVerifySession; }); } diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionAttempt.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionAttempt.java new file mode 100644 index 000000000000..563a172a9743 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionAttempt.java @@ -0,0 +1,148 @@ +// 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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The liveness with verify session attempt. + */ +@Immutable +public final class LivenessWithVerifySessionAttempt implements JsonSerializable { + + /* + * The attempt ID, start from 1. + */ + @Generated + private final int attemptId; + + /* + * The status of the attempt. + */ + @Generated + private final OperationState attemptStatus; + + /* + * The result of the liveness with verify call, will be null if there is error. + */ + @Generated + private LivenessWithVerifyResult result; + + /* + * The error of the liveness with verify call, will be null if there is result. + */ + @Generated + private LivenessError error; + + /** + * Creates an instance of LivenessWithVerifySessionAttempt class. + * + * @param attemptId the attemptId value to set. + * @param attemptStatus the attemptStatus value to set. + */ + @Generated + private LivenessWithVerifySessionAttempt(int attemptId, OperationState attemptStatus) { + this.attemptId = attemptId; + this.attemptStatus = attemptStatus; + } + + /** + * Get the attemptId property: The attempt ID, start from 1. + * + * @return the attemptId value. + */ + @Generated + public int getAttemptId() { + return this.attemptId; + } + + /** + * Get the attemptStatus property: The status of the attempt. + * + * @return the attemptStatus value. + */ + @Generated + public OperationState getAttemptStatus() { + return this.attemptStatus; + } + + /** + * Get the result property: The result of the liveness with verify call, will be null if there is error. + * + * @return the result value. + */ + @Generated + public LivenessWithVerifyResult getResult() { + return this.result; + } + + /** + * Get the error property: The error of the liveness with verify call, will be null if there is result. + * + * @return the error value. + */ + @Generated + public LivenessError getError() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("attemptId", this.attemptId); + jsonWriter.writeStringField("attemptStatus", this.attemptStatus == null ? null : this.attemptStatus.toString()); + jsonWriter.writeJsonField("result", this.result); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessWithVerifySessionAttempt from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessWithVerifySessionAttempt if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessWithVerifySessionAttempt. + */ + @Generated + public static LivenessWithVerifySessionAttempt fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int attemptId = 0; + OperationState attemptStatus = null; + LivenessWithVerifyResult result = null; + LivenessError error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("attemptId".equals(fieldName)) { + attemptId = reader.getInt(); + } else if ("attemptStatus".equals(fieldName)) { + attemptStatus = OperationState.fromString(reader.getString()); + } else if ("result".equals(fieldName)) { + result = LivenessWithVerifyResult.fromJson(reader); + } else if ("error".equals(fieldName)) { + error = LivenessError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + LivenessWithVerifySessionAttempt deserializedLivenessWithVerifySessionAttempt + = new LivenessWithVerifySessionAttempt(attemptId, attemptStatus); + deserializedLivenessWithVerifySessionAttempt.result = result; + deserializedLivenessWithVerifySessionAttempt.error = error; + return deserializedLivenessWithVerifySessionAttempt; + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionResults.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionResults.java new file mode 100644 index 000000000000..d4605cb7fae1 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/LivenessWithVerifySessionResults.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.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The results of the liveness with verify session. + */ +@Immutable +public final class LivenessWithVerifySessionResults implements JsonSerializable { + + /* + * The references used for face verification. + */ + @Generated + private final List verifyReferences; + + /* + * The attempts data of underlying liveness with verify call with the session. + */ + @Generated + private final List attempts; + + /** + * Creates an instance of LivenessWithVerifySessionResults class. + * + * @param verifyReferences the verifyReferences value to set. + * @param attempts the attempts value to set. + */ + @Generated + private LivenessWithVerifySessionResults(List verifyReferences, + List attempts) { + this.verifyReferences = verifyReferences; + this.attempts = attempts; + } + + /** + * Get the verifyReferences property: The references used for face verification. + * + * @return the verifyReferences value. + */ + @Generated + public List getVerifyReferences() { + return this.verifyReferences; + } + + /** + * Get the attempts property: The attempts data of underlying liveness with verify call with the session. + * + * @return the attempts value. + */ + @Generated + public List getAttempts() { + return this.attempts; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("verifyReferences", this.verifyReferences, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("attempts", this.attempts, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LivenessWithVerifySessionResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LivenessWithVerifySessionResults if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LivenessWithVerifySessionResults. + */ + @Generated + public static LivenessWithVerifySessionResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List verifyReferences = null; + List attempts = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("verifyReferences".equals(fieldName)) { + verifyReferences = reader.readArray(reader1 -> LivenessWithVerifyReference.fromJson(reader1)); + } else if ("attempts".equals(fieldName)) { + attempts = reader.readArray(reader1 -> LivenessWithVerifySessionAttempt.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new LivenessWithVerifySessionResults(verifyReferences, attempts); + }); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OperationState.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OperationState.java new file mode 100644 index 000000000000..0a727d445711 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/OperationState.java @@ -0,0 +1,75 @@ +// 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 java.util.Collection; + +/** + * Enum describing allowed operation states. + */ +public final class OperationState extends ExpandableStringEnum { + + /** + * The operation has not started. + */ + @Generated + public static final OperationState NOT_STARTED = fromString("NotStarted"); + + /** + * The operation is in progress. + */ + @Generated + public static final OperationState RUNNING = fromString("Running"); + + /** + * The operation has completed successfully. + */ + @Generated + public static final OperationState SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + @Generated + public static final OperationState FAILED = fromString("Failed"); + + /** + * The operation has been canceled by the user. + */ + @Generated + public static final OperationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of OperationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationState() { + } + + /** + * Creates or finds a OperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationState. + */ + @Generated + public static OperationState fromString(String name) { + return fromString(name, OperationState.class); + } + + /** + * Gets known OperationState values. + * + * @return known OperationState values. + */ + @Generated + public static Collection values() { + return values(OperationState.class); + } +} diff --git a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/VerifyImageFileDetails.java similarity index 93% rename from sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java rename to sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/VerifyImageFileDetails.java index f835fa2184f6..a2cae9df3932 100644 --- a/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/implementation/models/VerifyImageFileDetails.java +++ b/sdk/face/azure-ai-vision-face/src/main/java/com/azure/ai/vision/face/models/VerifyImageFileDetails.java @@ -1,14 +1,14 @@ // 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; +package com.azure.ai.vision.face.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. + * The file details for the "verifyImage" field. */ @Fluent public final class VerifyImageFileDetails { @@ -22,7 +22,8 @@ public final class VerifyImageFileDetails { /* * The filename of the file. */ - private String filename = "verify-image"; + @Generated + private String filename; /* * The content-type of the file. diff --git a/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json index 533f46100fcc..9472c50c2bcd 100644 --- a/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json +++ b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_apiview_properties.json @@ -41,26 +41,16 @@ "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.detectFromSessionImage": "ClientCustomizations.FaceSessionClient.detectFromSessionImage", "com.azure.ai.vision.face.FaceSessionAsyncClient.detectFromSessionImageWithResponse": "ClientCustomizations.FaceSessionClient.detectFromSessionImage", - "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.FaceSessionAsyncClient.getSessionImage": "ClientCustomizations.FaceSessionClient.getSessionImage", "com.azure.ai.vision.face.FaceSessionAsyncClient.getSessionImageWithResponse": "ClientCustomizations.FaceSessionClient.getSessionImage", "com.azure.ai.vision.face.FaceSessionClient": "ClientCustomizations.FaceSessionClient", @@ -68,29 +58,21 @@ "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.detectFromSessionImage": "ClientCustomizations.FaceSessionClient.detectFromSessionImage", "com.azure.ai.vision.face.FaceSessionClient.detectFromSessionImageWithResponse": "ClientCustomizations.FaceSessionClient.detectFromSessionImage", - "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.FaceSessionClient.getSessionImage": "ClientCustomizations.FaceSessionClient.getSessionImage", "com.azure.ai.vision.face.FaceSessionClient.getSessionImageWithResponse": "ClientCustomizations.FaceSessionClient.getSessionImage", "com.azure.ai.vision.face.FaceSessionClientBuilder": "ClientCustomizations.FaceSessionClient", + "com.azure.ai.vision.face.administration.FaceAdministrationAsyncClient": "ClientCustomizations.FaceAdministrationClient", + "com.azure.ai.vision.face.administration.FaceAdministrationClient": "ClientCustomizations.FaceAdministrationClient", "com.azure.ai.vision.face.administration.FaceAdministrationClientBuilder": "ClientCustomizations.FaceAdministrationClient", "com.azure.ai.vision.face.administration.LargeFaceListAsyncClient": "ClientCustomizations.FaceAdministrationClient.LargeFaceList", "com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.addFaceFromUrlImpl": "ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl", @@ -216,9 +198,8 @@ "com.azure.ai.vision.face.administration.LargePersonGroupClient.updatePerson": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", "com.azure.ai.vision.face.administration.LargePersonGroupClient.updatePersonWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson", "com.azure.ai.vision.face.administration.LargePersonGroupClient.updateWithResponse": "ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update", - "com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest": "ClientCustomizations.FaceAdministrationClient.addFaceFromUrl.Request.anonymous", "com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1": "ClientCustomizations.FaceAdministrationClient.addFaceFromUrl.Request.anonymous", - "com.azure.ai.vision.face.implementation.models.CreateLivenessWithVerifySessionMultipartContent": "Face.CreateLivenessWithVerifySessionMultipartContent", + "com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest2": "ClientCustomizations.FaceAdministrationClient.addFaceFromUrl.Request.anonymous", "com.azure.ai.vision.face.implementation.models.CreatePersonRequest": "ClientCustomizations.FaceAdministrationClient.createPerson.Request.anonymous", "com.azure.ai.vision.face.implementation.models.CreateRequest": "ClientCustomizations.FaceAdministrationClient.create.Request.anonymous", "com.azure.ai.vision.face.implementation.models.CreateRequest1": "ClientCustomizations.FaceAdministrationClient.create.Request.anonymous", @@ -236,18 +217,13 @@ "com.azure.ai.vision.face.implementation.models.UpdateRequest1": "ClientCustomizations.FaceAdministrationClient.update.Request.anonymous", "com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest": "ClientCustomizations.verifyFaceToFace.Request.anonymous", "com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest": "ClientCustomizations.verifyFromLargePersonGroup.Request.anonymous", - "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.CreateLivenessWithVerifySessionContent": "Face.CreateLivenessWithVerifySessionJsonContent", - "com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult": "Face.CreateLivenessWithVerifySessionResult", + "com.azure.ai.vision.face.models.CreateLivenessSessionOptions": "Face.CreateLivenessSessionOptions", + "com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent": "Face.CreateLivenessWithVerifySessionContent", "com.azure.ai.vision.face.models.CreatePersonResult": "Face.CreatePersonResult", "com.azure.ai.vision.face.models.DetectFromSessionImageOptions": null, "com.azure.ai.vision.face.models.ExposureLevel": "Face.ExposureLevel", @@ -266,7 +242,6 @@ "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.FaceTrainingResult": "Face.TrainingResult", "com.azure.ai.vision.face.models.FaceVerificationResult": "Face.VerificationResult", "com.azure.ai.vision.face.models.FacialHair": "Face.FacialHair", @@ -282,21 +257,28 @@ "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.LivenessColorDecisionTarget": "Face.LivenessColorDecisionTarget", + "com.azure.ai.vision.face.models.LivenessDecisionTargets": "Face.LivenessDecisionTargets", + "com.azure.ai.vision.face.models.LivenessError": "Face.LivenessError", "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.LivenessResult": "Face.LivenessResult", "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.LivenessSessionAttempt": "Face.LivenessSessionAttempt", + "com.azure.ai.vision.face.models.LivenessSessionResults": "Face.LivenessSessionResults", "com.azure.ai.vision.face.models.LivenessWithVerifyOutputs": "Face.LivenessWithVerifyOutputs", + "com.azure.ai.vision.face.models.LivenessWithVerifyReference": "Face.LivenessWithVerifyReference", + "com.azure.ai.vision.face.models.LivenessWithVerifyResult": "Face.LivenessWithVerifyResult", "com.azure.ai.vision.face.models.LivenessWithVerifySession": "Face.LivenessWithVerifySession", + "com.azure.ai.vision.face.models.LivenessWithVerifySessionAttempt": "Face.LivenessWithVerifySessionAttempt", + "com.azure.ai.vision.face.models.LivenessWithVerifySessionResults": "Face.LivenessWithVerifySessionResults", "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.QualityForRecognition": "Face.QualityForRecognition" + "com.azure.ai.vision.face.models.OperationState": "Azure.Core.Foundations.OperationState", + "com.azure.ai.vision.face.models.QualityForRecognition": "Face.QualityForRecognition", + "com.azure.ai.vision.face.models.VerifyImageFileDetails": null } } diff --git a/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_metadata.json b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_metadata.json new file mode 100644 index 000000000000..c45898f2ddd7 --- /dev/null +++ b/sdk/face/azure-ai-vision-face/src/main/resources/META-INF/azure-ai-vision-face_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"v1.2","crossLanguageDefinitions":{"com.azure.ai.vision.face.FaceAsyncClient":"ClientCustomizations.FaceClient","com.azure.ai.vision.face.FaceAsyncClient.detectFromUrlImpl":"ClientCustomizations.FaceClient.detectFromUrl","com.azure.ai.vision.face.FaceAsyncClient.detectFromUrlImplWithResponse":"ClientCustomizations.FaceClient.detectFromUrl","com.azure.ai.vision.face.FaceAsyncClient.detectImpl":"ClientCustomizations.FaceClient.detect","com.azure.ai.vision.face.FaceAsyncClient.detectImplWithResponse":"ClientCustomizations.FaceClient.detect","com.azure.ai.vision.face.FaceAsyncClient.findSimilar":"ClientCustomizations.FaceClient.findSimilar","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.identifyFromLargePersonGroup":"ClientCustomizations.FaceClient.identifyFromLargePersonGroup","com.azure.ai.vision.face.FaceAsyncClient.identifyFromLargePersonGroupWithResponse":"ClientCustomizations.FaceClient.identifyFromLargePersonGroup","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.FaceClient":"ClientCustomizations.FaceClient","com.azure.ai.vision.face.FaceClient.detectFromUrlImpl":"ClientCustomizations.FaceClient.detectFromUrl","com.azure.ai.vision.face.FaceClient.detectFromUrlImplWithResponse":"ClientCustomizations.FaceClient.detectFromUrl","com.azure.ai.vision.face.FaceClient.detectImpl":"ClientCustomizations.FaceClient.detect","com.azure.ai.vision.face.FaceClient.detectImplWithResponse":"ClientCustomizations.FaceClient.detect","com.azure.ai.vision.face.FaceClient.findSimilar":"ClientCustomizations.FaceClient.findSimilar","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.identifyFromLargePersonGroup":"ClientCustomizations.FaceClient.identifyFromLargePersonGroup","com.azure.ai.vision.face.FaceClient.identifyFromLargePersonGroupWithResponse":"ClientCustomizations.FaceClient.identifyFromLargePersonGroup","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.FaceClientBuilder":"ClientCustomizations.FaceClient","com.azure.ai.vision.face.FaceSessionAsyncClient":"ClientCustomizations.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.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.detectFromSessionImage":"ClientCustomizations.FaceSessionClient.detectFromSessionImage","com.azure.ai.vision.face.FaceSessionAsyncClient.detectFromSessionImageWithResponse":"ClientCustomizations.FaceSessionClient.detectFromSessionImage","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.getLivenessWithVerifySessionResult":"ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult","com.azure.ai.vision.face.FaceSessionAsyncClient.getLivenessWithVerifySessionResultWithResponse":"ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult","com.azure.ai.vision.face.FaceSessionAsyncClient.getSessionImage":"ClientCustomizations.FaceSessionClient.getSessionImage","com.azure.ai.vision.face.FaceSessionAsyncClient.getSessionImageWithResponse":"ClientCustomizations.FaceSessionClient.getSessionImage","com.azure.ai.vision.face.FaceSessionClient":"ClientCustomizations.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.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.detectFromSessionImage":"ClientCustomizations.FaceSessionClient.detectFromSessionImage","com.azure.ai.vision.face.FaceSessionClient.detectFromSessionImageWithResponse":"ClientCustomizations.FaceSessionClient.detectFromSessionImage","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.getLivenessWithVerifySessionResult":"ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult","com.azure.ai.vision.face.FaceSessionClient.getLivenessWithVerifySessionResultWithResponse":"ClientCustomizations.FaceSessionClient.getLivenessWithVerifySessionResult","com.azure.ai.vision.face.FaceSessionClient.getSessionImage":"ClientCustomizations.FaceSessionClient.getSessionImage","com.azure.ai.vision.face.FaceSessionClient.getSessionImageWithResponse":"ClientCustomizations.FaceSessionClient.getSessionImage","com.azure.ai.vision.face.FaceSessionClientBuilder":"ClientCustomizations.FaceSessionClient","com.azure.ai.vision.face.administration.FaceAdministrationAsyncClient":"ClientCustomizations.FaceAdministrationClient","com.azure.ai.vision.face.administration.FaceAdministrationClient":"ClientCustomizations.FaceAdministrationClient","com.azure.ai.vision.face.administration.FaceAdministrationClientBuilder":"ClientCustomizations.FaceAdministrationClient","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient":"ClientCustomizations.FaceAdministrationClient.LargeFaceList","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.addFaceFromUrlImpl":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.addFaceFromUrlImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.addFaceImpl":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.addFaceImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.beginTrain":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.train","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.beginTrainWithModel":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.train","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.create":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.create","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.createWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.create","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.delete":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.deleteFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.deleteFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.deleteWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.get":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.get","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getFaces":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getFacesWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getLargeFaceLists":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getLargeFaceListsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getTrainingStatus":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getTrainingStatusWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.getWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.get","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.update":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.update","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.updateFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.updateFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace","com.azure.ai.vision.face.administration.LargeFaceListAsyncClient.updateWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.update","com.azure.ai.vision.face.administration.LargeFaceListClient":"ClientCustomizations.FaceAdministrationClient.LargeFaceList","com.azure.ai.vision.face.administration.LargeFaceListClient.addFaceFromUrlImpl":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl","com.azure.ai.vision.face.administration.LargeFaceListClient.addFaceFromUrlImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFaceFromUrl","com.azure.ai.vision.face.administration.LargeFaceListClient.addFaceImpl":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace","com.azure.ai.vision.face.administration.LargeFaceListClient.addFaceImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.addFace","com.azure.ai.vision.face.administration.LargeFaceListClient.beginTrain":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.train","com.azure.ai.vision.face.administration.LargeFaceListClient.beginTrainWithModel":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.train","com.azure.ai.vision.face.administration.LargeFaceListClient.create":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.create","com.azure.ai.vision.face.administration.LargeFaceListClient.createWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.create","com.azure.ai.vision.face.administration.LargeFaceListClient.delete":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete","com.azure.ai.vision.face.administration.LargeFaceListClient.deleteFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace","com.azure.ai.vision.face.administration.LargeFaceListClient.deleteFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.deleteFace","com.azure.ai.vision.face.administration.LargeFaceListClient.deleteWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.delete","com.azure.ai.vision.face.administration.LargeFaceListClient.get":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.get","com.azure.ai.vision.face.administration.LargeFaceListClient.getFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace","com.azure.ai.vision.face.administration.LargeFaceListClient.getFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFace","com.azure.ai.vision.face.administration.LargeFaceListClient.getFaces":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces","com.azure.ai.vision.face.administration.LargeFaceListClient.getFacesWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getFaces","com.azure.ai.vision.face.administration.LargeFaceListClient.getLargeFaceLists":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists","com.azure.ai.vision.face.administration.LargeFaceListClient.getLargeFaceListsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getLargeFaceLists","com.azure.ai.vision.face.administration.LargeFaceListClient.getTrainingStatus":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus","com.azure.ai.vision.face.administration.LargeFaceListClient.getTrainingStatusWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.getTrainingStatus","com.azure.ai.vision.face.administration.LargeFaceListClient.getWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.get","com.azure.ai.vision.face.administration.LargeFaceListClient.update":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.update","com.azure.ai.vision.face.administration.LargeFaceListClient.updateFace":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace","com.azure.ai.vision.face.administration.LargeFaceListClient.updateFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.updateFace","com.azure.ai.vision.face.administration.LargeFaceListClient.updateWithResponse":"ClientCustomizations.FaceAdministrationClient.LargeFaceList.update","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.addFaceFromUrlImpl":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.addFaceFromUrlImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.addFaceImpl":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.addFaceImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.beginTrain":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.beginTrainWithModel":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.create":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.createPerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.createPersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.createWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.delete":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.deleteFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.deleteFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.deletePerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.deletePersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.deleteWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.get":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getLargePersonGroups":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getLargePersonGroupsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getPerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getPersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getPersons":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getPersonsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getTrainingStatus":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getTrainingStatusWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.getWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.update":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.updateFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.updateFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.updatePerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.updatePersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson","com.azure.ai.vision.face.administration.LargePersonGroupAsyncClient.updateWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update","com.azure.ai.vision.face.administration.LargePersonGroupClient":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup","com.azure.ai.vision.face.administration.LargePersonGroupClient.addFaceFromUrlImpl":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl","com.azure.ai.vision.face.administration.LargePersonGroupClient.addFaceFromUrlImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFaceFromUrl","com.azure.ai.vision.face.administration.LargePersonGroupClient.addFaceImpl":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.addFaceImplWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.addFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.beginTrain":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train","com.azure.ai.vision.face.administration.LargePersonGroupClient.beginTrainWithModel":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.train","com.azure.ai.vision.face.administration.LargePersonGroupClient.create":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create","com.azure.ai.vision.face.administration.LargePersonGroupClient.createPerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.createPersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.createPerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.createWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.create","com.azure.ai.vision.face.administration.LargePersonGroupClient.delete":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete","com.azure.ai.vision.face.administration.LargePersonGroupClient.deleteFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.deleteFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deleteFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.deletePerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.deletePersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.deletePerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.deleteWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.delete","com.azure.ai.vision.face.administration.LargePersonGroupClient.get":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get","com.azure.ai.vision.face.administration.LargePersonGroupClient.getFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.getFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.getLargePersonGroups":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups","com.azure.ai.vision.face.administration.LargePersonGroupClient.getLargePersonGroupsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getLargePersonGroups","com.azure.ai.vision.face.administration.LargePersonGroupClient.getPerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.getPersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.getPersons":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons","com.azure.ai.vision.face.administration.LargePersonGroupClient.getPersonsWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getPersons","com.azure.ai.vision.face.administration.LargePersonGroupClient.getTrainingStatus":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus","com.azure.ai.vision.face.administration.LargePersonGroupClient.getTrainingStatusWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.getTrainingStatus","com.azure.ai.vision.face.administration.LargePersonGroupClient.getWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.get","com.azure.ai.vision.face.administration.LargePersonGroupClient.update":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update","com.azure.ai.vision.face.administration.LargePersonGroupClient.updateFace":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.updateFaceWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updateFace","com.azure.ai.vision.face.administration.LargePersonGroupClient.updatePerson":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.updatePersonWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.updatePerson","com.azure.ai.vision.face.administration.LargePersonGroupClient.updateWithResponse":"ClientCustomizations.FaceAdministrationClient.LargePersonGroup.update","com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest1":"ClientCustomizations.FaceAdministrationClient.addFaceFromUrl.Request.anonymous","com.azure.ai.vision.face.implementation.models.AddFaceFromUrlRequest2":"ClientCustomizations.FaceAdministrationClient.addFaceFromUrl.Request.anonymous","com.azure.ai.vision.face.implementation.models.CreatePersonRequest":"ClientCustomizations.FaceAdministrationClient.createPerson.Request.anonymous","com.azure.ai.vision.face.implementation.models.CreateRequest":"ClientCustomizations.FaceAdministrationClient.create.Request.anonymous","com.azure.ai.vision.face.implementation.models.CreateRequest1":"ClientCustomizations.FaceAdministrationClient.create.Request.anonymous","com.azure.ai.vision.face.implementation.models.DetectFromSessionImageRequest":"ClientCustomizations.detectFromSessionImage.Request.anonymous","com.azure.ai.vision.face.implementation.models.DetectFromUrlImplOptions":null,"com.azure.ai.vision.face.implementation.models.DetectFromUrlRequest":"ClientCustomizations.detectFromUrl.Request.anonymous","com.azure.ai.vision.face.implementation.models.FindSimilarFromLargeFaceListRequest":"ClientCustomizations.findSimilarFromLargeFaceList.Request.anonymous","com.azure.ai.vision.face.implementation.models.FindSimilarRequest":"ClientCustomizations.findSimilar.Request.anonymous","com.azure.ai.vision.face.implementation.models.GroupRequest":"ClientCustomizations.group.Request.anonymous","com.azure.ai.vision.face.implementation.models.IdentifyFromLargePersonGroupRequest":"ClientCustomizations.identifyFromLargePersonGroup.Request.anonymous","com.azure.ai.vision.face.implementation.models.UpdateFaceRequest":"ClientCustomizations.FaceAdministrationClient.updateFace.Request.anonymous","com.azure.ai.vision.face.implementation.models.UpdateFaceRequest1":"ClientCustomizations.FaceAdministrationClient.updateFace.Request.anonymous","com.azure.ai.vision.face.implementation.models.UpdatePersonRequest":"ClientCustomizations.FaceAdministrationClient.updatePerson.Request.anonymous","com.azure.ai.vision.face.implementation.models.UpdateRequest":"ClientCustomizations.FaceAdministrationClient.update.Request.anonymous","com.azure.ai.vision.face.implementation.models.UpdateRequest1":"ClientCustomizations.FaceAdministrationClient.update.Request.anonymous","com.azure.ai.vision.face.implementation.models.VerifyFaceToFaceRequest":"ClientCustomizations.verifyFaceToFace.Request.anonymous","com.azure.ai.vision.face.implementation.models.VerifyFromLargePersonGroupRequest":"ClientCustomizations.verifyFromLargePersonGroup.Request.anonymous","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.BlurLevel":"Face.BlurLevel","com.azure.ai.vision.face.models.BlurProperties":"Face.BlurProperties","com.azure.ai.vision.face.models.CreateLivenessSessionOptions":"Face.CreateLivenessSessionOptions","com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent":"Face.CreateLivenessWithVerifySessionContent","com.azure.ai.vision.face.models.CreatePersonResult":"Face.CreatePersonResult","com.azure.ai.vision.face.models.DetectFromSessionImageOptions":null,"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.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.FaceLivenessDecision":"Face.LivenessDecision","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.FaceTrainingResult":"Face.TrainingResult","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.LivenessColorDecisionTarget":"Face.LivenessColorDecisionTarget","com.azure.ai.vision.face.models.LivenessDecisionTargets":"Face.LivenessDecisionTargets","com.azure.ai.vision.face.models.LivenessError":"Face.LivenessError","com.azure.ai.vision.face.models.LivenessModel":"Face.LivenessModel","com.azure.ai.vision.face.models.LivenessOperationMode":"Face.LivenessOperationMode","com.azure.ai.vision.face.models.LivenessResult":"Face.LivenessResult","com.azure.ai.vision.face.models.LivenessSession":"Face.LivenessSession","com.azure.ai.vision.face.models.LivenessSessionAttempt":"Face.LivenessSessionAttempt","com.azure.ai.vision.face.models.LivenessSessionResults":"Face.LivenessSessionResults","com.azure.ai.vision.face.models.LivenessWithVerifyOutputs":"Face.LivenessWithVerifyOutputs","com.azure.ai.vision.face.models.LivenessWithVerifyReference":"Face.LivenessWithVerifyReference","com.azure.ai.vision.face.models.LivenessWithVerifyResult":"Face.LivenessWithVerifyResult","com.azure.ai.vision.face.models.LivenessWithVerifySession":"Face.LivenessWithVerifySession","com.azure.ai.vision.face.models.LivenessWithVerifySessionAttempt":"Face.LivenessWithVerifySessionAttempt","com.azure.ai.vision.face.models.LivenessWithVerifySessionResults":"Face.LivenessWithVerifySessionResults","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.OperationState":"Azure.Core.Foundations.OperationState","com.azure.ai.vision.face.models.QualityForRecognition":"Face.QualityForRecognition","com.azure.ai.vision.face.models.VerifyImageFileDetails":null}} \ No newline at end of file diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java index d7b936a16956..84290e84a3a1 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/ReadmeSamples.java @@ -1,19 +1,15 @@ // 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.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceDetectionResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; import com.azure.ai.vision.face.models.LivenessOperationMode; -import com.azure.ai.vision.face.models.LivenessResponseBody; import com.azure.ai.vision.face.models.LivenessSession; import com.azure.ai.vision.face.models.LivenessWithVerifySession; import com.azure.ai.vision.face.samples.utils.ConfigurationHelper; @@ -28,7 +24,13 @@ import java.util.List; import java.util.UUID; +import com.azure.ai.vision.face.models.FaceLivenessDecision; +import com.azure.ai.vision.face.models.LivenessWithVerifyOutputs; +import com.azure.ai.vision.face.models.LivenessWithVerifySessionAttempt; +import com.azure.ai.vision.face.models.VerifyImageFileDetails; + public final class ReadmeSamples { + public void readmeSamples() { // BEGIN: com.azure.ai.vision.face.readme // END: com.azure.ai.vision.face.readme @@ -39,9 +41,9 @@ public FaceClient keyAuthentication() { String endpoint = "https://.cognitiveservices.azure.com/"; String accountKey = ""; FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); // END: com.azure.ai.vision.face.readme.keyAuthentication return client; } @@ -52,9 +54,9 @@ public FaceClient aadAuthentication() { //variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET String endpoint = "https://.cognitiveservices.azure.com/"; FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); + .endpoint(endpoint) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); // END: com.azure.ai.vision.face.readme.aadAuthentication return client; } @@ -64,19 +66,19 @@ public void detectFace() { String accountKey = ConfigurationHelper.getAccountKey(); // BEGIN: com.azure.ai.vision.face.readme.detectFace FaceClient client = new FaceClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String imagePathString = Resources.TEST_IMAGE_PATH_DETECT_SAMPLE_IMAGE; Path path = Paths.get(imagePathString); BinaryData imageData = BinaryData.fromFile(path); List attributeTypes = Arrays.asList( - FaceAttributeType.ModelDetection03.HEAD_POSE, FaceAttributeType.ModelDetection03.MASK, FaceAttributeType.ModelRecognition04.QUALITY_FOR_RECOGNITION); + FaceAttributeType.HEAD_POSE, FaceAttributeType.MASK, FaceAttributeType.QUALITY_FOR_RECOGNITION); List results = client.detect( - imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true, - attributeTypes, true, true, 120); + imageData, FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true, + attributeTypes, true, true, 120); for (int i = 0, size = results.size(); i < size; i++) { System.out.println("----- Detection result: #" + i + " -----"); @@ -93,22 +95,29 @@ public void createLivenessSessionAndGetResult() { // BEGIN: com.azure.ai.vision.face.readme.createLivenessSessionAndGetResult System.out.println("Create a liveness session."); FaceSessionClient sessionClient = new FaceSessionClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); - CreateLivenessSessionContent parameters = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(deviceCorrelationId) - .setSendResultsToClient(false); + CreateLivenessSessionOptions parameters = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE) + .setDeviceCorrelationId(deviceCorrelationId); - CreateLivenessSessionResult createLivenessSessionResult = sessionClient.createLivenessSession(parameters); + LivenessSession createLivenessSessionResult = sessionClient.createLivenessSession(parameters); String sessionId = createLivenessSessionResult.getSessionId(); System.out.println("Result: " + sessionId); System.out.println("Get the liveness detection result."); LivenessSession session = sessionClient.getLivenessSessionResult(sessionId); - System.out.println("Result: " + session.getResult().getResponse().getBody().getLivenessDecision()); + if (session.getResults() != null + && session.getResults().getAttempts() != null + && !session.getResults().getAttempts().isEmpty()) { + + if (session.getResults().getAttempts().get(0).getResult() != null) { + FaceLivenessDecision decision = session.getResults().getAttempts().get(0).getResult().getLivenessDecision(); + System.out.println("First Attempt Result: " + decision); + } + } // END: com.azure.ai.vision.face.readme.createLivenessSessionAndGetResult } @@ -120,26 +129,33 @@ public void createLivenessWithVerifySessionAndGetResult() { // BEGIN: com.azure.ai.vision.face.readme.createLivenessWithVerifySessionAndGetResult System.out.println("Create a liveness session."); FaceSessionClient sessionClient = new FaceSessionClientBuilder() - .endpoint(endpoint) - .credential(new KeyCredential(accountKey)) - .buildClient(); + .endpoint(endpoint) + .credential(new KeyCredential(accountKey)) + .buildClient(); String deviceCorrelationId = UUID.randomUUID().toString(); - CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(deviceCorrelationId) - .setSendResultsToClient(false); Path path = Paths.get(imagePathString); BinaryData verifyImage = BinaryData.fromFile(path); + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(verifyImage); + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationId(deviceCorrelationId); - CreateLivenessWithVerifySessionResult createLivenessSessionResult = sessionClient - .createLivenessWithVerifySession(parameters, verifyImage); - String sessionId = createLivenessSessionResult.getSessionId(); + LivenessWithVerifySession livenessWithVerifySessionResults = sessionClient.createLivenessWithVerifySession(parameters); + String sessionId = livenessWithVerifySessionResults.getSessionId(); System.out.println("Result: " + sessionId); System.out.println("Get the liveness detection result."); LivenessWithVerifySession session = sessionClient.getLivenessWithVerifySessionResult(sessionId); - LivenessResponseBody response = session.getResult().getResponse().getBody(); - System.out.println("Result: " + response.getLivenessDecision() + ", Verify result:" + response.getVerifyResult()); + if (session.getResults() != null && session.getResults().getAttempts() != null + && !session.getResults().getAttempts().isEmpty()) { + LivenessWithVerifySessionAttempt attempt = session.getResults().getAttempts().get(0); + if (attempt.getResult() != null) { + FaceLivenessDecision livenessDecision = attempt.getResult().getLivenessDecision(); + LivenessWithVerifyOutputs verifyOutputs = attempt.getResult().getVerifyResult(); + System.out.println("Result: " + livenessDecision + ", Verify result:" + + (verifyOutputs != null ? verifyOutputs.toString() : "null")); + } + } // END: com.azure.ai.vision.face.readme.createLivenessWithVerifySessionAndGetResult } } diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFaces.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFaces.java index 698ce28f0fa1..aeda1f947132 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFaces.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFaces.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. - package com.azure.ai.vision.face.samples; import com.azure.ai.vision.face.FaceClient; @@ -25,11 +24,12 @@ import static com.azure.ai.vision.face.models.FaceAttributeType.ModelRecognition04; public class DetectFaces { + public static void main(String[] args) { FaceClient client = new FaceClientBuilder() - .endpoint(ConfigurationHelper.getEndpoint()) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildClient(); + .endpoint(ConfigurationHelper.getEndpoint()) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildClient(); BinaryData imageBinary = BinaryData.fromFile(FileSystems.getDefault().getPath(Resources.TEST_IMAGE_PATH_DETECT_SAMPLE_IMAGE)); List detectResult = client.detect( diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFacesAsync.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFacesAsync.java index c345afaeecb3..5b2753962d91 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFacesAsync.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectFacesAsync.java @@ -6,6 +6,7 @@ import com.azure.ai.vision.face.FaceAsyncClient; import com.azure.ai.vision.face.FaceClientBuilder; import com.azure.ai.vision.face.models.DetectOptions; +import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceDetectionResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; @@ -19,9 +20,6 @@ import java.util.Arrays; -import static com.azure.ai.vision.face.models.FaceAttributeType.ModelDetection01; -import static com.azure.ai.vision.face.models.FaceAttributeType.ModelDetection03; -import static com.azure.ai.vision.face.models.FaceAttributeType.ModelRecognition04; import static com.azure.ai.vision.face.samples.utils.Utils.log; public class DetectFacesAsync { @@ -37,7 +35,7 @@ public static void main(String[] args) { FaceDetectionModel.DETECTION_03, FaceRecognitionModel.RECOGNITION_04, true, - Arrays.asList(ModelDetection03.HEAD_POSE, ModelDetection03.MASK, ModelDetection03.BLUR, ModelRecognition04.QUALITY_FOR_RECOGNITION), + Arrays.asList(FaceAttributeType.HEAD_POSE, FaceAttributeType.MASK, FaceAttributeType.BLUR, FaceAttributeType.QUALITY_FOR_RECOGNITION), false, true, 120) @@ -46,7 +44,7 @@ public static void main(String[] args) { flux.subscribe(face -> log("Detected Face by file:" + Utils.toString(face) + "\n")); DetectOptions options = new DetectOptions(FaceDetectionModel.DETECTION_01, FaceRecognitionModel.RECOGNITION_04, false) - .setReturnFaceAttributes(Arrays.asList(ModelDetection01.ACCESSORIES, ModelDetection01.GLASSES, ModelDetection01.EXPOSURE, ModelDetection01.NOISE)) + .setReturnFaceAttributes(Arrays.asList(FaceAttributeType.ACCESSORIES, FaceAttributeType.GLASSES, FaceAttributeType.EXPOSURE, FaceAttributeType.NOISE)) .setReturnFaceLandmarks(true); flux = client.detect(Resources.TEST_IMAGE_URL_DETECT_SAMPLE, options) diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLiveness.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLiveness.java index 11bb7deeb27f..5e1b2b0dee3f 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLiveness.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLiveness.java @@ -5,16 +5,12 @@ import com.azure.ai.vision.face.FaceSessionClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessOperationMode; 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.LivenessSessionAttempt; import com.azure.ai.vision.face.samples.utils.ConfigurationHelper; -import com.azure.ai.vision.face.samples.utils.Resources; import com.azure.ai.vision.face.samples.utils.Utils; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import java.util.List; @@ -42,15 +38,12 @@ public static void main(String[] args) { .buildClient(); // Create a liveness session - CreateLivenessSessionContent parameters = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(UUID.randomUUID().toString()) - .setSendResultsToClient(false) - .setAuthTokenTimeToLiveInSeconds(60); - BinaryData data = Utils.loadFromFile(Resources.TEST_IMAGE_PATH_DETECTLIVENESS_VERIFYIMAGE); - CreateLivenessSessionResult livenessSessionCreationResult = faceSessionClient.createLivenessSession(parameters); - String sessionId = livenessSessionCreationResult.getSessionId(); - logObject("Create a liveness session: ", livenessSessionCreationResult, true); - String token = livenessSessionCreationResult.getAuthToken(); + CreateLivenessSessionOptions parameters = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE) + .setDeviceCorrelationId(UUID.randomUUID().toString()); + + LivenessSession livenessSession = faceSessionClient.createLivenessSession(parameters); + logObject("Create a liveness session: ", livenessSession, true); + String token = livenessSession.getAuthToken(); try { // 3. Pass the AuthToken to client device @@ -61,20 +54,16 @@ public static void main(String[] args) { waitingForLivenessSessionComplete(); // 8. After client devices perform the action, we can get the result from the following API - LivenessSession sessionResult = faceSessionClient.getLivenessSessionResult(livenessSessionCreationResult.getSessionId()); + LivenessSession sessionResult = faceSessionClient.getLivenessSessionResult(livenessSession.getSessionId()); logObject("Get liveness session result after client device complete liveness check: ", sessionResult); - // Get the details of all the request/response for liveness check for this sessions - List auditEntries = faceSessionClient.getLivenessSessionAuditEntries( - livenessSessionCreationResult.getSessionId()); - logObject("Get audit entries: ", auditEntries); + // Get the details of all the attempts for liveness check for this sessions + List attempts = sessionResult.getResults().getAttempts(); + logObject("List all liveness session attempts: ", attempts, true); - // We can also list all the liveness sessions of this face account. - List sessions = faceSessionClient.getLivenessSessions(); - logObject("List all the liveness sessions: ", sessions, true); } finally { // Delete this session - faceSessionClient.deleteLivenessSession(livenessSessionCreationResult.getSessionId()); + faceSessionClient.deleteLivenessSession(livenessSession.getSessionId()); } } diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessAsync.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessAsync.java index f3577b523e72..6334b0bddea5 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessAsync.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessAsync.java @@ -5,16 +5,12 @@ import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessOperationMode; 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.LivenessSessionAttempt; import com.azure.ai.vision.face.samples.utils.ConfigurationHelper; -import com.azure.ai.vision.face.samples.utils.Resources; import com.azure.ai.vision.face.samples.utils.Utils; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import java.util.List; @@ -42,20 +38,18 @@ public static void main(String[] args) { .buildAsyncClient(); // Create a liveness session - CreateLivenessSessionContent parameters = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(UUID.randomUUID().toString()) - .setSendResultsToClient(false) - .setAuthTokenTimeToLiveInSeconds(60); - BinaryData data = Utils.loadFromFile(Resources.TEST_IMAGE_PATH_DETECTLIVENESS_VERIFYIMAGE); - CreateLivenessSessionResult livenessSessionCreationResult = faceSessionClient.createLivenessSession(parameters) + CreateLivenessSessionOptions parameters = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE) + .setDeviceCorrelationId(UUID.randomUUID().toString()); + + LivenessSession livenessSessionCreationResult = faceSessionClient.createLivenessSession(parameters) .block(); - String sessionId = livenessSessionCreationResult.getSessionId(); + logObject("Create a liveness session: ", livenessSessionCreationResult, true); - String token = livenessSessionCreationResult.getAuthToken(); try { // 3. Pass the AuthToken to client device // Client device will process the step 4, 5, 6 in the documentation 'Orchestrate the liveness solution' + String token = livenessSessionCreationResult.getAuthToken(); sendTokenToClientDevices(token); // 7. wait for client device notify us that liveness session completed. @@ -66,20 +60,13 @@ public static void main(String[] args) { .block(); logObject("Get liveness session result after client device complete liveness check: ", sessionResult); - // Get the details of all the request/response for liveness check for this sessions - List auditEntries = faceSessionClient.getLivenessSessionAuditEntries( - livenessSessionCreationResult.getSessionId()) - .block(); - logObject("Get audit entries: ", auditEntries); - - // We can also list all the liveness sessions of this face account. - List sessions = faceSessionClient.getLivenessSessions() - .block(); - logObject("List all the liveness sessions: ", sessions, true); + List attempts = sessionResult.getResults().getAttempts(); + logObject("List all liveness session attempts: ", attempts, true); } finally { + String sessionId = livenessSessionCreationResult.getSessionId(); logObject("Delete liveness sessions: ", sessionId); // Delete this session - faceSessionClient.deleteLivenessSession(livenessSessionCreationResult.getSessionId()) + faceSessionClient.deleteLivenessSession(sessionId) .block(); } } diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerify.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerify.java index e62d6aaf8c4e..545a02c1b4aa 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerify.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerify.java @@ -6,10 +6,7 @@ import com.azure.ai.vision.face.FaceSessionClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessOperationMode; -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.ai.vision.face.samples.utils.ConfigurationHelper; import com.azure.ai.vision.face.samples.utils.Resources; @@ -20,6 +17,8 @@ import java.util.List; import java.util.UUID; +import com.azure.ai.vision.face.models.LivenessWithVerifySessionAttempt; +import com.azure.ai.vision.face.models.VerifyImageFileDetails; import static com.azure.ai.vision.face.samples.utils.Utils.log; import static com.azure.ai.vision.face.samples.utils.Utils.logObject; @@ -41,19 +40,22 @@ public static void main(String[] args) { .credential(new DefaultAzureCredentialBuilder().build()) .buildClient(); - CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(UUID.randomUUID().toString()) - .setSendResultsToClient(false) - .setAuthTokenTimeToLiveInSeconds(60); BinaryData data = Utils.loadFromFile(Resources.TEST_IMAGE_PATH_DETECTLIVENESS_VERIFYIMAGE); - CreateLivenessWithVerifySessionResult livenessSessionCreationResult = faceSessionClient.createLivenessWithVerifySession(parameters, data); - String sessionId = livenessSessionCreationResult.getSessionId(); - logObject("Create a liveness session: ", livenessSessionCreationResult, true); - String token = livenessSessionCreationResult.getAuthToken(); + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(data); + if (data != null) { + verifyImageFileDetails.setFilename("verify.jpg"); + } + + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationId(UUID.randomUUID().toString()); + + LivenessWithVerifySession livenessWithVerifySession = faceSessionClient.createLivenessWithVerifySession(parameters); + logObject("Create a liveness session: ", livenessWithVerifySession, true); try { // 3. Pass the AuthToken to client device // Client device will process the step 4, 5, 6 in the documentation 'Orchestrate the liveness solution' + String token = livenessWithVerifySession.getAuthToken(); sendTokenToClientDevices(token); // 7. wait for client device notify us that liveness session completed. @@ -61,20 +63,14 @@ public static void main(String[] args) { // 8. After client devices perform the action, we can get the result from the following API - LivenessWithVerifySession sessionResult = faceSessionClient.getLivenessWithVerifySessionResult(livenessSessionCreationResult.getSessionId()); + LivenessWithVerifySession sessionResult = faceSessionClient.getLivenessWithVerifySessionResult(livenessWithVerifySession.getSessionId()); logObject("Get liveness session result after client device complete liveness check: ", sessionResult); - // Get the details of all the request/response for liveness check for this sessions - List auditEntries = faceSessionClient.getLivenessWithVerifySessionAuditEntries( - livenessSessionCreationResult.getSessionId()); - logObject("Get audit entries: ", auditEntries, true); - - // We can also list all the liveness sessions of this face account. - List sessions = faceSessionClient.getLivenessWithVerifySessions(); - logObject("List all the liveness sessions: ", sessions, true); - + List attempts = sessionResult.getResults().getAttempts(); + logObject("List all liveness with verify session attempts: ", attempts, true); } finally { -// Delete this session +// Delete this session + String sessionId = livenessWithVerifySession.getSessionId(); logObject("Delete liveness sessions: " + sessionId); faceSessionClient.deleteLivenessWithVerifySession(sessionId); } diff --git a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerifyAsync.java b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerifyAsync.java index 01a36620a78b..04ad84e77d2e 100644 --- a/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerifyAsync.java +++ b/sdk/face/azure-ai-vision-face/src/samples/java/com/azure/ai/vision/face/samples/DetectLivenessWithVerifyAsync.java @@ -1,16 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. - package com.azure.ai.vision.face.samples; import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.FaceSessionClientBuilder; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessOperationMode; -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.ai.vision.face.models.LivenessWithVerifySessionAttempt; import com.azure.ai.vision.face.samples.utils.ConfigurationHelper; import com.azure.ai.vision.face.samples.utils.Resources; import com.azure.ai.vision.face.samples.utils.Utils; @@ -20,10 +17,12 @@ import java.util.List; import java.util.UUID; +import com.azure.ai.vision.face.models.VerifyImageFileDetails; import static com.azure.ai.vision.face.samples.utils.Utils.log; import static com.azure.ai.vision.face.samples.utils.Utils.logObject; public class DetectLivenessWithVerifyAsync { + public static void main(String[] args) { // This sample follows below documentation // https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/tutorials/liveness @@ -37,50 +36,46 @@ public static void main(String[] args) { // 2.Send a request to Face API to create a liveness with verify session with a VerifyImage // Create a FaceSessionClient FaceSessionAsyncClient faceSessionClient = new FaceSessionClientBuilder() - .endpoint(ConfigurationHelper.getEndpoint()) - .credential(new DefaultAzureCredentialBuilder().build()) - .buildAsyncClient(); - - CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) - .setDeviceCorrelationId(UUID.randomUUID().toString()) - .setSendResultsToClient(false) - .setAuthTokenTimeToLiveInSeconds(60); + .endpoint(ConfigurationHelper.getEndpoint()) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildAsyncClient(); + BinaryData data = Utils.loadFromFile(Resources.TEST_IMAGE_PATH_DETECTLIVENESS_VERIFYIMAGE); - CreateLivenessWithVerifySessionResult livenessSessionCreationResult = faceSessionClient.createLivenessWithVerifySession(parameters, data) - .block(); - String sessionId = livenessSessionCreationResult.getSessionId(); - logObject("Create a liveness session: ", livenessSessionCreationResult, true); - String token = livenessSessionCreationResult.getAuthToken(); + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(data); + if (data != null) { + verifyImageFileDetails.setFilename("verify.jpg"); + } + + CreateLivenessWithVerifySessionContent parameters = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationId(UUID.randomUUID().toString()); + + LivenessWithVerifySession livenessWithVerifySession = faceSessionClient.createLivenessWithVerifySession(parameters) + .block(); + + logObject("Create a liveness session: ", livenessWithVerifySession, true); try { // 3. Pass the AuthToken to client device // Client device will process the step 4, 5, 6 in the documentation 'Orchestrate the liveness solution' + String token = livenessWithVerifySession.getAuthToken(); sendTokenToClientDevices(token); // 7. wait for client device notify us that liveness session completed. waitingForLivenessSessionComplete(); // 8. After client devices perform the action, we can get the result from the following API - LivenessWithVerifySession sessionResult = faceSessionClient.getLivenessWithVerifySessionResult(livenessSessionCreationResult.getSessionId()) - .block(); + LivenessWithVerifySession sessionResult = faceSessionClient.getLivenessWithVerifySessionResult(livenessWithVerifySession.getSessionId()) + .block(); logObject("Get liveness session result after client device complete liveness check: ", sessionResult); - // Get the details of all the request/response for liveness check for this sessions - List auditEntries = faceSessionClient.getLivenessWithVerifySessionAuditEntries( - livenessSessionCreationResult.getSessionId()) - .block(); - logObject("Get audit entries: ", auditEntries, true); - - // We can also list all the liveness sessions of this face account. - List sessions = faceSessionClient.getLivenessWithVerifySessions() - .block(); - logObject("List all the liveness sessions: ", sessions, true); - + List attempts = sessionResult.getResults().getAttempts(); + logObject("List all liveness with verify session attempts: ", attempts, true); } finally { + String sessionId = livenessWithVerifySession.getSessionId(); logObject("Delete liveness sessions: " + sessionId); // Delete this session - faceSessionClient.deleteLivenessWithVerifySession(livenessSessionCreationResult.getSessionId()) - .block(); + faceSessionClient.deleteLivenessWithVerifySession(livenessWithVerifySession.getSessionId()) + .block(); } } diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/DetectionTest.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/DetectionTest.java index 6db2d1944f31..ee460862521e 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/DetectionTest.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/DetectionTest.java @@ -33,7 +33,7 @@ public class DetectionTest extends FaceClientTestBase { @ParameterizedTest - @MethodSource("getDataFortTestDetectFaceReturnFaceIdAndReturnRecognitionModel") + @MethodSource("getDataForTestDetectFaceReturnFaceIdAndReturnRecognitionModel") public void testDetectFaceReturnFaceIdAndReturnRecognitionModel(String httpClientName, FaceServiceVersion serviceVersion, Supplier detectionFunctionSupplier, boolean returnFaceId, boolean returnRecognitionModel) { @@ -55,7 +55,7 @@ public void testDetectFaceReturnFaceIdAndReturnRecognitionModel(String httpClien Assertions.assertEquals(expectReturnedModel, result.getRecognitionModel()); } - private Stream getDataFortTestDetectFaceReturnFaceIdAndReturnRecognitionModel() { + private Stream getDataForTestDetectFaceReturnFaceIdAndReturnRecognitionModel() { Boolean[] booleanArray = { false, true }; DetectionFunctionProvider[] providers = DetectionFunctionProvider .getFunctionProviders(Resources.TEST_IMAGE_PATH_FAMILY1_DAD1, Resources.TEST_IMAGE_URL_DETECT_SAMPLE); diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/FaceClientTestBase.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/FaceClientTestBase.java index 9b251c39ea2f..bf53a5f73d43 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/FaceClientTestBase.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/FaceClientTestBase.java @@ -61,11 +61,13 @@ public class FaceClientTestBase extends TestProxyTestBase { protected Stream>> createClientArgumentStream(Class clientClass, Class asyncClientClass, CommandProvider[] commandBuilders) { - return getHttpClients().flatMap(httpClient -> Arrays.stream(TestUtils.getServiceVersions()) - .flatMap(serviceVersion -> Arrays.stream(commandBuilders) - .map(builderFunction -> Tuples.of(httpClient.getClass().getSimpleName(), serviceVersion, - new CommandProviderAdapter<>(httpClient, serviceVersion, clientClass, asyncClientClass, - builderFunction))))); + + FaceServiceVersion testVersion = FaceServiceVersion.getLatest(); + + return getHttpClients().flatMap(httpClient -> Arrays.stream(commandBuilders) + .map(builderFunction -> Tuples.of(httpClient.getClass().getSimpleName(), testVersion, + new CommandProviderAdapter<>(httpClient, testVersion, clientClass, asyncClientClass, + builderFunction)))); } @SuppressWarnings("unchecked") @@ -109,7 +111,7 @@ private HttpClient createHttpClient(HttpClient httpClient, boolean isSync) { configureBuilder(T clientBuilder, HttpClient httpClient, boolean isSync) { clientBuilder.endpoint(ConfigurationHelper.getEndpoint()) - .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); switch (getTestMode()) { case PLAYBACK: diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionTest.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionTest.java index 331b3db654cc..9e3c8d51240f 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionTest.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionTest.java @@ -6,13 +6,14 @@ import com.azure.ai.vision.face.FaceServiceVersion; import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.FaceSessionClient; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessOperationMode; import com.azure.ai.vision.face.models.LivenessSession; +import com.azure.ai.vision.face.models.OperationState; import com.azure.ai.vision.face.tests.commands.liveness.ILivenessSessionSyncCommands; import com.azure.ai.vision.face.tests.commands.liveness.LivenessSessionCommandsProvider; import com.azure.ai.vision.face.tests.utils.TestUtils; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -22,6 +23,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + import reactor.util.function.Tuple3; import java.util.UUID; @@ -39,8 +41,8 @@ public class LivenessSessionTest extends FaceClientTestBase { public void testCreateSession(String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider) { String uuid = UUID.randomUUID().toString(); - CreateLivenessSessionContent content - = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid); + CreateLivenessSessionOptions content + = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid); createSessionAndVerify(commandProvider.get(), content); } @@ -48,8 +50,9 @@ public void testCreateSession(String httpClientName, FaceServiceVersion serviceV @MethodSource("getTestCommands") public void testCreateSessionDeviceIdOptional(String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider) { - CreateLivenessSessionContent content - = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE).setDeviceCorrelationIdSetInClient(true); + CreateLivenessSessionOptions content + = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE).setDeviceCorrelationIdSetInClient(true); + createSessionAndVerify(commandProvider.get(), content); } @@ -61,14 +64,11 @@ public void testCreateSessionWithTokenTTL(String httpClientName, FaceServiceVers int authTokenTimeToLiveInSeconds = 60; String uuid = UUID.randomUUID().toString(); - CreateLivenessSessionContent content - = new CreateLivenessSessionContent(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid) + CreateLivenessSessionOptions content + = new CreateLivenessSessionOptions(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid) .setAuthTokenTimeToLiveInSeconds(authTokenTimeToLiveInSeconds); - CreateLivenessSessionResult result = createSessionAndVerify(livenessCommands, content); - LivenessSession livenessSession = livenessCommands.getLivenessSessionResultSync(result.getSessionId()); - Assertions.assertNotNull(livenessSession); - Assertions.assertEquals(authTokenTimeToLiveInSeconds, livenessSession.getAuthTokenTimeToLiveInSeconds()); + createSessionAndVerify(livenessCommands, content); } @BeforeEach @@ -94,9 +94,9 @@ private Stream getTestCommands() { return TestUtils.createCombinationWithClientArguments(clientArumentStream); } - private CreateLivenessSessionResult createSessionAndVerify(ILivenessSessionSyncCommands livenessCommands, - CreateLivenessSessionContent content) { - CreateLivenessSessionResult result = livenessCommands.createLivenessSessionSync(content); + private LivenessSession createSessionAndVerify(ILivenessSessionSyncCommands livenessCommands, + CreateLivenessSessionOptions content) { + LivenessSession result = livenessCommands.createLivenessSessionSync(content); mCurrentCommand = livenessCommands; mSessionId = result.getSessionId(); @@ -104,6 +104,12 @@ private CreateLivenessSessionResult createSessionAndVerify(ILivenessSessionSyncC Assertions.assertNotNull(result); Assertions.assertNotNull(result.getSessionId()); Assertions.assertNotNull(result.getAuthToken()); + Assertions.assertNotNull(result.getStatus()); + Assertions.assertNotNull(result.getModelVersion()); + Assertions.assertNotNull(result.getResults()); + + Assertions.assertEquals(OperationState.NOT_STARTED, result.getStatus()); + Assertions.assertEquals(0, result.getResults().getAttempts().size()); return result; } diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionWithVerifyTest.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionWithVerifyTest.java index f86bd9dc2e0f..91fdac63300c 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionWithVerifyTest.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/LivenessSessionWithVerifyTest.java @@ -7,10 +7,9 @@ import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.FaceSessionClient; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessOperationMode; -import com.azure.ai.vision.face.models.LivenessWithVerifyImage; import com.azure.ai.vision.face.models.LivenessWithVerifySession; +import com.azure.ai.vision.face.models.OperationState; import com.azure.ai.vision.face.samples.utils.Resources; import com.azure.ai.vision.face.samples.utils.Utils; import com.azure.ai.vision.face.tests.commands.liveness.ILivenessWithVerifySessionSyncCommands; @@ -18,6 +17,7 @@ import com.azure.ai.vision.face.tests.utils.TestUtils; import com.azure.core.test.annotation.RecordWithoutRequestBody; import com.azure.core.util.BinaryData; + import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -27,12 +27,15 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; + import reactor.util.function.Tuple3; import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Stream; +import com.azure.ai.vision.face.models.VerifyImageFileDetails; + @DisplayNameGeneration(DisplayNameGenerator.Standard.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) @RecordWithoutRequestBody @@ -45,19 +48,30 @@ public class LivenessSessionWithVerifyTest extends FaceClientTestBase { public void testCreateSession(String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider, String path) { String uuid = UUID.randomUUID().toString(); + BinaryData imageData = path != null ? Utils.loadFromFile(path) : null; + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(imageData); + if (imageData != null) { + verifyImageFileDetails.setFilename("verify.jpg"); + } CreateLivenessWithVerifySessionContent content - = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid); - createSessionAndVerify(commandProvider.get(), content, path); + = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationId(uuid); + createSessionAndVerify(commandProvider.get(), content); } @ParameterizedTest @MethodSource("getDataForTestSessionCreation") public void testCreateSessionDeviceIdOptional(String httpClientName, FaceServiceVersion serviceVersion, Supplier commandProvider, String path) { + BinaryData imageData = path != null ? Utils.loadFromFile(path) : null; + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(imageData); + if (imageData != null) { + verifyImageFileDetails.setFilename("verify.jpg"); + } CreateLivenessWithVerifySessionContent content - = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE) + = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) .setDeviceCorrelationIdSetInClient(true); - createSessionAndVerify(commandProvider.get(), content, path); + createSessionAndVerify(commandProvider.get(), content); } @ParameterizedTest @@ -66,18 +80,22 @@ public void testCreateSessionWithTokenTTL(String httpClientName, FaceServiceVers Supplier commandProvider, String path) { ILivenessWithVerifySessionSyncCommands livenessCommands = commandProvider.get(); - int authTokenTimeToLiveInSeconds = 60; String uuid = UUID.randomUUID().toString(); + int authTokenTimeToLiveInSeconds = 60; // Set a valid TTL value instead of null + + BinaryData imageData = path != null ? Utils.loadFromFile(path) : null; + VerifyImageFileDetails verifyImageFileDetails = new VerifyImageFileDetails(imageData); + if (imageData != null) { + verifyImageFileDetails.setFilename("verify.jpg"); + } CreateLivenessWithVerifySessionContent content - = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE).setDeviceCorrelationId(uuid) + = new CreateLivenessWithVerifySessionContent(LivenessOperationMode.PASSIVE, verifyImageFileDetails) + .setDeviceCorrelationIdSetInClient(false) + .setDeviceCorrelationId(uuid) .setAuthTokenTimeToLiveInSeconds(authTokenTimeToLiveInSeconds); - CreateLivenessWithVerifySessionResult result = createSessionAndVerify(livenessCommands, content, path); - LivenessWithVerifySession livenessSession - = livenessCommands.getLivenessWithVerifySessionResultSync(result.getSessionId()); - Assertions.assertNotNull(livenessSession); - Assertions.assertEquals(authTokenTimeToLiveInSeconds, livenessSession.getAuthTokenTimeToLiveInSeconds()); + createSessionAndVerify(livenessCommands, content); } @BeforeEach @@ -105,28 +123,23 @@ private Stream getDataForTestSessionCreation() { return TestUtils.createCombinationWithClientArguments(clientArumentStream, imagePaths); } - private CreateLivenessWithVerifySessionResult createSessionAndVerify( - ILivenessWithVerifySessionSyncCommands livenessCommands, CreateLivenessWithVerifySessionContent content, - String path) { - BinaryData imageData = path != null ? Utils.loadFromFile(path) : null; - CreateLivenessWithVerifySessionResult result - = livenessCommands.createLivenessWithVerifySessionSync(content, imageData); + private LivenessWithVerifySession createSessionAndVerify(ILivenessWithVerifySessionSyncCommands livenessCommands, + CreateLivenessWithVerifySessionContent content) { + + LivenessWithVerifySession result = livenessCommands.createLivenessWithVerifySessionSync(content); - Assertions.assertNotNull(result); - mSessionId = result.getSessionId(); mCurrentCommand = livenessCommands; + mSessionId = result.getSessionId(); + Assertions.assertNotNull(result); Assertions.assertNotNull(result.getSessionId()); Assertions.assertNotNull(result.getAuthToken()); + Assertions.assertNotNull(result.getStatus()); + Assertions.assertNotNull(result.getModelVersion()); + Assertions.assertNotNull(result.getResults()); - LivenessWithVerifyImage verifyImage = result.getVerifyImage(); - if (null != path) { - Assertions.assertNotNull(verifyImage); - Assertions.assertNotNull(verifyImage.getFaceRectangle()); - Assertions.assertNotNull(verifyImage.getQualityForRecognition()); - } else { - Assertions.assertNull(verifyImage); - } + Assertions.assertEquals(OperationState.NOT_STARTED, result.getStatus()); + Assertions.assertEquals(0, result.getResults().getAttempts().size()); return result; } diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/detection/DetectSyncFunction.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/detection/DetectSyncFunction.java index ae1a58432c7d..08b4c7ed620b 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/detection/DetectSyncFunction.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/detection/DetectSyncFunction.java @@ -3,13 +3,13 @@ package com.azure.ai.vision.face.tests.commands.detection; +import java.util.List; + import com.azure.ai.vision.face.models.FaceAttributeType; import com.azure.ai.vision.face.models.FaceDetectionModel; import com.azure.ai.vision.face.models.FaceDetectionResult; import com.azure.ai.vision.face.models.FaceRecognitionModel; -import java.util.List; - public abstract class DetectSyncFunction { public abstract List execute(FaceDetectionModel detectionModel, FaceRecognitionModel recognitionModel, boolean returnFaceId, List returnFaceAttributes, diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessSessionSyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessSessionSyncCommands.java index ec35fae7fa95..f90a77b79fe8 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessSessionSyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessSessionSyncCommands.java @@ -3,12 +3,11 @@ package com.azure.ai.vision.face.tests.commands.liveness; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessSession; public interface ILivenessSessionSyncCommands { - CreateLivenessSessionResult createLivenessSessionSync(CreateLivenessSessionContent content); + LivenessSession createLivenessSessionSync(CreateLivenessSessionOptions content); LivenessSession getLivenessSessionResultSync(String sessionId); diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessWithVerifySessionSyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessWithVerifySessionSyncCommands.java index 805c4a25f82c..5d94da57c918 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessWithVerifySessionSyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/ILivenessWithVerifySessionSyncCommands.java @@ -4,13 +4,10 @@ package com.azure.ai.vision.face.tests.commands.liveness; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessWithVerifySession; -import com.azure.core.util.BinaryData; public interface ILivenessWithVerifySessionSyncCommands { - CreateLivenessWithVerifySessionResult - createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content, BinaryData verifyImage); + LivenessWithVerifySession createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content); LivenessWithVerifySession getLivenessWithVerifySessionResultSync(String sessionId); diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionAsyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionAsyncCommands.java index 7197934d57ea..9abbd1a8d3ca 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionAsyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionAsyncCommands.java @@ -4,8 +4,7 @@ package com.azure.ai.vision.face.tests.commands.liveness; import com.azure.ai.vision.face.FaceSessionAsyncClient; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessSession; import com.azure.ai.vision.face.tests.function.FunctionUtils; import reactor.core.publisher.Mono; @@ -21,7 +20,7 @@ public Mono getLivenessSessionResult(String sessionId) { return mAsyncClient.getLivenessSessionResult(sessionId); } - public Mono createLivenessSession(CreateLivenessSessionContent content) { + public Mono createLivenessSession(CreateLivenessSessionOptions content) { return mAsyncClient.createLivenessSession(content); } @@ -30,8 +29,7 @@ public Mono deleteLivenessSession(String sessionId) { } @Override - public CreateLivenessSessionResult - createLivenessSessionSync(CreateLivenessSessionContent createLivenessSessionContent) { + public LivenessSession createLivenessSessionSync(CreateLivenessSessionOptions createLivenessSessionContent) { return FunctionUtils.callAndAwait(() -> createLivenessSession(createLivenessSessionContent)); } diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionSyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionSyncCommands.java index b46ce51668cc..7a5894764655 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionSyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessSessionSyncCommands.java @@ -4,8 +4,7 @@ package com.azure.ai.vision.face.tests.commands.liveness; import com.azure.ai.vision.face.FaceSessionClient; -import com.azure.ai.vision.face.models.CreateLivenessSessionContent; -import com.azure.ai.vision.face.models.CreateLivenessSessionResult; +import com.azure.ai.vision.face.models.CreateLivenessSessionOptions; import com.azure.ai.vision.face.models.LivenessSession; class LivenessSessionSyncCommands implements ILivenessSessionSyncCommands { @@ -15,7 +14,7 @@ class LivenessSessionSyncCommands implements ILivenessSessionSyncCommands { this.mSyncClient = faceSessionClient; } - public CreateLivenessSessionResult createLivenessSessionSync(CreateLivenessSessionContent content) { + public LivenessSession createLivenessSessionSync(CreateLivenessSessionOptions content) { return mSyncClient.createLivenessSession(content); } diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionAsyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionAsyncCommands.java index cb88f1f20d68..6f676607ce33 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionAsyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionAsyncCommands.java @@ -5,10 +5,8 @@ import com.azure.ai.vision.face.FaceSessionAsyncClient; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessWithVerifySession; import com.azure.ai.vision.face.tests.function.FunctionUtils; -import com.azure.core.util.BinaryData; import reactor.core.publisher.Mono; class LivenessWithVerifySessionAsyncCommands implements ILivenessWithVerifySessionSyncCommands { @@ -18,9 +16,9 @@ class LivenessWithVerifySessionAsyncCommands implements ILivenessWithVerifySessi this.mAsyncClient = asyncClient; } - public Mono - createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { - return mAsyncClient.createLivenessWithVerifySession(content, verifyImage); + public Mono + createLivenessWithVerifySession(CreateLivenessWithVerifySessionContent content) { + return mAsyncClient.createLivenessWithVerifySession(content); } public Mono getLivenessWithVerifySessionResult(String sessionId) { @@ -32,9 +30,9 @@ public Mono deleteLivenessWithVerifySession(String sessionId) { } @Override - public CreateLivenessWithVerifySessionResult - createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { - return FunctionUtils.callAndAwait(() -> createLivenessWithVerifySession(content, verifyImage)); + public LivenessWithVerifySession + createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content) { + return FunctionUtils.callAndAwait(() -> createLivenessWithVerifySession(content)); } @Override diff --git a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionSyncCommands.java b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionSyncCommands.java index 8960a3d2debe..a15f09d99129 100644 --- a/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionSyncCommands.java +++ b/sdk/face/azure-ai-vision-face/src/test/java/com/azure/ai/vision/face/tests/commands/liveness/LivenessWithVerifySessionSyncCommands.java @@ -5,9 +5,7 @@ import com.azure.ai.vision.face.FaceSessionClient; import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionContent; -import com.azure.ai.vision.face.models.CreateLivenessWithVerifySessionResult; import com.azure.ai.vision.face.models.LivenessWithVerifySession; -import com.azure.core.util.BinaryData; class LivenessWithVerifySessionSyncCommands implements ILivenessWithVerifySessionSyncCommands { private final FaceSessionClient mSyncClient; @@ -16,9 +14,9 @@ class LivenessWithVerifySessionSyncCommands implements ILivenessWithVerifySessio mSyncClient = syncClient; } - public CreateLivenessWithVerifySessionResult - createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content, BinaryData verifyImage) { - return mSyncClient.createLivenessWithVerifySession(content, verifyImage); + public LivenessWithVerifySession + createLivenessWithVerifySessionSync(CreateLivenessWithVerifySessionContent content) { + return mSyncClient.createLivenessWithVerifySession(content); } @Override diff --git a/sdk/face/azure-ai-vision-face/tsp-location.yaml b/sdk/face/azure-ai-vision-face/tsp-location.yaml index 36a6a5076595..32634befefe7 100644 --- a/sdk/face/azure-ai-vision-face/tsp-location.yaml +++ b/sdk/face/azure-ai-vision-face/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Face -commit: cf80ee4aacdb4ef9926b42f09837fe16add9e66a +commit: 7d0f3b2c212f991070baaae92da11e6d0014f145 repo: Azure/azure-rest-api-specs additionalDirectories: